DataGridView 将冻结列放置在最右侧
我在 WinForms 2.0 应用程序中有一个 DataGridView,它有很多列,即使最大化,用户也必须滚动才能看到所有列。最右栏是删除按钮。我们希望始终显示删除按钮,而用户无需水平滚动。
当我尝试设置column.Frozen = true;
时,它会删除我的水平滚动条并使所有先前的列冻结。根据 Microsoft 这是由设计。
有人有解决方案吗?
I have a DataGridView in a WinForms 2.0 App that has a lot of columns, enough that even when maximized the user has to scroll to see all columns. The far right column is a delete button. We want to always display the delete button without the user having to horizontally scroll.
When I try setting column.Frozen = true;
it removes my horizontal scrollbar and makes all of the previous columns frozen. According to Microsoft this is by design.
Does anyone have a solution for this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是 VS 2005 的错误报告: https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=117002&wa=wsignin1.0#
看起来微软并不关心纠正这个问题。 “按设计”?真是个笑话。
This is a bug report for VS 2005: https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=117002&wa=wsignin1.0#
It looks like Microsoft doesnt care to correct the issue. "By design"? What a joke.
试试这个:
你会遇到问题。滚动条将位于最右侧。然后,您可以尝试以下代码:
try this:
You will have a problem. The scrollbar will be positioned to the far right. Then, you can try the code below: