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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Currently selected row information

Thread ID:

Created:

Updated:

Platform:

Replies:

10442 Feb 2,2004 05:51 PM UTC Feb 2,2004 07:01 PM UTC WinForms 1
loading
Tags: Grouping
Marco Ensing
Asked On February 2, 2004 05:51 PM UTC

I''m trying to obtain data from the currently selected row. Based on the grid-control I tried: CurrencyManager cm= (CurrencyManager) this.BindingContex[this.gridGroupingControl2.DataSource]; DataRow term = ((DataRowView) cm.Current).Row; this.editControl1.Text = term["Definition"].ToString(); But I keep on getting the first row. What is the easiest way to access the current row data on a gridGroupingControl Regards, Marco

Administrator [Syncfusion]
Replied On February 2, 2004 07:01 PM UTC

You can get the current record with Record r = groupingGrid.Table.CurrentRecord the record object provides methods to get values, e.g. r.GetValue("CustomerID"). You can also get the underlying DataRow when you call r.GetData(). That will return the DataRowView element for the record. When you want to access the current record through the binding context, make sure both the grid and the form have the same dataview and binding context. You can manually assign a BindingContext to the grouping grid (e.g you could assign myForm.BindingContext). Make also sure you use the same view that the grid is using. GroupingGrid.Engine.GetSourceList() will return a IList (which is the underlying DataSet.DefaultView or DataTable.DefaultView) whereas groupingGrid.Engine.DataSource can be the DataSet or DataTable object that you assigned to it in InitializeComponent. And passing in that object to BindingContext probably created a different DataView object and that''s why your code didn''t work. Stefan >I''m trying to obtain data from the currently selected row. Based on the grid-control I tried: > >CurrencyManager cm= (CurrencyManager) this.BindingContex[this.gridGroupingControl2.DataSource]; >DataRow term = ((DataRowView) cm.Current).Row; >this.editControl1.Text = term["Definition"].ToString(); > >But I keep on getting the first row. >What is the easiest way to access the current row data on a gridGroupingControl > >Regards, > >Marco

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.

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

;