Private Sub Button1_Click_1(sender As System.Object, e As System.EventArgs) _ Handles Button1.Click Dim source As New DataTable() source.Columns.Add("desc") source.Columns.Add(New DataColumn("value", GetType(Integer))) Dim row As DataRow = source.NewRow row("desc") = "for User to use" row("value") = 1 source.Rows.Add(New Object() {"for User to use", 2}) source.Rows.Add(New Object() {"Not for User to use 1", 4}) source.Rows.Add(New Object() {"Not for User to use 2", 6}) Dim combocol As New DataGridViewComboBoxColumn() With combocol .Name = "combo" .DataSource = source .ValueMember = "value" .DisplayMember = "desc" 'i am looking for something like: '############################## '.HideEntry(1) 'Index 'or '.HideEntry(4) 'Value 'or '.HideEntry("Not for User to use 1") 'Text 'so the User can only select 'for User to use' End With DataGridView1.Columns.Add(combocol) Dim Content As New DataTable() With Content .Columns.Add("col1") .Columns.Add("col2") .Rows.Add(New String() {"hallo", "hans"}) .Rows.Add(New String() {"wie", "gehts"}) End With DataGridView1.DataSource = Content 'This should make to code but shoud be dissabled for the user use DataGridView1.Rows(2).Cells("combo").Value = 4 End Sub
''''''' This can be remove the row source.Rows(1).Delete()
'DataGridView1.Rows(2).Cells("combo").Value = 4 Me.DataGridView1.Rows(1).Cells(0).ReadOnly = True
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)