Click here to Skip to main content
14,736,873 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to Change Datafield of Telerik RadGrid GridBoundColumn using C#

1 solution

A generic GridColumn object does not contain the DataField property. You will have to cast this column as a GridBoundColumn in order to change DatField property.

protected void OnButtonClicked(object sender, EventArgs e)
            var boundcolumn = (GridBoundColumn)gridItems.Columns[3];
            boundcolumn.DataField = "ParentParentName";

            gridItems.DataSource = list;


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900