2
Answers

Please Help - RowStyle Event

Photo of Anthony Clarke

Anthony Clarke

13y
2.7k
1
Hey,

I've got a Gridcontrol that is populated by a linq query but my rowstyle event doesnt seem to work.

Here is my code :

 

private

{

GridView View = sender as GridView;

if (e.RowHandle >= 0)

{

string category = View.GetRowCellDisplayText(e.RowHandle, View.Columns["Creditamount"]);

{

if (category == "Creditamount")

{

e.Appearance.BackColor =

}

But when i load my program the grid control just stays the same colour.

Hope you can help

Thanks

Anthony


Color.Red;
void gridView1_RowStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowStyleEventArgs e)

Answers (2)

1
Photo of Vulpes
NA 98.3k 1.5m 13y
You can check for a string being either null or empty with:

if (String.IsNullOrEmpty(strResult))
{                
   label1.Text = "INCORRECT USER/PASS!";
}
else
{              
   label1.Text = "YOU ARE LOGGED IN!";
}
Accepted
0
Photo of mike Delvotti
NA 287 0 13y
Thanks Vulpes, that was bang on, I've been going round in circles with that one.