Comboboxes in windows forms datagrid

G

Guest

There is an article with an example on this topic. ( article 323167).
The example works good if the datagrid column is string type. Here is a portion of code that handles text changed:
------------------------------
Private Sub Ctrls_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs)
If DataGrid1.CurrentCell.ColumnNumber = 3 Then
MyCombo.Visible = False
If DataGrid1.Item(DataGrid1.CurrentCell) & "" = "" Then
SendKeys.Send("*")
End If
DataGrid1.Item(DataGrid1.CurrentCell) = MyCombo.Text
End If
End Sub
---------------------

I have problem to make this work for column with integer type. When I select an integer from the combobox, the screen freezes, error either in SendKeys.Send("*")
or DataGrid1.Item(DataGrid1.CurrentCell) = MyCombo.Text complaining about data type.

Any hits are welcome.

Jenny
 
O

One Handed Man \( OHM - Terry Burns \)

This was from Scorp a few days ago

http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q480q

http://www.syncfusion.com/faq/winforms/Files/DataGridBoundCombo_vb.zip

http://dotnet.leadit.be/extendeddatagrid

http://www.knowdotnet.com/articles/kdngrid.html


HTH
--

OHM ( Terry Burns )
. . . One-Handed-Man . . .


JennySm said:
There is an article with an example on this topic. ( article 323167).
The example works good if the datagrid column is string type. Here is a
portion of code that handles text changed:
------------------------------
Private Sub Ctrls_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs)
If DataGrid1.CurrentCell.ColumnNumber = 3 Then
MyCombo.Visible = False
If DataGrid1.Item(DataGrid1.CurrentCell) & "" = "" Then
SendKeys.Send("*")
End If
DataGrid1.Item(DataGrid1.CurrentCell) = MyCombo.Text
End If
End Sub
select an integer from the combobox, the screen freezes, error either in
SendKeys.Send("*")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top