Runescope
Well-known member
- Joined
- Jan 6, 2011
- Messages
- 53
- Programming Experience
- Beginner
So I have a DataGridView control, it has a few columns, one column is a DataGridViewComboBoxColumn. I have pre-filled it through it's own Items collection with the numbers 0 to 9. I want to pick one of the numbers as a default when the program loads, how do I select it's index?
Here's the code I'm using:
I've never used a combox in a datagrid before, so you'll have to be fairly explicit and simple in your explanations, but any help would be appreciated.
Here's the code I'm using:
VB.NET:
Public Sub FillMeetingMembers()
Dim MListRowVals(6) As Object
Dim MGID, MemberName As String
grdRoleCall.Rows.Clear()
For idx As Integer = 0 To MemberDT.Rows.Count - 1
With MemberDT.Rows(idx)
MGID = .Item("GID")
If IsDBNull(.Item("Member")) = True Then MemberName = " " Else MemberName = .Item("Member")
MListRowVals(0) = MemberName
MListRowVals(1) = iCons.Images(19)
MListRowVals(2) = iCons.Images(19)
MListRowVals(3) = 0 ' <-- This is the line I want to set.
MListRowVals(4) = MGID
MListRowVals(5) = 0
grdRoleCall.Rows.Add(MListRowVals)
End With
Next
End Sub
I've never used a combox in a datagrid before, so you'll have to be fairly explicit and simple in your explanations, but any help would be appreciated.
Last edited: