Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

How to Insert DataGrid Record from another User Control

$
0
0

I want to insert some record into DataGrid grid1 which is in Child1 User Control and i want to fill this data Grid record From another User Control Child2, insort i want to transfer some data from one user control to another.

My code on click as Below,

ContentTypeDataControl contentTypeDataControl = new ContentTypeDataControl();

            ComboBoxItem typeItem = (ComboBoxItem)cmbEventReceiver.SelectedItem;
            contentTypeDataControl.dtEventReceivers.Columns.Add("ID");
            contentTypeDataControl.dtEventReceivers.Columns.Add("Name");
            
            contentTypeDataControl.dtEventReceivers.Rows.Add(new Object[] { typeItem.Tag, typeItem.Content });
            contentTypeDataControl.dtEventReceivers.AcceptChanges();
            contentTypeDataControl.grdEventReferences.ItemsSource = contentTypeDataControl.dtEventReceivers.DefaultView;
            
            contentTypeDataControl.ppFieldReference.IsOpen = false;
            contentTypeDataControl.wrapPanel.Children.RemoveAt(1);
            contentTypeDataControl.wrapPanel.Focus();



Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>