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 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

Recommended Answers

All 3 Replies

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.