Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi

 

I'm making a windows app which displays a datagrid. This datagrid has a dataset as its datasource. So far quite simple.

 

My problem is I don't know how to get a reference to the 'current' datarow from the datagrid. I can get the CurrentRowIndex, but this does not necesarrily correspond to the index in the dataset, because rows can have been deleted, or the datagrid might be sorted etc.

 

I'm thinking I can extract an id from the datagrid row, and find the corresponding row in the dataset. But to me this seems to be a sort of roundabout way of doing it. Is there really no better way to do it?

 

I've been looking at the BindingContext, but so far haven't been able to come up with anything good.

 

I hope someone can help me with this annoying problem!

 

Martin N Jensen

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...