5.63 How can I change the font used in a grid cell on a cell by cell or row by row basis? http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q927q
there is an example ,hope this helps // Get a count of the number of items int a = DataGrid.Items.Count - 1; int b = 0; // Get a count of the number of columns int y = DataGrid.Columns.Count - 1; int z = 0; //Loop through all items in the datagrid while (z<=y) { //Loop columns for each item b = 0; while (b<=a) { // Get the value held in the cell we're formating string Text = DataGrid.Items[b].Cells [z].Text.ToString(); // And format the cell accordingly if (Text == "true") { dgPositionDetail.Items[b].Cells [z].ForeColor = System.Drawing.Color.White; dgPositionDetail.Items[b].Cells [z].BackColor = System.Drawing.Color.Red; } } b = b+1; } z = z+1;
http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q927q
// Get a count of the number of items
int a = DataGrid.Items.Count - 1;
int b = 0;
// Get a count of the number of columns
int y = DataGrid.Columns.Count - 1;
int z = 0;
//Loop through all items in the datagrid
while (z<=y)
{
//Loop columns for each item
b = 0;
while (b<=a)
{
// Get the value held in the cell we're
formating
string Text = DataGrid.Items[b].Cells
[z].Text.ToString();
// And format the cell accordingly
if (Text == "true")
{
dgPositionDetail.Items[b].Cells
[z].ForeColor = System.Drawing.Color.White;
dgPositionDetail.Items[b].Cells
[z].BackColor = System.Drawing.Color.Red;
}
} b = b+1;
}
z = z+1;