I have a web project with devexpress component ASPxGridView. So I want to know is any apportunity to change rows appearences, and also to make conditional appearance providing some rules. I know how it works in windows application and want the same in aspx net.
Asked
Active
Viewed 3,232 times
0
-
And appearance changes like upon mouse hover row colour change or what? explain appearance changes you want. – Ebad Masood Jun 19 '12 at 09:38
-
no mouse events I don't nedd. For example I want to color those rows, where COUNT>10 ar something like this – Marianna Jun 19 '12 at 09:45
2 Answers
1
For row appearance changes handle ASPxGridView.HtmlRowPrepared event.
For cell appearance changes handle ASPxGridView.HtmlDataCellPrepared event.

Filip
- 3,257
- 2
- 22
- 38
1
Citing the example you gave you must make use of GridView Events. Like DataBount event is fired upon binding your data so you can change appearance like this:
protected void GridView1_DataBound(object sender, EventArgs e)
{
int rowindex = e.Row.RowIndex;
if (/* Your Condition */)
{
GridView1.Rows[rowindex].BackColor = System.Drawing.Color.Red;
}
}
in your aspx however you have to do something like this:
OnRowDataBound="GridView1_DataBound"
Similarly you can change appearance in other events like OnRowCreated which is fired at the time of Row Creation as name suggests.

Ebad Masood
- 2,389
- 28
- 46