-
DataGrid
Hello,
How to move to first row in Datagrid?
i tried like
DataGrid1.row = 0
but, if there is scroll bar its not moving to first row.
i need to show the very first row in the grid.
Arjun
sp
-
Have you tried using the Scroll method of the DataGrid?
Paul
~~~~
Microsoft MVP (Visual Basic)
-
But......
Hello pclement,
I tried now but its not giving the correct results.
actually i want to check a value which is equl to grids value.
if there is a scroll bar its not giving the correct value....
Can u help me.... do u another way.
S.Arjun..
eg:
grdSch is the grid
intS is an interger - counting purpose
For intLoop = 0 To grdSch.ApproxCount
grdSch.Row = intLoop
If Trim(grdSch.Columns(1).Text) = "S"
Then
intS = intS + 1
End If
next intLoop
sp
-
I don't think I understand your question. Are you trying to locate a specific value in the DataGrid?
Paul
~~~~
Microsoft MVP (Visual Basic)
-
You can manipulate a datagrid by manipulating the recordset that you filled it with (if that's how you did it).
If you've retrieved data from a database by using a recordset and then set the source of the datagrid as this recordset -
recordset1.open(someSqlhere)
set datagrid1.source = recordset1
- then you can move to the first position in the datagrid by saying:
recordset1.moveFirst
The focus of your datagrid will automatically follow the position of the current record in the recordset.
Similarly you can get the current position by querying the recordset1.absolutePosition property.
Working with the row property of datagrids is a pain because it gives the row number calculated from the first visible row on the screen, i.e. if you have a datagrid with 50 rows and only 10 are visible on the screen then the first row that you can see will be row number 1 but the actual position could be anything from 0 to 40. Best to stick with the recordset (again, if that's how you filled your datagrid).
Hope this helps
-
But....
Hi,
I need to check how many "S" are there in the grid. which are entered by the user. After that i want to save the grids value in to databae. I have created a table like grid.
Arjun.
sp
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|