469,611 Members | 1,990 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,611 developers. It's quick & easy.

datagrid current row

Gday,

Am new to using datagrids so if anyone could assist or point in the right
direction in terms of resources - that would be much appreciated...

I have a form that has:

- a datagrid that displays summary data
- other controls (eg textboxes, comboboxes) that are editable

What I would like is when a use selects a row in the datagrid that the all
corresponding fields for that row of data shows up in the other controls
from where they can be edited.

I dont like the idea of depending on the datagrid position attribute to
return the selected row, as I would like to allow the datagrid to be able to
be sorted on any column - hence the position would appear to be
useless...unless you changed the form's dataview everytime the datagrid gets
re-sorted?

I believe what I need to do is get the key of selected row in the datagrid
and use this to synchronise the data that is getting displayed on the rest
of the form but am not sure of how to go about this...

If there are alternatives I would love to hear them.

Regards,

Peter

Nov 8 '05 #1
2 1664

use this to select 1 item from your selected row.

dtgrid = the datagrid
currentrowindex = the selected row
5 = the 5th column

dtgrid.Item(Trim("" & dtgrid.CurrentRowIndex().ToString()), 5)

if this post was helpfull then click on Yes please below this post.

greets,

interwanderer
"mrstrong" wrote:
Gday,

Am new to using datagrids so if anyone could assist or point in the right
direction in terms of resources - that would be much appreciated...

I have a form that has:

- a datagrid that displays summary data
- other controls (eg textboxes, comboboxes) that are editable

What I would like is when a use selects a row in the datagrid that the all
corresponding fields for that row of data shows up in the other controls
from where they can be edited.

I dont like the idea of depending on the datagrid position attribute to
return the selected row, as I would like to allow the datagrid to be able to
be sorted on any column - hence the position would appear to be
useless...unless you changed the form's dataview everytime the datagrid gets
re-sorted?

I believe what I need to do is get the key of selected row in the datagrid
and use this to synchronise the data that is getting displayed on the rest
of the form but am not sure of how to go about this...

If there are alternatives I would love to hear them.

Regards,

Peter

Nov 8 '05 #2
Mr Strong,

See this sample. it uses labels now it was a sample with textboxes some
hours ago.

http://www.vb-tips.com/default.aspx?...f-587f730fa118

I hope this helps,

Cor
Nov 8 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Faith | last post: by
2 posts views Thread by Chris Plowman | last post: by
4 posts views Thread by Suzanne | last post: by
3 posts views Thread by Tim McKinney | last post: by
5 posts views Thread by Genojoe | last post: by
6 posts views Thread by slinky | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.