多谢各位高手赐教。。急。。
多谢各位高手赐教。。急。。
2006-03-13 21:33
2006-03-14 07:46
多谢2楼的gg
2006-03-14 10:52
datagrid如何让它的某一列,比如第一列不显示给用户看到?
至于第一个问题,我想有两种方法,一个是将第一列的visible属性设置成false。第二个是将第一列的宽度设置成0。但是我怎么也找不到datagridname.columns类似这样的选择。。
请高手赐教啊。。小女子还等待着交作业呢。。。。55555
2006-03-14 11:01
// C#
// Declare a new DataGridTableStyle in the
// declarations area of your form.
DataGridTableStyle ts = new DataGridTableStyle();
private void hideColumn()
{
// Set the DataGridTableStyle.MappingName property
// to the table in the data source to map to.
ts.MappingName = dataGrid1.DataMember;
// Add it to the datagrid's TableStyles collection
dataGrid1.TableStyles.Add(ts);
// Hide the first column (index 0)
dataGrid1.TableStyles[0].GridColumnStyles[0].Width = 0;
}

2006-03-14 14:05
我用了你的代码.然后调用了。
可是还是不能达到目的...能不能详细一点给我说明以下??

2006-03-15 13:34
// C#
// Declare a new DataGridTableStyle in the
// declarations area of your form.
DataGridTableStyle ts = new DataGridTableStyle(); // 声明一个DataGridTableStyle对象ts
private void hideColumn()
{
// Set the DataGridTableStyle.MappingName property
// to the table in the data source to map to.
ts.MappingName = dataGrid1.DataMember; // 把ts的MappingName属性设置为dataGrid1的数据表名
// Add it to the datagrid's TableStyles collection
dataGrid1.TableStyles.Add(ts); // 把ts加入到dataGrid1的TableStyles中去
// Hide the first column (index 0)
dataGrid1.TableStyles[0].GridColumnStyles[0].Width = 0; // 把第一列的列宽设置为0
}
[此贴子已经被作者于2006-3-15 16:14:41编辑过]

2006-03-15 16:09
2006-03-19 02:06
2006-03-20 15:08