Leaders quwiltw Posted February 23, 2003 Leaders Posted February 23, 2003 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) Quote --tim
Moderators Robby Posted February 24, 2003 Moderators Posted February 24, 2003 Make your reference to the Dataset Column 0. (Instead of the Datagrid) Quote Visit...Bassic Software
Leaders quwiltw Posted February 24, 2003 Author Leaders Posted February 24, 2003 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, Quote --tim
Moderators Robby Posted February 24, 2003 Moderators Posted February 24, 2003 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. Quote Visit...Bassic Software
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.