Yes. The grid will pick up the settings for autogenerated columns if the latter is loaded in the former's DataBound event. The hidden columns need to be forced to render by setting Visible = true to them. Once rendered, the columns that are hidden on load would have a negative width. An additional css rule for the columns forcing a min-width to them is required.
private
void
Grid_DataBound(
object
sender, EventArgs e)
{
if
(!IsPostBack)
{
LoadPersistenceManagerState();
// Skip the first two columns that are Telerik-generated
var autogeneratedColumnsFromDataSource = ((RadGrid)sender).MasterTableView.RenderColumns.Skip(2);
// Force all columns to be rendered in markup, including those hidden after loading the state
foreach
(var column
in
autogeneratedColumnsFromDataSource)
{
column.Visible =
true
;
}
}
}
[id$=
"Grid"
] .CustomColumnCssClass, [id$=
"Grid"
] .rgDataDiv td {
min-width
:
150px
;
width
:
1px
;
/* Force hidden columns with negative width to respect min-width */
}