|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Combobox in datagrid
Hi All,
I am hoping I can get some feedback on a problem I am having with a combobox control in a datagrid. I am working on windows application using VB.NET. I have done lots of searching on several forums, but can't find any good threads on this particular issue. I have managed to get a combobox in the datagrid, and when a user clicks a particular cell in the datagrid, the combobox appears, and the user can drop the box and select items. The problem occurs when update or any other cell is clicked. At that point the selected item from the combobox is cleared and the cell is set back to it's original value. Basically, the user can select an item, but it will not keep the value in the cell. Here is a code snippet. When the user clicks any cell in column 4, that cell changes to a combobox, and "items1-3" are in the combobox. Private Sub DataGrid1_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGrid1.GotFocus Dim combo As New ComboBox combo.Cursor = System.Windows.Forms.Cursors.Arrow combo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDown combo.Dock = DockStyle.Fill combo.Items.Add("Item1") combo.Items.Add("Item2") combo.Items.Add("Item3") DataGridTextBoxColumn4.TextBox.Controls.Add(combo) combo.BringToFront() End Sub Any feedback would be greatly appreciated. Thank You |
|
#2
|
|||
|
|||
|
combobox in datagrid
Hi All,
I am hoping I can get some feedback on a problem I am having with a combobox control in a datagrid. I am working on windows application using VB.NET. I have done lots of searching on several forums, but can't find any good threads on this particular issue. I have managed to get a combobox in the datagrid, and when a user clicks a particular cell in the datagrid, the combobox appears, and the user can drop the box and select items. The problem occurs when update or any other cell is clicked. At that point the selected item from the combobox is cleared and the cell is set back to it's original value. Basically, the user can select an item, but it will not keep the value in the cell. Here is a code snippet. When the user clicks any cell in column 4, that cell changes to a combobox, and "items1-3" are in the combobox. Private Sub DataGrid1_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGrid1.GotFocus Dim combo As New ComboBox combo.Cursor = System.Windows.Forms.Cursors.Arrow combo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDown combo.Dock = DockStyle.Fill combo.Items.Add("Item1") combo.Items.Add("Item2") combo.Items.Add("Item3") DataGridTextBoxColumn4.TextBox.Controls.Add(combo) combo.BringToFront() End Sub Any feedback would be greatly appreciated. Thank You |
|
#3
|
|||
|
|||
|
Hi All,
I am hoping I can get some feedback on a problem I am having with a combobox control in a datagrid. I am working on windows application using VB.NET. I have done lots of searching on several forums, but can't find any good threads on this particular issue. I have managed to get a combobox in the datagrid, and when a user clicks a particular cell in the datagrid, the combobox appears, and the user can drop the box and select items. The problem occurs when update or any other cell is clicked. At that point the selected item from the combobox is cleared and the cell is set back to it's original value. Basically, the user can select an item, but it will not keep the value in the cell. Here is a code snippet. When the user clicks any cell in column 4, that cell changes to a combobox, and "items1-3" are in the combobox. Private Sub DataGrid1_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGrid1.GotFocus Dim combo As New ComboBox combo.Cursor = System.Windows.Forms.Cursors.Arrow combo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDown combo.Dock = DockStyle.Fill combo.Items.Add("Item1") combo.Items.Add("Item2") combo.Items.Add("Item3") DataGridTextBoxColumn4.TextBox.Controls.Add(combo) combo.BringToFront() End Sub Any feedback would be greatly appreciated. Thank You |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Combobox in datagrid |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|