Help with setup DataBindingComplete event in AddIn for Inventor (VB.Net) project needed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
(the problem below is probably not related directly to Inventor yet let me rise it here)
I need a help with setting up DataBindingComplete Event in my AddIn for Inventor (VB.Net) project.
The AddIn is supposed to constantly show its Widget (non modal WinForm) at Top-Left corner of ActiveWindow.
In case user clicks on Widget the AddIn opens another (Report) WinForm as modal with DataGridView embedded containing some data (filled by means of DataSource property).
Most things seems work as expected except - I fail to handle the completion of pass data to DGV (I need to re-Style the Table a bit).
I've corresponding sub to handle the DataBindingComplete Event which seem to never run (now it contains "Flag" MessageBox). The code of the Widget Class is:
Imports System.Windows.Forms
Public Class Widget
Friend MyReport As New Report
Friend WithEvents MyDGV As New DataGridView
Private Sub PictureBox1_Click(sender As Object, e As MouseEventArgs) Handles PictureBox1.Click
Dim oDT As System.Data.DataTable = New System.Data.DataTable
oDT.Columns.Add("Column1", GetType(String))
oDT.Columns.Add("Column2", GetType(String))
For i = 0 To 10
oDT.Rows.Add(oDT.Columns.Count)
oDT.Rows(i)("Column1") = i
oDT.Rows(i)("Column2") = i * 2
Next
MyReport.MyDGV.AutoSize = True
MyReport.MyDGV.DataSource = oDT
Trace.WriteLine("Data-Binding-Complete ???")
MyReport.ShowDialog(New WindowWrapper(g_inventorApplication.MainFrameHWND))
End Sub
Sub MyDGV_DataBindingComplete(ByVal sender As Object, ByVal E As DataGridViewBindingCompleteEventArgs) Handles MyDGV.DataBindingComplete
MessageBox.Show("!!! Data-Binding-Complete !!!")
End Sub
End Class
The complete (simplified to the problem discussed here) project is available at GitHub - https://github.com/CadMan77/iDocCheck.git
Please vote for Inventor-Idea Text Search within Option Names