我在datagrid的最后添加了一行用来汇总列,可是这一列的颜色和前面数据行的颜色一样,不突出,怎么为这行变色?

解决方案 »

  1.   

    参看
    http://www.syncfusion.com/faq/windowsforms/Search/900.aspx
      

  2.   

    是webform程序,不是winform,有没有直截了当的说怎么做?
      

  3.   

    可在itemdataband(??)事件中稍做控制..
      

  4.   

    实际上就是将datagrid的最后一行变色
      

  5.   

    首先声明不是开发web的
    在winform中可以这样
    DataGridViewCellStyle style=new DataGridViewCellStyle ();
    style.BackColor = Color.Red ;然后取行号
    dataGridView1.Rows[i].DefaultCellStyle = style;
    就可以了
    不知道对你有没有帮助
      

  6.   

    参看
    http://community.csdn.net/Expert/topicview.asp?id=4213082
      

  7.   

    c#
    private void GrideItemBond(object sender,System.Web.UI.WebControls.DataGridItemEventArgs e)
    {
    #region
    e.Item.Attributes.Add("onmouseover", "this.style.backgroundColor='#ffffcc'");
    e.Item.Attributes.Add("onmouseout","this.style.backgroundColor=''");
    #endregion
    }
    this.cpgride.ItemDataBound += new System.Web.UI.WebControls.DataGridItemEventHandler(this.GrideItemBond);
    --aspx<ItemTemplate>
    <input type="text" ID="yweight" Runat="server" class="blueinput" size="6" onkeydown="must_num()" readonly value='<%# DataBinder.Eval(Container.DataItem,"inweight") %>'>
    </ItemTemplate>
      

  8.   

    public void DGlistItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
    {

    if (e.Item.ItemIndex==e.Item.Cells.Count-1)
    { e.Item.BackColor = Color.LightBlue ;

    }
    }