如何更改 DataGrid 的列宽
我正在 C# .net 紧凑框架 3.5 中创建用户控件。 我使用带有 DataTable 的 DataGrid 控件作为 DataGrid 的数据源。 我需要使一些网格列更宽。
由于某种原因我不能...
我只是找不到控制列宽的方法或属性...
有什么想法吗?
提前致谢...
i'm creating a user control in C# .net compact framework 3.5.
And i'm using a DataGrid Control with a DataTable as the DataGrid's DataSource.
i need to make some of the grid columns wider.
for some reason i can't...
i just couldn't find the method or property that controls the column width...
any ideas?
thanks in advance...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您正在寻找列的
AutoSizeMode
和Width
属性。You're looking for the
AutoSizeMode
andWidth
properties of the columns.下面的示例代码 -
sample code below -