sanders720
Programmer
I am messing around with Datagrids in VB.NET 2003. Can these be used like the flex grid in VB6, where I can populate data according to the data itself, instead of another database structure? I have sompe properties in Autodesk Inventor that I want to manipulate!
Thanks for the help!
Private Sub cmdGetProp_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdGetProp.Click
' Define Part Document
Dim objApprenticeServerDocument = objApprenticeServerApp.Open(txtPartName.Text)
If Err.Number Then
MsgBox("Unable to open the specified file", MsgBoxStyle.OKOnly + MsgBoxStyle.Exclamation)
Exit Sub
Else
MsgBox("FILE OPEN!")
End If
On Error GoTo 0
' Properties: Summary Info
Dim oProp1 As Inventor.PropertySet
oProp1 = objApprenticeServerApp.Document.PropertySets("{F29F85E0-4FF9-1068-AB91-08002B27B3D9}")
' Properties: Design Summary Info
Dim oProp2 As Inventor.PropertySet
oProp2 = objApprenticeServerApp.Document.PropertySets("{D5CDD502-2E9C-101B-9397-08002B2CF9AE}")
' Properties: Design Tracking
Dim oProp3 As Inventor.PropertySet
oProp3 = objApprenticeServerApp.Document.PropertySets("{32853F0F-3444-11D1-9E93-0060B03C1CA6}")
' Properties: User Defined
Dim oProp4 As Inventor.PropertySet
oProp4 = objApprenticeServerApp.Document.PropertySets("{D5CDD505-2E9C-101B-9397-08002B2CF9AE}")
Dim dgtsStyle As DataGridTableStyle
Dim dgtsColumn As DataGridTextBoxColumn
dgtsStyle = New DataGridTableStyle
With dgtsStyle
.MappingName = "Properties"
End With
' Add PartNo Column
dgtsColumn = New DataGridTextBoxColumn
With dgtsColumn
.MappingName = "txtPartNo"
.HeaderText = "Part No."
.Width = 50
End With
dgtsStyle.GridColumnStyles.Add(dgtsColumn)
' Add Column PartNo
dgtsColumn = New DataGridTextBoxColumn
With dgtsColumn
.MappingName = "txtPartNo"
.HeaderText = "Part No."
.Width = 50
End With
dgtsStyle.GridColumnStyles.Add(dgtsColumn)
' Add Column RefPartNo
dgtsColumn = New DataGridTextBoxColumn
With dgtsColumn
.MappingName = "txtRefPartNo"
.HeaderText = "Ref Part No."
.Width = 50
End With
dgtsStyle.GridColumnStyles.Add(dgtsColumn)
' Add Column Length
dgtsColumn = New DataGridTextBoxColumn
With dgtsColumn
.MappingName = "txtLength"
.HeaderText = "Length"
.Width = 20
End With
dgtsStyle.GridColumnStyles.Add(dgtsColumn)
' Add Column RSP
dgtsColumn = New DataGridTextBoxColumn
With dgtsColumn
.MappingName = "chkRSP"
.HeaderText = "RSP"
.Width = 10
End With
dgtsStyle.GridColumnStyles.Add(dgtsColumn)
' Add Column Description
dgtsColumn = New DataGridTextBoxColumn
With dgtsColumn
.MappingName = "txtPartDesc"
.HeaderText = "Part Description"
.Width = 100
End With
dgtsStyle.GridColumnStyles.Add(dgtsColumn)
Thanks for the help!
Private Sub cmdGetProp_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdGetProp.Click
' Define Part Document
Dim objApprenticeServerDocument = objApprenticeServerApp.Open(txtPartName.Text)
If Err.Number Then
MsgBox("Unable to open the specified file", MsgBoxStyle.OKOnly + MsgBoxStyle.Exclamation)
Exit Sub
Else
MsgBox("FILE OPEN!")
End If
On Error GoTo 0
' Properties: Summary Info
Dim oProp1 As Inventor.PropertySet
oProp1 = objApprenticeServerApp.Document.PropertySets("{F29F85E0-4FF9-1068-AB91-08002B27B3D9}")
' Properties: Design Summary Info
Dim oProp2 As Inventor.PropertySet
oProp2 = objApprenticeServerApp.Document.PropertySets("{D5CDD502-2E9C-101B-9397-08002B2CF9AE}")
' Properties: Design Tracking
Dim oProp3 As Inventor.PropertySet
oProp3 = objApprenticeServerApp.Document.PropertySets("{32853F0F-3444-11D1-9E93-0060B03C1CA6}")
' Properties: User Defined
Dim oProp4 As Inventor.PropertySet
oProp4 = objApprenticeServerApp.Document.PropertySets("{D5CDD505-2E9C-101B-9397-08002B2CF9AE}")
Dim dgtsStyle As DataGridTableStyle
Dim dgtsColumn As DataGridTextBoxColumn
dgtsStyle = New DataGridTableStyle
With dgtsStyle
.MappingName = "Properties"
End With
' Add PartNo Column
dgtsColumn = New DataGridTextBoxColumn
With dgtsColumn
.MappingName = "txtPartNo"
.HeaderText = "Part No."
.Width = 50
End With
dgtsStyle.GridColumnStyles.Add(dgtsColumn)
' Add Column PartNo
dgtsColumn = New DataGridTextBoxColumn
With dgtsColumn
.MappingName = "txtPartNo"
.HeaderText = "Part No."
.Width = 50
End With
dgtsStyle.GridColumnStyles.Add(dgtsColumn)
' Add Column RefPartNo
dgtsColumn = New DataGridTextBoxColumn
With dgtsColumn
.MappingName = "txtRefPartNo"
.HeaderText = "Ref Part No."
.Width = 50
End With
dgtsStyle.GridColumnStyles.Add(dgtsColumn)
' Add Column Length
dgtsColumn = New DataGridTextBoxColumn
With dgtsColumn
.MappingName = "txtLength"
.HeaderText = "Length"
.Width = 20
End With
dgtsStyle.GridColumnStyles.Add(dgtsColumn)
' Add Column RSP
dgtsColumn = New DataGridTextBoxColumn
With dgtsColumn
.MappingName = "chkRSP"
.HeaderText = "RSP"
.Width = 10
End With
dgtsStyle.GridColumnStyles.Add(dgtsColumn)
' Add Column Description
dgtsColumn = New DataGridTextBoxColumn
With dgtsColumn
.MappingName = "txtPartDesc"
.HeaderText = "Part Description"
.Width = 100
End With
dgtsStyle.GridColumnStyles.Add(dgtsColumn)