I am not sure if that will be the right place to ask.
I am writing a asp.net composite server control, which will have a RadGrid as part of it. I don't want to expose the whole grid as a public property though, instead I would like to expose just GridColumnCollection part.
GridColumnsCollection is a read-only property though so I can't write the code below:
When I am trying to change it to something like the code below, I will get an error saying that GridColumnCollection does not have constructor which takes 0 arguments.
Is there any way to expose just columns from RadGrid as a property of a composite server control?
Thanks,
Daniel
I am writing a asp.net composite server control, which will have a RadGrid as part of it. I don't want to expose the whole grid as a public property though, instead I would like to expose just GridColumnCollection part.
GridColumnsCollection is a read-only property though so I can't write the code below:
[
Category("Grid"),
Description("Columns for a grid."),
DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
PersistenceMode(PersistenceMode.InnerProperty)
]
public GridColumnCollection GridColumns
{
get
{
EnsureChildControls();
return grid.MasterTableView.Columns;
}
set
{
EnsureChildControls();
grid.MasterTableView.Columns = value;
}
}
When I am trying to change it to something like the code below, I will get an error saying that GridColumnCollection does not have constructor which takes 0 arguments.
[
Category("Grid"),
Description("Columns for a grid."),
DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
PersistenceMode(PersistenceMode.InnerProperty)
]
public GridColumnCollection GridColumns
{
get
{
EnsureChildControls();
return grid.MasterTableView.Columns;
}
set
{
EnsureChildControls();
foreach(GridColumn col in value)
{
grid.MasterTableView.Columns.Add(col);
}
}
}
Is there any way to expose just columns from RadGrid as a property of a composite server control?
Thanks,
Daniel