// This runs for each row in your grid protectedvoid RadGrid1_ItemDataBound(Object sender, Telerik.WebControls.GridItemEventArgs e)
{
if (e.Item is GridDataItem) //Make sure we're dealing with a data item
{
GridDataItem dataRow = e.Item as GridDataItem;
if (dataRow["Country"].Text = "Mexico") //"Country" is the unique column name, and Text is it's value
{
dataRow.CssClass = "MyMexicoRowClass";
}
TextBox president = (TextBox)dataRow["Presidents"].FindControl("presNameTextBox"); //This finds the controls in your template column names "Presidents"
the (e.Item is GridDataItem) is exactly pinpoint the problem since i have error when running. It's appear that ItemDataBound is triggered for header, pager... also. and FindControl in that moment return null. Hope that helps others.