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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

get datasource datarow by grid row index

Thread ID:

Created:

Updated:

Platform:

Replies:

34808 Sep 16,2005 09:18 AM UTC Sep 16,2005 01:23 PM UTC WinForms 3
loading
Tags: GridControl
sahon
Asked On September 16, 2005 09:18 AM UTC

I''m handling querycellinfo event and have row index, how to get apropriate datasource row by this index? DBG can have sorting

Administrator [Syncfusion]
Replied On September 16, 2005 11:32 AM UTC

Hi, To get the corressponding record from the given rowindex, bind the grid to the datasource. The code snippet is as follows, CurrencyManager cm = (CurrencyManager) this.BindingContext[this.gridDataBoundGrid1.DataSource, this.gridDataBoundGrid1.DataMember]; DataRowView drv = (DataRowView)cm.Current; DataRow dr=(DataRow)drv.Row; Regards, Leo.

sahon
Replied On September 16, 2005 12:40 PM UTC

but this code is only for current row, how can I get row by rowindex, f.e. to process querycellinfo

sahon
Replied On September 16, 2005 01:23 PM UTC

thank you, just found: CurrencyManager cm=(CurrencyManager)BindingContext[dtg.DataSource, dtg.DataMember]; DataRow row; DataView dv=(DataView)cm.List; if (e.RowIndex>dv.Count) return; row=dv[e.RowIndex-1].Row;

CONFIRMATION

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

or the page will be automatically redirected to 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

;