my problem is that i have a search form for customers ,i want to use msh flex grid to show the results of search, i am searching for a customer which are stored in a database.
suppose i want to update some information of a specific customer listed in msh flexgrid after the search.so i want to select the whole row and wen i press updatebutton these fields are retrieved into some textboxes...the problem is that with msh flex grid i can search for customers,,but cant selct a row and retrieve to text boxes for updation.

when i did with datagrid its working fine..absolutely fine...but i want to use mshflexgrid...

is there a solution for my problem

8 Years
Discussion Span
Last Post by Jx_Man

First, unless you plan on using the hierarchical aspects of the grid, I'd suggest using the standard MSFlexGrid rather than the MSHFlexGrid.

To address your question, you can use the TextMatrix property to retrieve the text from each column in the selected row.

You can find the complete reference to both FlexGrid controls in the Microsoft MSDN Library.

Private Sub UpdateButton_Click()

   Dim RowNum as long

   'Return the selected row number
   RowNum = MyGrid.Row

   'Example:  Returns the text from column 5 of the selected row
   Text1.Text = MyGrid.TextMatrix(RowNum, 5)
   'NOTE: The reverse will set the column text
   'MyGrid.TextMatrix(RowNum, 5) = "Some text value"

End Sub

please, can u gv me the code and explain how to use datagrid in vb6, ve bin trying to link with a database but it keep repeating error. thanks


please don't hijack other thread. make your own thread, so others people can read and giving some help. ok friend :)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.