WIth a previous post I was able to get the following code to resize the columns on the popup editor.
http://www.telerik.com/community/forums/aspnet-ajax/grid/radgrid-popup-editmode-field-width-issue.aspx
But now that I have added a detail table that also needs the columns resized in the popup editor so when the detail edit popup tries to appear the code abends trying to work on cells in the master grid. How can I get the resizing to work with both master and detail popups without issue?
Thanks for help in advance!
John
http://www.telerik.com/community/forums/aspnet-ajax/grid/radgrid-popup-editmode-field-width-issue.aspx
But now that I have added a detail table that also needs the columns resized in the popup editor so when the detail edit popup tries to appear the code abends trying to work on cells in the master grid. How can I get the resizing to work with both master and detail popups without issue?
Thanks for help in advance!
John
protected void RGrd_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) |
{ |
if (e.Item is GridEditFormItem && e.Item.IsInEditMode) |
{ |
GridEditFormItem editFormItem = (GridEditFormItem)e.Item; |
foreach (GridColumn col in RGrd.MasterTableView.RenderColumns) |
{ |
if (col.ColumnType == "GridBoundColumn") |
{ |
((TextBox)editFormItem[col.UniqueName].Controls[0]).Width = Unit.Pixel(575); |
} |
if (col.ColumnType == "GridDropDownColumn") |
{ |
RadComboBox ddl = (RadComboBox)editFormItem[col.UniqueName].Controls[0]; |
ddl.Width = Unit.Pixel(575); |
} |
if (col.ColumnType == "GridDateTimeColumn") |
{ |
RadDatePicker datepicker = (RadDatePicker)editFormItem[col.UniqueName].Controls[0]; |
datepicker.Width = Unit.Pixel(575); |
} |
} |
} |