I am new to WPF please help me in solving below issue.
Below is my xaml code
How to refresh DataGrid on source change?
Kindly help.
Thanks,
Krishna.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
dinesh kumar64 reputationPosted Apr 26, 2015, 11:22 PM EDT
yourdatagrid.Items.Refresh() you can also reset the itemsource when you add the new data into xml file.
yourdatagrid.ItemsSource = null;
Yourdatagrid.ItemsSource = yourSource;
Yourdatagrid.Items.Refresh();
this should work.
if you this solution to be helpful please upvote it.
Regard,
DK.
Tom MohanRank #912 · 2.3K reputationPosted Apr 27, 2015, 12:51 AM EDT
For this you need to declare the ItemsSource property as dependency property or you need to implement INotifyproperty. Go ahead with INotifypropery that is light weight. Refer the below article
http://www.c-sharpcorner.com/UploadFile/91c28d/implement-change-notification-using-inotifypropertychanged-i/
krishna chaitanya47 reputationPosted Apr 27, 2015, 1:01 AM EDT
thank you so much for your response. sorry i have missed xaml code:
see below, binding XML data like below not writing any list or data table in code behind. This case how to refresh data grid?