I guess this is my stupid question week. I have a Hierarchy Grid that has one detail grid. That grid allows rows to be edited in PopUp Mode. Before the PopUp is shown I want to increase the width of one of the gridboundcolumns that will appear on the PopUp.. I can get a handle to the field but cannot figure out how to change the width. There is no width property available. Code is posted below. I have also tried the FindControl method used in other examples but cannot get a handle to it that way. Can someone point me in the right direction? Thanks
| protected void RadGrid1_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) |
| { |
| if ("Detail".Equals(e.Item.OwnerTableView.Name)) |
| { |
| GridBoundColumn packageColumn = (GridBoundColumn)e.Item.OwnerTableView.GetColumnSafe("PackageName") as GridBoundColumn; |
| GridBoundColumn fileIdColumn = (GridBoundColumn)e.Item.OwnerTableView.GetColumnSafe("FileId") as GridBoundColumn; |
| GridBoundColumn connectionStringColumn = (GridBoundColumn)e.Item.OwnerTableView.GetColumnSafe("ConnectionString") as GridBoundColumn; |
| if (e.Item.IsInEditMode && e.Item is IGridInsertItem) |
| { |
| (e.Item as GridEditableItem)["PackageName"].Enabled = true; |
| } |
| if ("InitInsert".Equals(e.CommandName)) |
| { |
| packageColumn.ReadOnly = false; |
| fileIdColumn.ReadOnly = false; |
| connectionStringColumn.ItemStyle.Width = Unit.Pixel(200); //THIS IS THE FIELD I WANT TO CHANGE THE WIDTH OF |
| } |
| else |
| { |
| packageColumn.ReadOnly = true; |
| fileIdColumn.ReadOnly = true; |
| } |
| } |
| } |
