//This function set the Grid with existing available data. void funSetGrid() { try { //Set the Grid. CtlGrid.Cols = 4; CtlGrid.CanEdit = true; CtlGrid.CanDelete = true; //Set the Header of the column of the grid. CtlGrid.Columns[0].Header = "ID"; CtlGrid.Columns[1].Header = "CRM Name"; CtlGrid.Columns[2].Header = "CRM URL"; CtlGrid.Columns[3].Header = "Is Active"; CtlGrid.Columns[3].IsIcon = true; //CtlGrid.Columns[5].Header = "CreatedBy"; //Bind the column of the Grid. CtlGrid.Columns[0].BindTo("ID"); CtlGrid.Columns[1].BindTo("CRMName"); CtlGrid.Columns[2].BindTo("CRMURL"); CtlGrid.Columns[3].BindTo("IsActive"); //CtlGrid.Columns[5].BindTo("CreatedBy"); //Calls the method of CRM.Business to retrive existing CRM. objCRMCollection = ClsCRMCollection.GetAll(); CtlGrid.Bind(objCRMCollection); } catch (Exception ex) { VMuktiHelper.ExceptionHandler(ex, "funSetGrid()", "CtlCRM.xaml.cs"); } }
//ModulePermissions[] _MyPermissions; public CtlQuestionAns(ModulePermissions[] MyPermissions) { try { InitializeComponent(); //this.Loaded += new RoutedEventHandler(CtlQuestionAns_Loaded); //_MyPermissions = MyPermissions; //FncPermissionsReview(); //currentControl = new ctlPOD(); //MyPropGrid = new ctlPropertyGrid(); cnvMain.MouseMove += new MouseEventHandler(cnvMain_MouseMove); cmbScript.SelectionChanged += new SelectionChangedEventHandler(cmbScript_SelectionChanged); txtNoOfOptions.LostFocus += new RoutedEventHandler(txtNoOfOptions_LostFocus); btnSave.Click += new RoutedEventHandler(btnSave_Click); //btnCancel.Click += new RoutedEventHandler(btnCancel_Click); txtNoOfOptions.IsEnabled = false; //flag = false; txtHeader.IsEnabled = false; txtDescription.IsEnabled = false; txtName.IsEnabled = false; cmbCategory.IsEnabled = false; //btnDesigner.IsEnabled = false; cmbScript.SelectionChanged += new SelectionChangedEventHandler(cmbScript_SelectionChanged); txtNoOfOptions.LostFocus += new RoutedEventHandler(txtNoOfOptions_LostFocus); //btnSave_Click += new RoutedEventHandler(btnSave_Click); ClsCRMCollection objClsCRMCollection = ClsCRMCollection.GetAll(); for (int i = 0; i < objClsCRMCollection.Count; i++) { ComboBoxItem cmb1 = new ComboBoxItem(); cmb1.Content = objClsCRMCollection[i].CRMName; cmb1.Tag = objClsCRMCollection[i].ID; cmbScript.Items.Add(cmb1); } } catch (Exception ex) { VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "CtlQuestionAns()", "CtlQuestionAns.xaml.cs"); } }