Here's what I'm trying to do.
I am using a RadGrid to display some data and it is bound to a dataset so the columns are autogenerated but i want to set the column widths for each individual column.
I can set the width in headerStyle but it sets all the coumns to the same width but I have 2 columns that need to be very small (20 or 30 pixels) and a third column which contains some text which needs to take up about 70 or 80% of the table.
I have tried using the following code to access the columns, which should work as long as the columns exist
but I am using this in the NeedDataSource even which isn't suitable as the rebind isn't called until after this even exits.
I have looked through the events available for RadGrid and can't see one that is suitable for executing this code after the RadGrid is populated with the columns. I need something like OnMasterTableCreated.
Any suggestions would be greatly appreciated.
I am using a RadGrid to display some data and it is bound to a dataset so the columns are autogenerated but i want to set the column widths for each individual column.
I can set the width in headerStyle but it sets all the coumns to the same width but I have 2 columns that need to be very small (20 or 30 pixels) and a third column which contains some text which needs to take up about 70 or 80% of the table.
I have tried using the following code to access the columns, which should work as long as the columns exist
| foreach (GridBoundColumn col in rGridNotes.MasterTableView.AutoGeneratedColumns) |
| { |
| if (col.UniqueName == "Type") |
| { |
| col.HeaderStyle.Width = 20; |
| } |
| } |
but I am using this in the NeedDataSource even which isn't suitable as the rebind isn't called until after this even exits.
I have looked through the events available for RadGrid and can't see one that is suitable for executing this code after the RadGrid is populated with the columns. I need something like OnMasterTableCreated.
Any suggestions would be greatly appreciated.