Hii
I am doing google like filtering in two level hierarchy. On first level I do not want filtering. In Second level I want filtering. When I create gridcolumn on page load and that column in gridtableview & add that girdtableview in mastertable then it shows me error such as "You must override Clone() method for derived grid colimn. Please help me.
Thanks in advance.
Regards,
Ketaki
5 Answers, 1 is accepted
Please check this article for more info:
http://www.telerik.com/help/aspnet-ajax/grdinheritgridcolumns.html
Regards,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Hi Vlad,
Actually in Design page I am creating mastertable. But in codeing I am writing below code
protected
void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
DataTable
dt = GeXYZTable();
GridTableView gridxyz = new GridTableView(RadGrid1);
gridxyz.AllowFilteringByColumn =
true;
foreach (DataColumn dataColumn in dt.Columns)
{
gridxyz.Columns.Clear();
if (dataColumn.ColumnName != "Edit" && dataColumn.ColumnName != "Details" && dataColumn.ColumnName != "Status")
{
//GridBoundColumn gridColumn = new GridBoundColumn ();
MyCustomFilteringColumnCS gridColumn = new MyCustomFilteringColumnCS();
gridxyz.Columns.Add(gridColumn);
gridColumn.DataField = dataColumn.ColumnName;
gridColumn.HeaderText = dataColumn.ColumnName;
gridColumn.ShowSortIcon =
false;
}
}
gridxyz.Rebind();
this.RadGrid1.MasterTableView.DetailTables.Add(gridxyz);
}
}
But it give me error as You must override Clone() method for derived grid column.
When inheriting grid columns in hierarchy, you need to override their Clone() method and copy the base properties as follows:
public override GridColumn Clone() |
{ |
RequiredGridBoundColumn requiredGridBoundColumn = new RequiredGridBoundColumn(); |
//you should override CopyBaseProperties if you have some column specific properties |
requiredGridBoundColumn.CopyBaseProperties(this); |
return requiredGridBoundColumn; |
} |
For further information you can review this online help article (bottom of the page).
Regards, Georgi Krustev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Hi
I know it's been years since this thread has been active, but I've been wondering if it's possible to get a little help in "you should override CopyBaseProperties if you have some column specific properties" part. Would you please provide a sample, I would be really grateful.
Thanks in advance
This info is mentioned here:
https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/inheritance/inheriting-grid-columns
Essentially, if you would like to create a custom grid column, please check the third solution provided in the following post: Custom Grid Column. Additionally, you can also have a look at this article:
https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/functionality/filtering/google-like-filtering
Hope this helps.
Kind regards,
Tsvetomir
Progress Telerik