I populate a gridview dynamically which has differen column numbers depend on requirements. My goal is to adjust column width dynamically. I have tried several methods and events, then RowCreated event of GridView looks best one to do. My code is as below. When i check result at the ViewSource on the browser, i can see that width of <td> successfully adjusted. BUT nothing changes on the browser, column width always as wide as text? Can you please advise what to do?
Protected Sub GridViewAgeing_RowCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridViewAgeing.RowCreated
If e.Row.RowType = DataControlRowType.Header Then
Dim td As TableCell
For Each td In e.Row.Cells
td.Width = Unit.Pixel(500)
td.Text = td.Text.Replace("_", " ")
If e.Row.RowType = DataControlRowType.DataRow Then
Dim td2 As TableCell
For Each td2 In e.Row.Cells
td2.Width = Unit.Pixel(500)
HTML RESULT SUCCESSFUL
<table cellspacing="0" rules="all" border="
View Complete Post