- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Community,
I am developing an app (iLogic rule and a dynamic .NET form) to edit sheet metal styles in a multibody part.
I am using DatGridView tables. I have built the table with standard columns, but have been unsuccessful to add or insert a DataGridViewComboBoxColumn.
A DataGridViewComboBox column would allow the user to select from a drop-down box a different sheet metal style for each solid body in the part.
The code shown below:
Function BuildBaseTable() As DataTable
Dim myComboBoxColumn As DataGridViewComboBoxColumn = New DataGridViewComboBoxColumn
myComboBoxColumn.HeaderText = "SMStyleC"
myComboBoxColumn.Name = "MyCombo"
myComboBoxColumn.Items.Add("Style 1")
myComboBoxColumn.Items.Add("Style 2")
myComboBoxColumn.Items.Add("Style 3")
myComboBoxColumn.Items.Add("Style 4")
' Add columns
myTable.Columns.Add("Body Name", GetType(String))
myTable.columns.insert(1, myComboBoxColumn) 'ERROR OCCURS ON THIS LINE
myTable.Columns.Add("SM Style", GetType(String))
myTable.Columns.Add("Inv Material", GetType(String))
myTable.Columns.Add("Thickness", GetType(String))
' Set table name
myTable.TableName = "TableName"
' Return the updated table
Return myTable
End Function
results in this error:
Rule Compile Errors in SM_MB_Edit, in Sheet_Metal_MultiBody_Editing_01.ipt
Error on Line 79 : 'insert' is not a member of 'System.Data.DataColumnCollection'.
Please ignore the line number mismatch (12 and 79) since this is only a portion of the code.
I have searched many DataGridViewComboBoxColumn examples on the internet, but I have not been able to adapt the code for this application.
I have successfully used VB.NET examples in Visual Studio to build DGV tables with DGV comboboxes, but not in an iLogic rule.
Could anyone direct me to a resource that explains how to add a DataGridViewComboBoxColumn to this DataGridView table for use in Inventor? I hope to avoid a DLL or addin solution.
I have attached the entire SheetMetal-Multibody-Edit (SM_MB_Edit) rule for your convenience.
I am using Inventor 2022.
Thank you for your time and attention. I look forward to your replies.
Regards,
Jerry
CAD Administrator
Using Inventor 2022
Autodesk Certified Instructor
Autodesk Inventor 2020 Certified Professional
Autodesk AutoCAD 2017 Certified Professional
Solved! Go to Solution.