This is the print.config file
<PrintingConfiguration> <Printers> <Printer DisplayName="text1">senthil</Printer> <Printer DisplayName="text1">kumar</Printer> </Printers> </PrintingConfiguration>
private void DeleteButton_Click(object sender, RoutedEventArgs e) { var doc = new XmlDocument(); doc.Load(AppDomain.CurrentDomain.BaseDirectory + "..\\..\\Printing.config"); XmlNode root = doc.SelectSingleNode("//Printers"); Author customerRow = MyDataGrid.SelectedItem as Author; string delectvalue = customerRow.DisplayName; string xpath = "//Printer[@DisplayName= \"" + delectvalue + "\"]"; XmlNode currentNode = root.SelectSingleNode(xpath); if (currentNode != null) { // Delete the record. root.RemoveChild(currentNode); } // Save the changes. doc.Save(printconfigFolder); LoadCustomers(); MyDataGrid.Items.Refresh(); }
0 comments
Post a Comment