Hello,
I have a Grid that is grouped by a field then I have added Controls to the Header on the Grid.ItemDataBound event. I then want to dynamically set the values of some of these controls. This works well on the ItemDataBound event but it doesn't always get fired, I need to use the ItemCreated event also. The problem there is I am using the following code to get the Grouped By field so I can get the values from the database:
string strtxt = header.DataCell.Text;
string[] arr = strtxt.Split(':');
string strGroupByField = arr[1].ToString();
strGroupByField = Regex.Replace(strGroupByField, @"<(.|\n)*?>", string.Empty);
Unfortunately, this fails when triggered from the ItemDataBound event, I would imagine because it hasn't quite got all the data yet.
Is there a way to force the Grid to use fire the ItemDataBound event everytime?
Thanks!
Andy
I have a Grid that is grouped by a field then I have added Controls to the Header on the Grid.ItemDataBound event. I then want to dynamically set the values of some of these controls. This works well on the ItemDataBound event but it doesn't always get fired, I need to use the ItemCreated event also. The problem there is I am using the following code to get the Grouped By field so I can get the values from the database:
string strtxt = header.DataCell.Text;
string[] arr = strtxt.Split(':');
string strGroupByField = arr[1].ToString();
strGroupByField = Regex.Replace(strGroupByField, @"<(.|\n)*?>", string.Empty);
Unfortunately, this fails when triggered from the ItemDataBound event, I would imagine because it hasn't quite got all the data yet.
Is there a way to force the Grid to use fire the ItemDataBound event everytime?
Thanks!
Andy