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

How to apply conditional formatting without referencing the columns name?

1 Answer 76 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Antonio
Top achievements
Rank 1
Antonio asked on 06 Aug 2011, 04:33 PM
Anyone have any ideas about this one?

if (dataBoundItem.ItemIndex > 1) 
                {
                    e.Item.ForeColor = Color.Red;
                    if (Decimal.Parse(dataBoundItem["pcntchg"].Text) < 0) <<How to get the value here without using column name, I can't see how.
                    {
                        dataBoundItem["pcntchg"].ForeColor = Color.Red;
                    }
                }

Thanks!

1 Answer, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 07 Aug 2011, 05:59 PM
Hello,

You can also use Index also for example : dataBoundItem[0].Text

In addition you can also set column index for example : RadGrid1.MasterTableView.Columns[3].OrderIndex=5;

let me know if any concern.

If this is not your case then elaborate your case.

Thanks,
Jayesh Goyani
Tags
Grid
Asked by
Antonio
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Share this question
or