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

WPF GRID Datasets

Hey,
I would normally DirectTrac but that is not currently working, was just wondering how to use a dataset as the datasource for a wpf GRID, read the only other related forum post to it, but like the DirectTrac the linked solution also doesnt work (doesnt exist), its also nearly a year old and in there you state it should be able to just set the datasource, but I'm unable to find this, any help would be appreciated.
Cheers
Tom

11 Replies

MS Mohamed Suhaib Fahad A. Syncfusion Team May 10, 2009 05:37 AM UTC

Hi Tom,

Thanks for using Syncfusion products. You can bind a DataTable as an ItemsSource to the Grid Data Control. If you specify a DataSet, then there should be an additional property to know which data table to load into the Grid, Unlike in Windows Forms controls where you have a property to map to a DataTable, in WPF we would recommend you to directly bind the Data Table.

Please let me know if you want any more details.

Thanks,
Fahad
Grid.WPF Team
SYncfusion Inc.,


TM Tom Mann May 10, 2009 10:23 PM UTC

Hey,
Thanks for the speedy response, with your advise I have connected the grid to a datatable, although performance is very poor it has 50k records with 130 coloumns, this was crashing the grid so have refined the sql to return only return 10 coloumns but with the 50k records this is still very slow to scroll etc, are there some properties I can set to speed the performance ?
Cheers
Tom


MS Mohamed Suhaib Fahad A. Syncfusion Team May 11, 2009 06:21 AM UTC

Hi Tom,

Thanks for the details. The Grid Data Control is optimized for very high performance. I checked out with 100k records, and it scrolls pretty fast,

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

Can you please send me your sample, so that I can check it out.

Thanks,
Fahad
Grid.WPF Team
Syncfusion Inc.,


TM Tom Mann May 11, 2009 12:36 PM UTC

Hey,
Thanks again for another speedy reply,
I have resolved the scrolling issue by setting the data types of the coloumns in my datatable, although as in your example the same happens in mine (not sure if its possible to fix as your example also has this) when you click on the coloumn header to sort the screen goes black whilst it processes the sort, is there any way to have a loader icon display like the web version rather than the screen going black ?
Cheers
Tom


MS Mohamed Suhaib Fahad A. Syncfusion Team May 12, 2009 06:50 AM UTC

Hi Tom,

We have worked out a solution that improves performance to a great extent in GDC. You could download the latest development build that includes these changes,

http://www.syncfusion.com/downloads/development-builds

We now use virtualized way to read the data from the underlying source itself. In that way, things get much faster when sorting/filtering operation is done.

Please let me know if you want any more details.

Thanks,
Fahad
Grid.WPF Team
Syncfusion Inc.,


TM Tom Mann May 12, 2009 08:37 AM UTC

Hey,
Thanks for the update, 7.3.0.2 is not in my account downloads but I do have 7.3.0.1 will the key from this work for 7.3.0.2 ?. also is there somewhere I can read of known issues with this development build, so I can see the benefits of using or not.
Cheers
Tom


TM Tom Mann May 13, 2009 10:10 PM UTC

Hey,
Have bitten the bullet and updated to the development build and the performance is vastly improved, I'm still abit concerned to be using a development build for my application but the difference in performance from this to the current version is worth it for anyone else not sure.
Cheers
Tom


MS Mohamed Suhaib Fahad A. Syncfusion Team May 14, 2009 06:21 AM UTC

Hi Tom,

Thanks for your feedbacks, I would encourage you to use the Development builds, we do have a very short release cycle, were we make our builds very stable. You could then use our next refresh build, which would be around the start of June (next month), and this would be guaranteed to be stable.

With Dev builds, it will be mostly stable, but not every scenario is tested and just may have some issues, but these won't be critical, you could expect a fix very soon from the team. Please let me know if you want any more details.

Thanks,
Fahad
Grid.WPF Team
Syncfusion Inc.,


JS Jonathan Stone March 5, 2010 01:31 PM UTC

Are there any examples of using the GridDataControl with LINQ that allows updating and inserting records into a database?

I have created an ObservableCollection populated via LINQ and set that collection as the ItemsSource of the GDC. However, my LINQ DataContext does not register the changes made to the ObservableCollection by the GDC and hence my record modifications are not committed to the database.

Thanks for you help.


GK Ganesan K Syncfusion Team March 10, 2010 04:04 AM UTC

Hi Jonathan,

Thanks for using Syncfusion products

You Can use the CollectionChanged event of the ObservableCollection to achieve this,

cust.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(cust_CollectionChanged);

void cust_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
{
cust.northWind.SubmitChanges();
}

To notify updates in record, you need to implement IEditableObject in your business object and listen to the ItemEndEdit event in the ObservableCollection like below.

cust.ItemEndEdit += new Customers.ItemEndEditEventHandler(cust_ItemEndEdit);

void cust_ItemEndEdit(IEditableObject sender)
{
cust.northWind.SubmitChanges();
}

You can find the workaround sample from the following location.

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

Please let us know if you need more details.

Thanks
Ganesan


ST Si Thu Win replied to Mohamed Suhaib Fahad A. February 23, 2018 07:47 AM UTC

Hi Tom,

Thanks for the details. The Grid Data Control is optimized for very high performance. I checked out with 100k records, and it scrolls pretty fast,

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

Can you please send me your sample, so that I can check it out.

Thanks,
Fahad
Grid.WPF Team
Syncfusion Inc.,

I love metro.

Loader.
Live Chat Icon For mobile
Up arrow icon