DataGridTableStyle ts1 = new DataGridTableStyle();
ts1.MappingName = "default";
DataGridTextBoxColumn ID = new DataGridTextBoxColumn();
ID.MappingName = "Fid";
ID.HeaderText = "PR No";
ID .ReadOnly = true;
//ID.Width = 120;
ID .TextBox.AutoSize = true;
ts1.PreferredColumnWidth = ID .TextBox.Width;
ts1.GridColumnStyles.Add(ID);ts1.AllowSorting = false;//加个checkbox
DataGridBoolColumn Release = new DataGridBoolColumn();
Release.MappingName = "ARelease";
Release.HeaderText = "Release";
Release .AllowNull = true;
Release .ReadOnly = false;
Release .TrueValue = true;
Release .FalseValue = Convert.DBNull;
Release .NullValue = Convert.DBNull;
ts1.GridColumnStyles.Add(Release);// Add the DataGridTableStyle objects to the collection.
dataGrid1.TableStyles.Add(ts1);
ts1.MappingName = "default";
DataGridTextBoxColumn ID = new DataGridTextBoxColumn();
ID.MappingName = "Fid";
ID.HeaderText = "PR No";
ID .ReadOnly = true;
//ID.Width = 120;
ID .TextBox.AutoSize = true;
ts1.PreferredColumnWidth = ID .TextBox.Width;
ts1.GridColumnStyles.Add(ID);ts1.AllowSorting = false;//加个checkbox
DataGridBoolColumn Release = new DataGridBoolColumn();
Release.MappingName = "ARelease";
Release.HeaderText = "Release";
Release .AllowNull = true;
Release .ReadOnly = false;
Release .TrueValue = true;
Release .FalseValue = Convert.DBNull;
Release .NullValue = Convert.DBNull;
ts1.GridColumnStyles.Add(Release);// Add the DataGridTableStyle objects to the collection.
dataGrid1.TableStyles.Add(ts1);
解决方案 »
- [求助]IE插件,如何自动在新窗口打开iframe内的页面
- 制作视频播放器,要求支持swf rm rmvb mpeg wma avi
- Linq表达式问题
- 求问:SqlDataAdapter查询出现“超时时间已到。。。。”错误
- 一个关于LISTBOX很简单的问题!50分笑纳!!!
- 编码问题 iso8859-1 如何在转成 utf-8
- C#程序中,引用了微软的FlexGrid控件,利用.net自带的打包工具打包。给客户安装后,运行正常,但卸载程序,再安装时,程序报错。用编辑器
- 关于重绘的问题
- 怎么用程序获取指定目录下的所有TXT文件
- c#解压文件
- C# 点样可以罗到当前的日期时间的啊。
- 怎么样给一个datatable加空白的row?
private void CurrentCellChanged(Object sender, EventArgs e)
{
DataGridCell dgc = masterGrid.CurrentCell;
DataTable dt = ((DataSet) masterGrid.DataSource).Tables["Employees"];
String empName = dt.Rows[dgc.RowNumber][dgc.ColumnNumber].ToString() + ", " +
dt.Rows[dgc.RowNumber][2].ToString(); detailGrid.CaptionText = String.Format("Orders issued by \"{0}\"", empName);
}