DataGridView的DataBindingComplete事件未在第一行上启动

发布于 2025-01-28 12:08:25 字数 726 浏览 2 评论 0原文

我有一个绑定到数据源的DataGridView。我正在捕获DataBindingComplete事件以处理一些复选框列。一切正常,除非它是网格中的第一行,在这种情况下,事件似乎不会发射。我没有处理任何其他datagridview事件,该方法简直就是:

Private Sub DataBindingComplete(ByVal sender As System.Object,
          ByVal e As System.Windows.Forms.DataGridViewBindingCompleteEventArgs) Handles _
          grdMyGrid.DataBindingComplete

        Dim testvar As String
        testvar = "hi"   'Breakpoint is on this line

End Sub

如果我在任何行上勾选任何复选框,但是第一个断点是命中的...虽然第一行... nada。屏幕截图可能不会有很大的区别,但这就是我正在使用的...

“ https://i.sstatic.net/6jeja.jpg” alt =“ datagridview”>

I have a DataGridView which is bound to a datasource. I'm catching the DataBindingComplete event to handle some checkbox columns. Everything works fine unless it's the first row in the grid in which case the event does not seem to fire. I'm not handling any other datagridview events and the method is simply:

Private Sub DataBindingComplete(ByVal sender As System.Object,
          ByVal e As System.Windows.Forms.DataGridViewBindingCompleteEventArgs) Handles _
          grdMyGrid.DataBindingComplete

        Dim testvar As String
        testvar = "hi"   'Breakpoint is on this line

End Sub

If I tick any of the checkboxes on any row but the first the breakpoint is hit... first row though... nada. Screenshot probably won't make much difference but this is what I'm working with...

DataGridView

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文