In my application I want to see multiple record in radwindow as well as that can be edited.In my RadGrid as I double click on any selected record it opens Radwindow and bind my record to my edit control in radwindow.
I need to create multiple radwindow because I need to allow user to compare one record with existing one on time of edit.
Below is sample my code snippet.
public Formlist()
{
this.FormsGrid.AddHandler(GridViewCellBase.CellDoubleClickEvent, new EventHandler<RadRoutedEventArgs>(OnCellDoubleClick), true);
}
private void OnCellDoubleClick(object sender, RadRoutedEventArgs args)
{
if (FormsGrid.SelectedItem != null)
{
Dictionary<string, string> dict = (Dictionary<string, string>)FormsGrid.SelectedItem;
erp3sService.SelectAllEntityRecordAsync(EntityID, FormID, "select * from " + EntityName + " where ID= " + dict["ID"]);
erp3sService.SelectAllEntityRecordCompleted += new EventHandler<Erp3s.Erp3sService.SelectAllEntityRecordCompletedEventArgs>(erp3sService_SelectAllEntityRecordCompleted);
}
}
private void erp3sService_SelectAllEntityRecordCompleted(object sender, Erp3sService.SelectAllEntityRecordCompletedEventArgs e)
{
if (e.Result != string.Empty)
{
//dict= comes from e.result
bool useCanvasPainting = true;
test tc = null;
RadWindow rd = new RadWindow();
rd.Header = "3sERP";
rd.Icon = (object)(new RadWindowHeaderImage());
rd.WindowStartupLocation = Telerik.Windows.Controls.WindowStartupLocation.CenterScreen;
rd.WindowStateChanged += new RoutedEventHandler(NewFormWindow_WindowStateChanged);
rd.Closed += new EventHandler<WindowClosedEventArgs>(NewFormWindow_Closed);
StyleManager.SetTheme(rd, new Office_BlueTheme());
ScrollViewer scrInner = new ScrollViewer();
scrInner.MinWidth = 20;
scrInner.MinHeight = 20;
scrInner.VerticalScrollBarVisibility = ScrollBarVisibility.Auto;
scrInner.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto;
scrInner.Content = null;
rd.Content = null;
rd.ResizeMode = ResizeMode.CanResize;
if (NewRecord == true)
{
tc = new test(FormID, EntityID, EntityName, DisplayEntityName);
scrInner.Content = tc;
}
else
{
tc = new test(FormID, EntityID, EntityName, DisplayEntityName, dict);
scrInner.Content = tc;
}
rd.Content = scrInner;
rd.Show();
}
}
here i m facing proble when i double click on selected record. when i click first time it execute cellDoubleclick once .and i select another record and hit double click it executes cellDoubleclick events twise, next time it will thrise and so on....