The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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
ADAdministrator Syncfusion Team 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