Jump to content
Xtreme .Net Talk

Recommended Posts

  • Leaders
Posted

I've had all of my columns showing while building my little app and have been accessing the selected primary key (ID) via it's row/column index because it has been shown. Now I have applied a TableStyle to it that hides the ID (which the user shouldn't care about anyway).

 

What's a reliable way of finding out a column in the underlying (bound) dataset that is not currently being displayed in the datagrid?

 

ie. Dataset has columns (id, title, message, url)

 

but

Datagrid only has (title, message, url)

--tim
  • Leaders
Posted
I thought I read somewhere that one couldn't depend on the currentrow index of the datagrid to be the same as the underlying datatable, but it works and I can't find that now. Thanks,
--tim
  • Moderators
Posted

Yes, the DG and the DS may not be identical, but since the ID is hidden in the DG and cannot be altered by the user, then they should be (in this case) in sync.

 

Also, there is a DS property HasChanges which you can use to see if in deed there were changes. Then use AcceptChanges to reset the HasChnages once you update the DB.

Visit...Bassic Software

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...