This is not finding the column. Anyone have any suggestions?
if (((RadGrid)sender).Columns.Contains("ClaimNumber"))
do this...
else
do this...
I checked the Columns Collection of the grid and I can see the column there.
You need to use the FindByUniqueNameSafe
method:
GridColumn col = RadRadGrid1.MasterTableView.Columns.FindByUniqueNameSafe("ColumnName");
if (col != null)
{
//column exists
}
You could also use LINQ:
if (RadGrid1.MasterTableView.Columns.Cast<GridColumn>().Count(x => x.UniqueName == "Column1") > 0)