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

Binding feature question

Thread ID:





75935 Aug 15,2008 03:09 PM UTC Aug 18,2008 06:16 PM UTC WPF 4
Tags: GridControl
Jeff Yang
Asked On August 15, 2008 03:09 PM UTC

From looking at previous posts, data binding support is not built-in to the WPF grid. When the feature is implemented, will it have the capability of automatically populating the grid columns and values based on the public properties of the object/interface? I have worked with other grid where this was possible and it made managing the data as easy as managing an IList<>.

Administrator [Syncfusion]
Replied On August 15, 2008 04:02 PM UTC

Yes, our databinding support will handle these tasks for you when it becomes available.

One comment is that such support (in a minimal form) is fairly straight forward to do with our WPF GridControl because of its virtual support. Here is a minimal sample showing how you can use a virtual grid to display an IList<> source with the virtual events.

When we publish our databinding support, it will be much more fully featured than this simple sample.

Jeff Yang
Replied On August 18, 2008 05:23 PM UTC

Thanks for the example. So another question, if I want the grid to update whenever I update items in my IList<>, would the correct way be to call InvalidateCell then InvalidateVisual (as described in the documentation comments for the InvalidateCell method? I want to make sure that I am doing as little repainting as possible. Lastly, I see that all InvalidateVisual overloads take in an object which represents the cell/cell range to invalidate. Is there anyway to get at already instantiated objects representing the cell cooridinates. The reason I'm asking is because of the frequency of updates to my grid, new-ing an object everytime I update is going to increase the time spent in GC

Jeff Yang
Replied On August 18, 2008 05:25 PM UTC

"...I see that all InvalidateVisual overloads take in an object..."

should be:

"...I see that all InvalidateCell overloads take in an object..."

Administrator [Syncfusion]
Replied On August 18, 2008 06:16 PM UTC

You will have to create a new CellSpanInfo object for each change unless you know explicitly the cells that change and can somehow cache CellSpanInfo objects and simple recall them from your cache.

In that sample, if you change the List to BindingList and makes sure your raise the ListChanged event somehow when values change, then you can use code like this to trigger the screen refreshes.

void list_ListChanged(object sender, ListChangedEventArgs e)
IList list = sender as IList;
switch (e.ListChangedType)
case ListChangedType.ItemChanged:
if (e.NewIndex > -1 && e.NewIndex < list.Count)
grid.InvalidateCell(new CellSpanInfo(e.NewIndex + 1, 1, e.NewIndex + 1, grid.Model.ColumnCount));


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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

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