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

Chart Grid Interaction

Thread ID:

Created:

Updated:

Platform:

Replies:

95560 Jul 16,2010 03:07 PM UTC Aug 6,2010 09:15 AM UTC ASP.NET Web Forms (Classic) 6
loading
Tags: Chart
Dan Schubel
Asked On July 16, 2010 03:07 PM UTC

Could you provide me with a sample where the chart uses a GridDataGridView as its data source?
(My datasource for the grid is a Bindinglist)
Thanks

Jaffersathick B [Syncfusion]
Replied On July 22, 2010 05:33 AM UTC

Hi Dan,

Thank you for using Syncfusion products.

We suggest you to rebind the data bindings of the chart control to update the edited data. You can use Grid grouping controls “SourceListListChanged” event to achieve this.

Please refer the following code snippet:

[CS]
void gridGroupingControl1_SourceListListChanged(object sender, Syncfusion.Grouping.TableListChangedEventArgs e)
{
setbindings();
}

private void setbindings()
{
ChartSeries series = this.chartControl1.Series[0];
this.chartControl1.DataBindings.Clear();
ChartDataBindModel dataSeriesModel = new ChartDataBindModel(bindList);

// If ChartDataBindModel.XName is empty or null, X value is index of point.
dataSeriesModel.YNames = new string[] { "Population" };
series.SeriesModel = dataSeriesModel;
}


Note: Due to security reason we are unable to provide the sample in public forums.

Let me know if you have any other concerns.

Regards,
Jaffer

Dan Schubel
Replied On July 22, 2010 02:00 PM UTC

The info on this page ( http://www.syncfusion.com/products/user-interface-edition/aspnet/chart/chart-and-grid-interaction ) gives me the impression that the chart can use the grid as its data source and the two controls can be synchronized. Is that mot the case?

Manickam Chidambaram [Syncfusion]
Replied On July 27, 2010 02:35 PM UTC

Hi Dan,

Thanks for your update.

We are currently working on your requirements and we will provide you the update within one business day.
Please let me know if any concerns.

Regards,
Manickam


Jaffersathick B [Syncfusion]
Replied On July 28, 2010 03:56 PM UTC

Hi Dan,

Thank you for your patience.

Since you are binding a binding list to the grid it should be reset its bindings using “ResetBindings” function of the Binding list after the grid is edited.

Please refer the following code snippet:

[CS]

void TableControl_CurrentCellEditingComplete(object sender, EventArgs e)
{
list.ResetBindings();
}


Please refer the sample from the following link:

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=Sample75482368.zip

Let me know it helps.

Regards,
Jaffer.B

Dan Schubel
Replied On August 2, 2010 02:41 PM UTC

I've looked at your sample and I've actually tried something similar with my project.
I am still getting into a situation where the grid and the chart show different data. (See attached).
I achieve this by selecting the product price column of the first row, entering a value of 1 and pressing the enter key. Then navigating to a different cell using the arrow keys.
The CurrentCellEditingComplete event fires when enter is pressed but the chart doesn't display the new value. It appears to me that the new value is not getting written back to the bindinglist until moving to a new row?




GridEdit1_5e368ce3.zip

Manickam Chidambaram [Syncfusion]
Replied On August 6, 2010 09:15 AM UTC

Hi Dan,

Thank you for your patience.

To update the Chart with the changes made in Grid can be achieved by Grid Control’s event “SourceListRecordChanged”. Please refer the code snippet below.

[CodeBehind-C#]

//Adding the event handler for SourceListRecordChanged
this.gridGroupingControl1.SourceListRecordChanged += new Syncfusion.Grouping.RecordChangedEventHandler(gridGroupingControl1_SourceListRecordChanged);

void gridGroupingControl1_SourceListRecordChanged(object sender, Syncfusion.Grouping.RecordChangedEventArgs e)
{
list.ResetBindings();
}

Please refer the sample from the following link:

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=Sample-1504075913.zip

Please try using the above sample and let me know if any concerns.

Regards,
Manickam

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

;