protected override void ShowNavigationItem(SingleChoiceActionExecuteEventArgs args)
{
base.ShowNavigationItem(args);
if ((args.SelectedChoiceActionItem != null) && args.SelectedChoiceActionItem.Enabled)
{
if (args.SelectedChoiceActionItem.Id == "Shipment_ListView")
{
ObjectSpace os = Application.CreateObjectSpace();
DevExpress.ExpressApp.ListView lv = Application.CreateListView(os, typeof(DispatchRegister), true); args.ShowViewParameters.CreatedView = lv;
args.ShowViewParameters.TargetWindow = TargetWindow.NewModalWindow; args.ShowViewParameters.CreateAllControllers = true;
DialogController dc = new DialogController(); args.ShowViewParameters.Controllers.Add(dc); dc.Accepting += new EventHandler
}
}
}
Now Write Code on Accepting
void dc_Accepting(object sender, DialogControllerAcceptingEventArgs e)
{
ObjectSpace os=Application.CreateObjectSpace ();
DevExpress.ExpressApp.ListView lv = ((DevExpress.ExpressApp.ListView)((WindowController)sender).Window.View);
Shipment sp = null;
CollectionSource cs = new CollectionSource(os, typeof(Shipment));
CollectionSourceBase cs1 = (CollectionSourceBase)lv.CollectionSource;
foreach (DispatchRegister dr in lv.SelectedObjects)
{
sp = new Shipment(os.Session);
sp.BlockNo = dr.DeliveryNumber;
sp.ChallanNo = dr.DistributionChannel;
cs.Collection.Add(os.GetObject (sp));
}
DevExpress.ExpressApp.ListView listView = Application.CreateListView("Shipment_ListView", cs, true); e.ShowViewParameters.CreatedView = listView;
e.ShowViewParameters.TargetWindow = TargetWindow.Default;
}
No comments:
Post a Comment