We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Find position in datasource?

Thread ID:





13112 Apr 20,2004 05:07 PM UTC Apr 21,2004 01:24 PM UTC WinForms 2
Tags: Grouping
Sean Greer
Asked On April 20, 2004 05:07 PM UTC

How do I derive the position of a row in the datasource from CurrentCell.RowIndex? I''m looking for something like the GDBG''s RowIndexToListManagerPosition. I''m in a handler for TableControlCellDoubleClick and I need to know the primary key of the row to display a detail form. Thanks, Sean

Administrator [Syncfusion]
Replied On April 20, 2004 08:49 PM UTC

Based on the row index you can get the element displayed at that row. If it is a record row then the parent records unsorted position is the underlying DataRow position. Example: Table table = e.TableControl.Table; Element el = table.DisplayElements[e.rowIndex]; Record r = el.ParentRecord; int dataRowPos = table.UnsortedRecords.IndexOf(r); CustomersDataRow row = dataSoure.Rows[dataRowPos]; string id = row.CustomerId; The main point here is that any row in the grid has 1-to-1 association with a displayelement of the engine table. And for any record you can quickly identify its original position in the datasource with the UnsortedRecords.IndexOf method. Stefan

Sean Greer
Replied On April 21, 2004 01:24 PM UTC

Thanks Stefan...just what I needed.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon