我在datagrid的最后添加了一行用来汇总列,可是这一列的颜色和前面数据行的颜色一样,不突出,怎么为这行变色?
解决方案 »
- 用UPDATE时更新的数据前面会加上System.Windows.Forms.TextBox, Text:
- C#中如何直接写并口打印机?
- c#模拟http发包时发现有If-Modified-Since怎么封包发生啊
- 高手帮帮忙吧!!送分
- 请问:combobox 中字符能不能从右边开始显示?
- 关于treeview的问题
- C#能开发USB驱动吗?
- 如何改变DataGrid中某列的背景色!!!在线等待
- 请教请教!!(急,在线等待)
- 如何用程序改写web.config文件中的appSettings节
- 怎么判断decimal类型的变量是否为空
- 怎样使DATAGRIDVIEW控件在单击元格时,显示的是整行被选中??
http://www.syncfusion.com/faq/windowsforms/Search/900.aspx
在winform中可以这样
DataGridViewCellStyle style=new DataGridViewCellStyle ();
style.BackColor = Color.Red ;然后取行号
dataGridView1.Rows[i].DefaultCellStyle = style;
就可以了
不知道对你有没有帮助
http://community.csdn.net/Expert/topicview.asp?id=4213082
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>
{
if (e.Item.ItemIndex==e.Item.Cells.Count-1)
{ e.Item.BackColor = Color.LightBlue ;
}
}