DataGrid column width in runtime


Im developing application using +
Now i want to change column width at run time. But in run time it doesn't work.

This is what i did up to now.
data bind in form load like this.

myGrid.datasource = myDataSet.table(0)

In here dataset come properly.

in grid data bound event

 If e.Row.RowType = DataControlRowType.Header Then

Dim cell As TableCell = e.Row.Cells(1)
            cell.Width = New Unit(200) 'I added "200px" instead of 200. But it didn't work.
cell.text = "abc" 'This is working. It is show the header as abc

end if

in above code i added (as an experiment) cell.wrap = false and cell.wrap = true. that code also not effected.
There is no any error. But width doesnt work.


I added style="table-layout:fixed" to the ASP grid code. Now the problem is ok.

Question Answered as of 2 Years Ago by LastMitch
This question has already been solved: Start a new discussion instead
Start New Discussion
View similar articles that have also been tagged: