This is a migrated thread and some comments may be shown as answers.

best method to compare the values of two columns

1 Answer 39 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dawson
Top achievements
Rank 1
Dawson asked on 02 May 2014, 01:03 PM
Hi
which is the best method to compare the values of two columns?

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 02 May 2014, 01:08 PM
Hi Dawson,

You can use the ItemDataBound event of the radgrid to compare values of two columns.

C#:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
 if (e.Item is GridDataItem)
  {
    GridDataItem dataItem=(GridDataItem)e.Item;
    if (string.Equals(dataItem["Column1UniqueName"].Text, dataItem["Column2UniqueName"].Text))
    {
        //Your code
    }
  }
}

Thanks,
Princy
Tags
Grid
Asked by
Dawson
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Share this question
or