This topic has been archived. It cannot be replied.
-
工作学习 / 专业技术讨论 / 请教高手,如何在C# Window Form编程中 make DataGrid column Invisible. 我google了一下.好象是设定 DataGridColumnStyle 宽度为0. 但是not work.请帮助.
-xiangwei00(纽约小子);
2007-2-8
(#3485020@0)
-
up
-xiangwei00(纽约小子);
2007-2-8
(#3485137@0)
-
GridColumnStylesCollection.Remove Method or GridColumnStylesCollection.RemoveAt MethodDataGrid.TableStyles Property
==>GridTableStylesCollection Class
==>GridTableStylesCollection.Item Property
==>DataGridTableStyle Class
==>DataGridTableStyle.GridColumnStyles Property
==>GridColumnStylesCollection Class
-tjhong(TjHong);
2007-2-8
{227}
(#3485574@0)
-
设0是比较赖的方法。只能在代码中设,不能再design time时设。这个方法有副作用,横向scrollbar会有怪异的行为。
-tjhong(TjHong);
2007-2-8
(#3485612@0)
-
多谢帮助, 我找到了.dgcs = new DataGridTextBoxColumn(); //DataGridColumnStyle
dgcs.MappingName = "EvePhone";
dgcs.Width = 0;
dgts.GridColumnStyles.Add(dgcs);
dgts.GridColumnStyles.RemoveAt(1);
dataGrid1.TableStyles.Add(dgts);
use Tooltip to show invisible column.
Thanks
-xiangwei00(纽约小子);
2007-2-8
{426}
(#3485720@0)