472,127 Members | 1,713 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,127 software developers and data experts.

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 1727

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 leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.