I am not sure what you mean by bound criteria.
But to change the backcolor of a row in a gridListConttrol, you can subscribe to gridListControl1.Grid.QueryCellInfo. There, if e.RowIndex points to the row you want to color, then set e.Style.BackColor to your color.
As far as applying a format string to a column, you can use teh same QueryCellInfo event. If you set teh style.Fromat, you will also have to set teh style.CellValueType so the grid knows what type you are trying to format.
private void grid_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)
{
if(e.RowIndex == 2 && e.ColIndex > 0)
{
e.Style.BackColor = Color.Red;
}
else if(e.RowIndex > 0 && e.ColIndex == 1)
{
e.Style.Format = "##.##";
e.Style.CellValueType = typeof(double);
}
}
KA
kalicharan
August 16, 2004 08:09 AM
I did the same way suggested.
But when I am clicking on the grid it is not displaying anything in the grid.
Strange problem, just a Mathematical Symbol with Triangles is getting displayed.
What could be reason.
This the code I have written.
switch(e.ColIndex)
{
case 1:
e.Style.Format = "HH00";
e.Style.CellValueType = typeof(System.DateTime);
break;
case 2:
// if(Convert.ToInt32(glcViewAppts.Grid[e.RowIndex, 2].Text) < 1 )
// {
// glcViewAppts.BeginUpdate();
// glcViewAppts.Grid[e.RowIndex, 1].BackColor = Color.Red;
// glcViewAppts.EndUpdate();
// }
break;
}