I have an UltraWebGrid that is bound to a sql data source through the code behind. I have also added a check box column through the code behind but don't know how to set the checked property based on a value of another column in the same row.
Any Ideas?
My sample would by a column called "First" which has a value of true or false. If the value on a particular row is true, then the checkbox on that row needs to be checked.
Thanks for the help!
Hello mnmjones,
Thank you for the udpdate.
Hope hearing from you.
Sorry about the delayed response, I was out of work for a few days. I will give your sample a try. Looks pretty easy.
Please let us know if you need further assistance.
I recommend you using InitializeRow for the purpose.
In my scenario I have 2 columns:
1) ProductID - int value , depending on it I will change the checkbox state
2) Discontinued -boolean , the checkbox column
protected void UltraWebGrid1_InitializeRow(object sender, Infragistics.WebUI.UltraWebGrid.RowEventArgs e)
{
int cellValue = (int)e.Row.Cells.FromKey("ProductID").Value;
if (cellValue % 2 == 0)
e.Row.Cells.FromKey("Discontinued").Value = true;
}
else {
e.Row.Cells.FromKey("Discontinued").Value = false;
Please let me know if you need further assistance regarding this.