The title of my question says it already. How can I check if my XmlDataProvider has filled my DataGrid in code behind. It already works, but I want to check when it is finished so I can style the cells in my DataGrid(ForeGround, Background, TextWeight) before the user is able to do/see anything:
public ExcelWindow(string filePath)
{
InitializeComponent();
_filePath = filePath;
Dispatcher.beginInvoke((Action)(() =>
{
LoadScreenSettings();
}));
LoadXml();
CellLayoutHandler = new CellLayoutHandler(DataGridXml, _FilePath);
}
private void LoadXml()
{
XmlDataProvider dataProvider = xmlDataProvider;
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(_FilePath);
dataProvider.Document = xmlDoc;
dataProvider.XPath = "Data/Row";
}
Use
LoadingRowevent :Dgrd.LoadingRow += DgrdParent_LoadingRow;, beauty of this event is only visible Rows fire this event, if you scroll down or increase the size of theWindow, remaining relevant rows will fire this event.Use
HasItemsproperty. This property becomesTrueonly whenDataGridis finished with itsItemsSource.