Click here to Skip to main content
15,886,799 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Need help, AD & (C# or VB.NET) Pin
Eddy Vluggen8-Jan-09 0:07
professionalEddy Vluggen8-Jan-09 0:07 
GeneralRe: Need help, AD & (C# or VB.NET) Pin
hoshyarD8-Jan-09 0:50
hoshyarD8-Jan-09 0:50 
QuestionMDI form and Child form Focus Problem Pin
pdnet7-Jan-09 1:21
pdnet7-Jan-09 1:21 
AnswerRe: MDI form and Child form Focus Problem Pin
Wendelius7-Jan-09 1:48
mentorWendelius7-Jan-09 1:48 
Questionhow to change datagridviewtextboxcell to datagridviewcomboboxcell Pin
rajesh_ncc7-Jan-09 0:43
rajesh_ncc7-Jan-09 0:43 
AnswerRe: how to change datagridviewtextboxcell to datagridviewcomboboxcell Pin
Rupesh Kumar Swami7-Jan-09 3:15
Rupesh Kumar Swami7-Jan-09 3:15 
GeneralRe: how to change datagridviewtextboxcell to datagridviewcomboboxcell Pin
rajesh_ncc7-Jan-09 3:29
rajesh_ncc7-Jan-09 3:29 
GeneralRe: how to change datagridviewtextboxcell to datagridviewcomboboxcell Pin
Rupesh Kumar Swami7-Jan-09 3:40
Rupesh Kumar Swami7-Jan-09 3:40 
Suppose you want to fill the value in column 2 then use CellEnter event of datagridview as follows.

Private Sub dgv1_CellEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgv1.CellEnter<br />
<br />
         If e.ColumnIndex = 1 Then<br />
            ComboBox1.Visible = True 'comboBox1 is combo box which contains multiple item<br />
                ComboBox1.Left = dgv1.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, False).Left + dgv1.Left<br />
                ComboBox1.Top = dgv1.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, False).Top + dgv1.Top<br />
                ComboBox1.BringToFront()<br />
                <br />
                RowIndexForComboHandling = e.RowIndex<br />
                ComboBox1.Text = dgv1.Rows(e.RowIndex).Cells(e.ColumnIndex).Value<br />
                ComboBox1.Width = dgv1.Columns(1).Width<br />
        Else<br />
            ComboBox1.Visible = False<br />
        End If<br />
<br />
    End Sub<br />


and this is the lost focus event of combobox1

Private Sub ComboBox1_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBox1.LostFocus<br />
        If ComboBox1.Text.Trim <> "" Then<br />
            dgv1.CurrentCell.Value = ComboBox1.Text<br />
        End If<br />
        dgv1.Focus()<br />
        dgv1.CurrentCell = dgv1.Rows(dgv1.CurrentCell.RowIndex).Cells(dgv1.CurrentCell.ColumnIndex + 1)<br />
comboBox1.visible=false    End Sub


hope this helps

Rupesh Kumar Swami
Software Developer,
Integrated Solution,
Bikaner (India)

My Company
Award: Best VB.NET article of June 2008: Create Column Charts Using OWC11

QuestionHow to know list of machine names a person is logged in an Active Directory? Pin
Chaitanya kumar CVSS7-Jan-09 0:39
Chaitanya kumar CVSS7-Jan-09 0:39 
AnswerRe: How to know list of machine names a person is logged in an Active Directory? Pin
Dave Kreskowiak7-Jan-09 2:26
mveDave Kreskowiak7-Jan-09 2:26 
GeneralRe: How to know list of machine names a person is logged in an Active Directory? Pin
Ray Cassick7-Jan-09 3:46
Ray Cassick7-Jan-09 3:46 
QuestionPassing combo box values to datagrid view Pin
Shrimpersfan7-Jan-09 0:08
Shrimpersfan7-Jan-09 0:08 
AnswerRe: Passing combo box values to datagrid view Pin
Jon_Boy7-Jan-09 2:34
Jon_Boy7-Jan-09 2:34 
QuestionExtracting a folder image Pin
hobbitdome6-Jan-09 22:47
hobbitdome6-Jan-09 22:47 
AnswerRe: Extracting a folder image Pin
Steven J Jowett7-Jan-09 0:15
Steven J Jowett7-Jan-09 0:15 
GeneralRe: Extracting a folder image Pin
hobbitdome7-Jan-09 1:14
hobbitdome7-Jan-09 1:14 
AnswerRe: Extracting a folder image Pin
Ray Cassick7-Jan-09 3:54
Ray Cassick7-Jan-09 3:54 
GeneralRe: Extracting a folder image Pin
hobbitdome7-Jan-09 20:18
hobbitdome7-Jan-09 20:18 
AnswerRe: Extracting a folder image Pin
Dave Kreskowiak7-Jan-09 6:35
mveDave Kreskowiak7-Jan-09 6:35 
GeneralRe: Extracting a folder image Pin
hobbitdome7-Jan-09 20:22
hobbitdome7-Jan-09 20:22 
GeneralRe: Extracting a folder image Pin
Dave Kreskowiak8-Jan-09 1:35
mveDave Kreskowiak8-Jan-09 1:35 
QuestionError in MSComm. Pin
Nanda_MR6-Jan-09 20:23
Nanda_MR6-Jan-09 20:23 
AnswerRe: Error in MSComm. Pin
Guffa6-Jan-09 21:23
Guffa6-Jan-09 21:23 
GeneralRe: Error in MSComm. Pin
Nanda_MR6-Jan-09 21:33
Nanda_MR6-Jan-09 21:33 
AnswerRe: Error in MSComm. Pin
Rajesh Anuhya6-Jan-09 21:38
professionalRajesh Anuhya6-Jan-09 21:38 

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.