Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1025
How to keep tree open after refreshing the xmlDataProvider on xamDataGrid
posted

Joe, can you please tell how I can keep the tree open after refreshing the xmlDataProvider on the xamDataGrid. I am rearranging the xmlnodes and refreshing the xmlDataProvider but the tree completely collapses after the refresh. Help me please!

Thanks!

private void MoveUp(object sender, RoutedEventArgs e)

{

//MessageBox.Show(e.ToString());

if (theDataGrid.SelectedItems.Records.Count > 0)

{

DataRecord dr = theDataGrid.SelectedItems.Records[0] as DataRecord;if (dr != null)

{

XmlNode row = dr.DataItem as XmlNode;

XmlNode newRow = row.Clone();

XmlNode prev = row.PreviousSibling;

if (prev != null)

{

XmlNode parent = row.ParentNode;

parent.InsertBefore(newRow, prev);

parent.RemoveChild(row);

queryResponse.LoadXml(parent.OwnerDocument.OuterXml);

xdp.Refresh();

}

}

}

 

}