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.
Unfortunately, activation email could not send to your email. Please try again.

Re-binding/Refreshing Grid Grouping Control

Thread ID:

Created:

Updated:

Platform:

Replies:

61260 May 22,2007 12:48 PM Nov 3,2008 04:43 AM Windows Forms 8
loading
Tags: Grouping
Michael Offner
Asked On May 22, 2007 12:48 PM

Hello,

I have a scenario where I have a GridGrouping control bound to a Forms.BindingSource. The binding source data changes, but the GridGrouping control does not show the changes. Therefore what I would like to do in this case is to re-bind the data source to the grid, effectively refreshing it. I try gridGroupingControl1.DataSource = null, and then gridGroupingControl1.DataSource = bindingSource. However, the data in the grid does not change. How can I do this?

Thanks,
-Mike

haneefm [Syncfusion]
Replied On May 22, 2007 01:09 PM

Hi Mikeo,

Here is a forum thread that discuss with the simillar issue and let me know if this helps.
http://www.syncfusion.com/support/forums/message.aspx?&MessageID=56040

Best regards,
Haneef

Michael Offner
Replied On May 22, 2007 07:07 PM

Hi Haneef,

Thank you for your quick response to my question!

I implemented a rebind method per the link. However, I still have the problem that prompted me to write to you.

I have a Forms.BindingSource, of which, the GridGrouping control is bound to. The problem occurs when records are added to the binding source. So if I add 2 records, then click anywhere on the grid control, the grid control adds an additonal record. So the binding source will have 5 records, but the grid will have six. The extra record is an empty record.

Would you by any chance have an idea what this could be? I have a simple demo of this if you would like too.

Thanks,
-Mike


>Hi Mikeo,

Here is a forum thread that discuss with the simillar issue and let me know if this helps.
http://www.syncfusion.com/support/forums/message.aspx?&MessageID=56040

Best regards,
Haneef

haneefm [Syncfusion]
Replied On May 22, 2007 07:53 PM

Hi Mikeo,

If you want to remove the AddNewRow(Blank Row) in the top section of the group, you can set the ShowAddNewRecordBeforeDetails and ShowAddNewRecordAfterDetails property to false. Here is a code snippet

//For Main Groups
this.grid.TopLevelGroupOptions.ShowAddNewRecordBeforeDetails = false;
this.grid.TopLevelGroupOptions.ShowAddNewRecordAfterDetails = false;

//For Main Groups
this.grid.NestedTableGroupOptions.ShowAddNewRecordBeforeDetails = false;
this.grid.NestedTableGroupOptions.ShowAddNewRecordAfterDetails = false;

//For Child Groups
this.grid.ChildGroupOptions.ShowAddNewRecordBeforeDetails = false;
this.grid.ChildGroupOptions.ShowAddNewRecordAfterDetails = false;

Best regards,
Haneef

Michael Offner
Replied On May 23, 2007 10:12 AM

Thank you Haneef! Those two lines allow me to hide the insertion row.

However, I have one more issue: When I insert a row into my DataBinding source, I get an exception on the grid grouping control. My code is extremely simple. I have nothing but a GCC bound to a Forms.BindingSource. I call BindingSource.AddNew() a few times, and get the exception.

Here is the exception dialog contents:

An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in Syncfusion.Shared.Base.dll

Additional information: Count = 2 FilteredRecordCount = 0 YAmountCount = 2 ElementCount = 0 RecordCount = 0 CustomCount = 0 VisibleCustomCount = 0 out of range Count = 0 FilteredRecordCount = 0 YAmountCount = 0 ElementCount = 0 RecordCount = 0 CustomCount = 0 VisibleCustomCount = 0

Thanks for your help on this!
-Mike

>Hi Mikeo,

If you want to remove the AddNewRow(Blank Row) in the top section of the group, you can set the ShowAddNewRecordBeforeDetails and ShowAddNewRecordAfterDetails property to false. Here is a code snippet

//For Main Groups
this.grid.TopLevelGroupOptions.ShowAddNewRecordBeforeDetails = false;
this.grid.TopLevelGroupOptions.ShowAddNewRecordAfterDetails = false;

//For Main Groups
this.grid.NestedTableGroupOptions.ShowAddNewRecordBeforeDetails = false;
this.grid.NestedTableGroupOptions.ShowAddNewRecordAfterDetails = false;

//For Child Groups
this.grid.ChildGroupOptions.ShowAddNewRecordBeforeDetails = false;
this.grid.ChildGroupOptions.ShowAddNewRecordAfterDetails = false;

Best regards,
Haneef

haneefm [Syncfusion]
Replied On May 23, 2007 02:37 PM

Hi Mikeo,

Please follow the below thread for more details.
http://www.syncfusion.com/support/Forums/message.aspx?&MessageID=61341

Best regards,
Haneef

Perry Way
Replied On October 30, 2008 03:22 PM

Hi,

I am using web GGC in asp.net2.0 environement. I too had the same issue, but I fixed it like Haneef said.
Now I have another issue with summary rows. My grid has summary row and I am changing grid's datasource at run-time. To re-produce this issue:
Step 1: When I bind DataTable with some/one row(s) as datasource for grid, its showing data with summary row.
Step 2: Next when I bind "null" as datasource for grid, its showing "no records to display". That's correct.
Step 3: Next when I try to bind DataTable with some/one row(s) as datasource for grid, its showing data only. But summary row is missing :(

Can you please let me know, what I am missing? Please find the attached file for more details

Thanks,
Perry



Grid with Summary Rows Export Error_7122606e.zip

Perry Way
Replied On October 30, 2008 03:29 PM

Hi,

I attached wrong file in my previous post. Sorry. Please refer this attached file for more details about the issue.

Thanks,
Perry

>Hi,

I am using web GGC in asp.net2.0 environement. I too had the same issue, but I fixed it like Haneef said.
Now I have another issue with summary rows. My grid has summary row and I am changing grid's datasource at run-time. To re-produce this issue:
Step 1: When I bind DataTable with some/one row(s) as datasource for grid, its showing data with summary row.
Step 2: Next when I bind "null" as datasource for grid, its showing "no records to display". That's correct.
Step 3: Next when I try to bind DataTable with some/one row(s) as datasource for grid, its showing data only. But summary row is missing :(

Can you please let me know, what I am missing? Please find the attached file for more details

Thanks,
Perry



Grid with Summary Rows Export Error_7122606e.zip



Summary Row is Gone Error_7fe7fd83.zip

Rajarajeswari S [Syncfusion]
Replied On November 3, 2008 04:43 AM

Hi Perry,

The following Forum has been updated for the above mentioned issue:

http://www.syncfusion.com/support/forums/message.aspx?MessageID=77425

Could you please follow-up with the above to get more information on this.

Regards,
Raji


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.

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.

;