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

Navigation in a groupingGrid

Hi Syncfusion! Is it possible to navigate in a groupingGrid like in a gridBoundDataGrid/classic datagrid?? Explanation: Near each datagrid, I have 4 navigation controls (First, prec, next, last) join together in a custom control called "NavControl" and each time I clic on them, the grid''s cursor changes.... I use the bindingContext of the grid and use it in "NavControl"... like that : Dim bmb As BindingManagerBase = Me.FindForm.BindingContext(MyDatatable) bmb.position= +1 if I do Next bmb.position= 0 if I do First etc... So, I want to use this control with my groupingGrid control.... How to do that? because I use 2 datatable in the groupingGrid (parents and children) Thanks bye! syl

1 Reply

AD Administrator Syncfusion Team June 7, 2004 02:45 PM

HI Syl, I am including some sample code that works with the GroupCustomers example. Some pointers: 1) While in form ctor the BindingContext for the form has not been initialized. This happens the first time BindingContext is initialized. The same is true for GridGroupingControl. If now the GridGroupingControl calls BindingContext before the form calls BindingContext, the BindingContext might differ The line this.groupingGrid1.BindingContext = this.BindingContext; will prevent this. 2) While in form ctor the grid is marked dirty. Filling the datasource with SqlAdapter.Fill or ReadXml after setting the datasource does generate lots PositionChanged events sent to the grid. Therefore the grid will ignore these events as long as the table is marked dirty. Calling int count = this.groupingGrid1.Engine.Table.Records.Count; will force the grid records to be initialized (initialization always happens on demand). After the records were initialized you can now call something like this.BindingContext[dv].Position = 5; and the grid will correctly process the PositionChanged event. This is the replacement code for the form ctor in GroupCustomers example: public Form1() { // // Required for Windows Form Designer support // InitializeComponent(); // // TODO: Add any constructor code after InitializeComponent call // this.groupingGrid1.BindingContext = this.BindingContext; this.groupingGrid1.DataMember = ""; DataView dv = this.dataSet11.Customers.DefaultView; dv.RowFilter = "Country = ''Germany''"; this.groupingGrid1.DataSource = dv; ReadXml(this.dataSet11, @"Data\GDBDdata.XML"); // int count = this.groupingGrid1.Engine.Table.Records.Count; this.BindingContext[dv].Position = 5; Stefan

Loader.
Live Chat Icon For mobile
Up arrow icon