datagrid current row

M

mrstrong

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top