关于datagrid

dqjia 2004-10-22 03:05:27
DataGridTextBoxColumn设定列Text.Enable属性为false 但是当点中列中某项时该列仍以不同的颜色显示,如何去掉?
谢谢!
...全文
155 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
BasaraTracy 2004-11-19
  • 打赏
  • 举报
回复
ding
shaoweiok 2004-11-19
  • 打赏
  • 举报
回复
private void AddCustomDataTableStyle()
{
DataGridTableStyle ts1 = new DataGridTableStyle();
ts1.MappingName = "Customers";
// Set other properties.
ts1.AlternatingBackColor = Color.LightGray;

/* Add a GridColumnStyle and set its MappingName
to the name of a DataColumn in the DataTable.
Set the HeaderText and Width properties. */

DataGridColumnStyle boolCol = new DataGridBoolColumn();
boolCol.MappingName = "Current";
boolCol.HeaderText = "IsCurrent Customer";
boolCol.Width = 150;
ts1.GridColumnStyles.Add(boolCol);

// Add a second column style.
DataGridColumnStyle TextCol = new DataGridTextBoxColumn();
TextCol.MappingName = "custName";
TextCol.HeaderText = "Customer Name";
TextCol.Width = 250;
ts1.GridColumnStyles.Add(TextCol);
/* Add the DataGridTableStyle instances to
the GridTableStylesCollection. */
myDataGrid.TableStyles.Add(ts1);

}
happyjun2000 2004-10-23
  • 打赏
  • 举报
回复
顶,接点分^_^
无聊就接分来了
dqjia 2004-10-22
  • 打赏
  • 举报
回复
skyeenet(一心一意进微软) ( ) 信誉:100
能给出示例代码吗?
谢谢!
dqjia 2004-10-22
  • 打赏
  • 举报
回复
实在是佩服,现在还有人回复!
skyeenet 2004-10-22
  • 打赏
  • 举报
回复
重写 Onclick 处理方法
alwaysinsist 2004-10-22
  • 打赏
  • 举报
回复
格式化,我想学!
Uncommon 2004-10-22
  • 打赏
  • 举报
回复
[ASP.NET]格式化 DataGrid 输出
http://www.6gee.com/more.asp?name=yulin&id=418

DataGrid删除确认及Item颜色交替
http://www.donews.net/blueoxygen/archive/2004/04/17/12864.aspx

110,566

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧