Hai,
i am Using the RibbonWindow.. in that first section i am using ribbonBar buttons and others and in second section i used DockPanel to Show / Load the Other Controls...for respected actions...
i have Two userControls, one is to Display the Details using TextBox and DropDown Controls and Another userControl is to Show all the Existing Data in DataGrid..
these two controls have to be palced in that DockPanel based on Condition, which is in RibbonWindow...
Now,What i want here is, When i click on the any of the Grid row, i need to fill that selected GridRow Data into the Display userControl (userControl1) and that userControl have to load (replace the second userControl) into that DockPanel...
for that what i have Done is....
First i loaded the UserControl2 in to Dockpanel of the RibbonWindow..and fill the Grid Data...
and i have taken the Values of the Grid Row using the ClickEvent --
and in that Method i have called One DelegateEvent to call the Method declared in MainRibbonWindow...
that method is like..below to clear the Dockpanel and load another userControl...
the below method is in MainRibbonWindow...
public void fnDisplayEmployeeDetails(string str,DockPanel dockPannel)
{
this.Dispatcher.BeginInvoke((Action)delegate { dockPannel.Children.Clear(); }, null);
CtlAddEmployee frm2 = new CtlAddEmployee(str);
dockPannel.Children.Add(frm2);
}
Here all the Work is Done well but the DockPanel Remains with the second userControl only(i.e Displaying Grid only..)..The dockpanel not replaced with the fristUserControl...
But if iam trying to dispaly those same values in Another FormWindow Dockpanel..it displaying well ...i don't know why for this strange behaviour...
public void fnDisplayEmployeeDetails(string str,DockPanel docPannel)
{
this.Dispatcher.BeginInvoke((Action)delegate { docPannel.Children.Clear(); }, null);
CtlAddEmployee frm2 = new CtlAddEmployee(str);
MainWindow mnWindow = new MainWindow();
mnWindow.MainWindowDock.Children.Add(frm2);
mnWindow.ShowDialog();
}
please tell me the correct way to show the Details.. of the Grid values in to another usercontrol..and that usercontrol has to be filled in same Dockpanel....
Thank you