I use the base class to change the behavior of any Telerik RadGrid that appears on my ASP.Net pages. In the base class, I want to perform certain operations (install Css, tool tips, etc.) in many common columns, but not every common column exists in every grid.
In the ItemDataBound event, I get an instance in GridDataItem, and in turn I want to get a link to one or more contained GridDataItem cells:
var cell = gridDataItem["ColumnUniqueName"]
The problem is that this throws a GridException if the named column does not exist:
Could not find cell associated with column name 'ColumnUniqueName'
Is there a way to check for a column by name before referencing it, or am I stuck with try catch?
source share