CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2005
    Posts
    101

    Red face DataGrid DoubleClick ?

    hi


    i have some values like company deatils in DataGrid.
    i want to select the company name and corresponding row by doubleclick or
    a button out side the Grid contol.means how to select a entair row and Name (comapany Name) From Grid?

    thanks in avance

  2. #2
    Join Date
    Jan 2005
    Location
    City of Smiles!
    Posts
    125

    Re: DataGrid DoubleClick ?

    in the datagrid DoubleClick event, type this and see how it works


    textbox1.Text = datagrid1.Item(datagrid1.CurrentCell.RowNumber, 0)
    textbox2.Text = datagrid1.Item(datagrid1.CurrentCell.RowNumber, 1)


    if you place two textboxes on your form, doubleclicking the datagrid will place the values of the first 2 columns into the textboxes.just increment the column number to refer to the other columns.

    hope this is what u need...

    happy coding!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured