Is there any way to indicate row number of a datagrid? I mean
list1.listindex = 1 means 2nd item of that list box,
how can i indicate such type in datagrid?
I want to select a row from datagrid and with my given criteria depending on the row number or such indicating number, value will be changed in text box. how can i indicate row?
Please help me.....

Recommended Answers

All 3 Replies

Private Sub DataGrid1_Click()
dg.MarqueeStyle = dbgHighlightRowRaiseCell
myVariable = DataGrid1.Columns(0).Value
End Sub

DataGrid1.FirstRow + DataGrid1.Row - 1

FirstRow is the row number of the first row that is visible in the grid.
Row is the row number of the rows that are visible.
-1 is to offset Firstrow which starts at 1

Be a part of the DaniWeb community

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