Click here to Skip to main content
15,898,374 members
Home / Discussions / Windows Forms
   

Windows Forms

 
GeneralRe: DataGridView ComboBox VB.Net (Explaination) Pin
KiwiDanChCh28-Jul-09 7:50
KiwiDanChCh28-Jul-09 7:50 
GeneralRe: DataGridView ComboBox VB.Net (Explaination) Pin
Henry Minute28-Jul-09 8:32
Henry Minute28-Jul-09 8:32 
GeneralRe: DataGridView ComboBox VB.Net (Explaination) Pin
KiwiDanChCh28-Jul-09 8:41
KiwiDanChCh28-Jul-09 8:41 
GeneralRe: DataGridView ComboBox VB.Net (Explaination) Pin
Henry Minute28-Jul-09 8:47
Henry Minute28-Jul-09 8:47 
GeneralRe: DataGridView ComboBox VB.Net (Explaination) Pin
KiwiDanChCh28-Jul-09 8:53
KiwiDanChCh28-Jul-09 8:53 
GeneralRe: DataGridView ComboBox VB.Net (Explaination) Pin
Henry Minute28-Jul-09 8:55
Henry Minute28-Jul-09 8:55 
GeneralRe: DataGridView ComboBox VB.Net (Explaination) Pin
KiwiDanChCh29-Jul-09 0:05
KiwiDanChCh29-Jul-09 0:05 
GeneralRe: DataGridView ComboBox VB.Net (Explaination) Pin
KiwiDanChCh28-Jul-09 11:24
KiwiDanChCh28-Jul-09 11:24 
Thank you for your code, this is starting to give me an insight as to what I need to do.

Here is what I have done, however I am unable to get this to work I am VERY new at this and dont quite know what event to fire

Dim HookedCombo As ComboBox

Public Sub OnComboIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
    Dim strItemCode As String = Trim(HookedCombo.Text) 'Value Of ComboBox

    '#NOTES#-----------------------------------------------------------------------
    'I have populated the combobox with some dummy string values
    'Item 01, Item 02, Item 03 etc....
    'In my final atempt I will just read this off a database but I first
    'need to understand how to get this to work without complicating it with
    'a database.
    '
    'The next line does not work I keep geting the error;
    '
    'Index was out of range. Must be non-negative and less than the size of the collection.
    'Parameter name: index
    '
    'I have noted that when the DataGridView loads (blank) the row count is 1
    'using that I tried to deduct the row count (i) by 1 (i-1) however i still get the same
    'problem.


    If strItemCode = "Item 01" Then
        Dim i As Integer = DataGridView1.SelectedRows(0).Index
        DataGridView1.Rows(i).Cells(1).Value = "Item Description 01"
    End If
End Sub


Private Sub DataGridView1_EditingControlShowing(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewEditingControlShowingEventArgs) Handles DataGridView1.EditingControlShowing

    If DataGridView1.CurrentCell.ColumnIndex = 0 Then
        HookedCombo = TryCast(e.Control, ComboBox)
        If HookedCombo Is Nothing Then
            Return
        End If

        AddHandler HookedCombo.SelectedIndexChanged, AddressOf OnComboIndexChanged

    End If
End Sub



Any ideas?
GeneralRe: DataGridView ComboBox VB.Net (Explaination) Pin
Henry Minute29-Jul-09 5:18
Henry Minute29-Jul-09 5:18 
GeneralRe: DataGridView ComboBox VB.Net (Explaination) Pin
KiwiDanChCh29-Jul-09 7:14
KiwiDanChCh29-Jul-09 7:14 
GeneralRe: DataGridView ComboBox VB.Net (Explaination) Pin
KiwiDanChCh1-Aug-09 18:52
KiwiDanChCh1-Aug-09 18:52 
GeneralRe: DataGridView ComboBox VB.Net (Explaination) Pin
Henry Minute2-Aug-09 4:49
Henry Minute2-Aug-09 4:49 
QuestionImplementing a Read-Only 'File Open' or 'File Save' Common Dialog [modified] Pin
easy games26-Jul-09 2:58
easy games26-Jul-09 2:58 
AnswerRe: Implementing a Read-Only 'File Open' or 'File Save' Common Dialog Pin
Mike Ellison27-Jul-09 2:33
Mike Ellison27-Jul-09 2:33 
GeneralRe: Implementing a Read-Only 'File Open' or 'File Save' Common Dialog Pin
easy games27-Jul-09 4:46
easy games27-Jul-09 4:46 
AnswerRe: Implementing a Read-Only 'File Open' or 'File Save' Common Dialog Pin
Dave Kreskowiak27-Jul-09 4:33
mveDave Kreskowiak27-Jul-09 4:33 
GeneralRe: Implementing a Read-Only 'File Open' or 'File Save' Common Dialog Pin
easy games27-Jul-09 5:23
easy games27-Jul-09 5:23 
GeneralRe: Implementing a Read-Only 'File Open' or 'File Save' Common Dialog Pin
Dave Kreskowiak27-Jul-09 6:48
mveDave Kreskowiak27-Jul-09 6:48 
GeneralRe: Implementing a Read-Only 'File Open' or 'File Save' Common Dialog Pin
easy games27-Jul-09 9:01
easy games27-Jul-09 9:01 
GeneralRe: Implementing a Read-Only 'File Open' or 'File Save' Common Dialog Pin
Dave Kreskowiak27-Jul-09 9:50
mveDave Kreskowiak27-Jul-09 9:50 
GeneralRe: Implementing a Read-Only 'File Open' or 'File Save' Common Dialog Pin
Mike Ellison27-Jul-09 10:22
Mike Ellison27-Jul-09 10:22 
GeneralRe: Implementing a Read-Only 'File Open' or 'File Save' Common Dialog Pin
easy games28-Jul-09 20:57
easy games28-Jul-09 20:57 
GeneralRe: Implementing a Read-Only 'File Open' or 'File Save' Common Dialog Pin
Mike Ellison29-Jul-09 5:42
Mike Ellison29-Jul-09 5:42 
QuestionAttractive programs that use Windows Forms to build their GUI Pin
copec25-Jul-09 18:48
copec25-Jul-09 18:48 
QuestionMake Dialer Pin
Any_India25-Jul-09 2:01
Any_India25-Jul-09 2:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.