Home  |  Index  |  Dotnet4all Snippets  |  Submit resources
About  |  Mail us  
Dotnet4all Logo
Comboboxes in windows forms datagrid (Tuesday, January 03, 2006)
 

Found the following interesting discussion in the Newsgroups:

Comboboxes in windows forms datagrid
by:Anonymous

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


 Reply:
by: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 )



Posted by Xander Zelders



 
Previous Posts
    - Sometimes I want to skip a page - How to do that
    - FxCop Error on command button
    - How to scroll down on listView (programmatically)
    - Open a file save as byte
    - How to add a property to an inherited tool?
    - Retrieve Domain Names
    - listView + events
    - RTC and VB.NET
    - How to change an image?
    - Q: Names of worksheets in ExcelQ: Names of workshe...

Archives
    - 08/01/2004 - 08/08/2004
    - 08/08/2004 - 08/15/2004
    - 08/15/2004 - 08/22/2004
    - 08/22/2004 - 08/29/2004
    - 08/29/2004 - 09/05/2004
    - 09/05/2004 - 09/12/2004
    - 09/12/2004 - 09/19/2004
    - 09/19/2004 - 09/26/2004
    - 09/26/2004 - 10/03/2004
    - 10/03/2004 - 10/10/2004
    - 01/02/2005 - 01/09/2005
    - 01/09/2005 - 01/16/2005
    - 01/30/2005 - 02/06/2005
    - 01/01/2006 - 01/08/2006


Disclaimer & Terms of Use  | DotNet4All.Com concept & © 2004 - 2007 by  Zelders²  - Holland