设置datagridtablestyle中的颜色试试,看看效果

解决方案 »

  1.   

    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
      

  2.   

    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;
      

  3.   

    奇怪了,我的DataGrid没有Columns、rows之类的属性啊