public static void Fill(ref Session session, Type classType, ref XPServerCollectionSource xpServerCollectionSource, string fixedFilterString, bool isOnline) { //InitXpo(isOnline); if (session == null) { // Create a Session object. session = new Session(GetDataLayer(isOnline)); // Create an XPClassInfo object corresponding to the Person_Contact class. var classInfo = session.GetClassInfo(classType); // Create an XPServerCollectionSource object. xpServerCollectionSource = new XPServerCollectionSource(session, classInfo); xpServerCollectionSource.FixedFilterString = fixedFilterString; //session.DropCache(); //xpServerCollectionSource.Reload(); } else { xpServerCollectionSource.FixedFilterString = fixedFilterString; xpServerCollectionSource.Reload(); } }
protected void FillGrid(string tableName) { if (grdTableBrowser.DataSource is IDisposable) { ((IDisposable)grdTableBrowser.DataSource).Dispose(); } grdTableBrowser.DataSource = null; gridView1.OptionsBehavior.Editable = false; gridView1.Columns.Clear(); DataTable dataTable = new DataTable(tableName); SqlDataAdapter adapter = new SqlDataAdapter(string.Format("SELECT * FROM [{0}]", tableName), connection); try { adapter.FillSchema(dataTable, SchemaType.Source); DynamicDataTableClassInfo dataTableClassInfo; if (!dynamicClasses.TryGetValue(tableName, out dataTableClassInfo)) { dynamicClasses.Add(tableName, new DynamicDataTableClassInfo(workSession.Dictionary, dataTable)); } XPServerCollectionSource dataSource = new XPServerCollectionSource(workSession, dynamicClasses[tableName]); grdTableBrowser.DataSource = dataSource; //grdTableBrowser.ServerMode = true; grdTableBrowser.ForceInitialize(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
void SetDataSource(Session session) { var classInfo = session.GetClassInfo(typeof(TestMaster)); var xpServerCollectionSource = new XPServerCollectionSource(session, classInfo); gridControl.DataSource = xpServerCollectionSource; gridView.OptionsLayout.Columns.AddNewColumns = true; }
private void myGridView1_MasterRowEmpty(object sender, MasterRowEmptyEventArgs e) { GridView view = (GridView)sender; Employees employee = (Employees)view.GetRow(e.RowHandle); XPServerCollectionSource source = CreateChildServerModeSource(employee); e.IsEmpty = ((IListSource)source).GetList().Count == 0; }
void Initialize() { Grid.ItemsSource = CollectionSource; NewRowCommand.RaiseCanExecuteChangedEvent(); ServerCollectionSource = new XPServerCollectionSource(new UnitOfWork(), CollectionSource.ObjectType); View.KeyDown += OnViewKeyDown; View.RowDoubleClick += OnViewRowDoubleClick; Grid.CurrentItemChanged += Grid_CurrentItemChanged; }
/// <summary> /// Инициализации серверной коллекции данных. /// </summary> public static void InitSVCollection(XPServerCollectionSource collection, Type type, Session session) { ((System.ComponentModel.ISupportInitialize)(collection)).BeginInit(); collection.DeleteObjectOnRemove = true; collection.ObjectType = type; if (session != null) { collection.Session = session; } ((System.ComponentModel.ISupportInitialize)(collection)).EndInit(); }
public static XPServerCollectionSource GetNewXPServerCollectionSource(Type classType, string fixedFilterString = null) { //string fixedFilterString = string.Format("BranchID = {0} AND Quantity > \'0.00\'", BranchID); // Create a Session object. var session = new Session(XpoDefault.DataLayer); // Create an XPClassInfo object corresponding to the Person_Contact class. var classInfo = session.GetClassInfo(classType); // Create an XPServerCollectionSource object. var xpServerCollectionSource = new XPServerCollectionSource(session, classInfo) { FixedFilterString = fixedFilterString }; return(xpServerCollectionSource); }
public Window1() { string conn = MSSqlConnectionProvider.GetConnectionString("(local)", "NorthwindXpo"); XpoDefault.DataLayer = XpoDefault.GetDataLayer(conn, AutoCreateOption.SchemaAlreadyExists); InitializeComponent(); System.Diagnostics.Trace.Listeners.Add(new MyTraceListner(textBox1)); UnitOfWork uow = new UnitOfWork(); XPServerCollectionSource col = new XPServerCollectionSource(uow, typeof(NorthwindXpo.Order)); col.DisplayableProperties = "Customer.CompanyName;Employee.LastName;OrderDate;ShippedDate;" + "Freight;ShipName;ShipAddress;ShipCity;ShipRegion;ShipPostalCode;ShipCountry"; gridControl1.ItemsSource = col; gridControl1.PopulateColumns(); }
public Form3() { InitializeComponent(); // Generate the connection string to the AdventureWorks database on local SQL Server. XpoDefault.ConnectionString = MSSqlConnectionProvider.GetConnectionString("(local)", "EFDb"); // Create a Session object. Session session1 = new Session(); // Create an XPClassInfo object corresponding to the Person_Contact class. XPClassInfo classInfo = session1.GetClassInfo(typeof(Setting)); // Create an XPServerCollectionSource object. XPServerCollectionSource xpServerCollectionSource1 = new XPServerCollectionSource(session1, classInfo); //xpServerCollectionSource1. //xpServerCollectionSource1.ObjectClassInfo // gridControl1.ServerMode = true; ; gridControl1.DataSource = xpServerCollectionSource1; }
public Form1() { InitializeComponent(); // Generate the connection string to the AdventureWorks database on local SQL Server. XpoDefault.ConnectionString = MSSqlConnectionProvider.GetConnectionString("(local)", "AdventureWorks"); // Create a Session object. Session session1 = new Session(); // Create an XPClassInfo object corresponding to the Person_Contact class. XPClassInfo classInfo = session1.GetClassInfo(typeof(Person_Contact)); // Create an XPServerCollectionSource object. XPServerCollectionSource xpServerCollectionSource1 = new XPServerCollectionSource(session1, classInfo); // Create a grid control. GridControl gridControl1 = new GridControl(); gridControl1.Dock = DockStyle.Fill; this.Controls.Add(gridControl1); // Enable server mode. gridControl1.ServerMode = true; // Bind the grid control to the data source. gridControl1.DataSource = xpServerCollectionSource1; }
public MainForm() { InitializeComponent(); #if USE_XPServerCollectionSource XpoDefault.ConnectionString = $"XpoProvider=MSSqlServer;{GetConnectionString()}"; var session = new Session(); var classInfo = session.GetClassInfo(typeof(Models.Xpo.TableWithHugeData)); var xpServerCollectionSource = new XPServerCollectionSource(session, classInfo); gridControl.DataSource = xpServerCollectionSource; #elif USE_LinqServerModeSource || USE_EntityServerModeSource var db = new TestDBContext(); gridControl.DataSource = new #if USE_LinqServerModeSource LinqServerModeSource #elif USE_EntityServerModeSource EntityServerModeSource #endif { KeyExpression = "Id", QueryableSource = db.TableWithHugeData }; #endif }
public static void Fill(ref Session session, Type classType, ref XPServerCollectionSource xpServerCollectionSource, string fixedFilterString) { Fill(ref session, classType, ref xpServerCollectionSource, fixedFilterString, true); }
public XPServerCollectionSource GetXCS(string sServerName, string sUserName, string sPassword, string sDBName, string sSql, string sColumnXML, System.Web.UI.Page oPage, bool p_bHasKeyField) { XPServerCollectionSource l_xcs = null; page = oPage; page.Unload += new EventHandler(Page_Unload); strCTEName = "CTE_" + DateTime.Now.Hour.ToString() + DateTime.Now.Minute.ToString() + DateTime.Now.Millisecond.ToString(); //Use your own GetConnectionString method based on the passed parameters string connectionString = MSSqlConnectionProviderWithCte.GetConnectionString(sServerName, sDBName); XPDictionary dict = new ReflectionDictionary(); XPClassInfo classInfo = dict.CreateClass(dict.GetClassInfo(typeof(BasePersistentClass)), strCTEName); XmlDocument l_xmlDoc = new XmlDocument(); l_xmlDoc.LoadXml(sColumnXML); XmlNodeList l_xnl = l_xmlDoc.SelectNodes("//FLD"); for (int i = 0; i < l_xnl.Count; i++) { Type l_type = null; switch (l_xnl[i]["DATTYP"].InnerText.ToLower()) { case "int64": l_type = typeof(Int64); break; case "byte[]": l_type = typeof(Byte[]); break; case "boolean": l_type = typeof(Boolean); break; case "string": l_type = typeof(String); break; case "char[]": l_type = typeof(Char[]); break; case "datetime": l_type = typeof(DateTime); break; case "datetimeoffset": l_type = typeof(DateTimeOffset); break; case "decimal": l_type = typeof(Decimal); break; case "double": l_type = typeof(Double); break; case "int32": l_type = typeof(Int32); break; case "single": l_type = typeof(Single); break; case "int16": l_type = typeof(Int16); break; case "object": l_type = typeof(Object); break; case "timeSpan": l_type = typeof(TimeSpan); break; case "byte": l_type = typeof(Byte); break; case "guid": l_type = typeof(Guid); break; case "xml": l_type = typeof(XmlDocument); break; } if (i == 0) { classInfo.CreateMember(l_xnl[i]["COL"].InnerText, l_type, new KeyAttribute(true)); } else { classInfo.CreateMember(l_xnl[i]["COL"].InnerText, l_type); } } dal = new SimpleDataLayer(dict, XpoDefault.GetConnectionProvider(connectionString, AutoCreateOption.SchemaAlreadyExists)); uow = new UnitOfWork(dal); string l_strQuery = ""; l_strQuery = " AS (" + sSql + ")"; uow.RegisterCte(strCTEName, @l_strQuery); try { l_xcs = new XPServerCollectionSource(uow, classInfo); return(l_xcs); } finally { } return(l_xcs); }
private void InitLUE() { UnitOfWork uow = new UnitOfWork(); XPCollection<Customer> customers = new XPCollection<Customer>(uow); SortingCollection sortProps3 = new SortingCollection(null); sortProps3.Add(new SortProperty("No", SortingDirection.Descending)); customers.Sorting = sortProps3; lueCustomer.Properties.DataSource = customers; lueCustomer.Properties.ValueMember = "No"; lueCustomer.Properties.DisplayMember = "No"; XPClassInfo classInfo = uow.GetClassInfo(typeof(Item)); XPServerCollectionSource items = new XPServerCollectionSource(uow, classInfo); SortingCollection sortProps2 = new SortingCollection(null); sortProps2.Add(new SortProperty("ItemNo", SortingDirection.Descending)); //items.Sorting = sortProps2; lueItem1.Properties.DataSource = items; lueItem1.Properties.ValueMember = "This"; lueItem1.Properties.DisplayMember = "ItemNo"; lueItem2.Properties.DataSource = items; lueItem2.Properties.ValueMember = "This"; lueItem2.Properties.DisplayMember = "ItemNo"; lueItem3.Properties.DataSource = items; lueItem3.Properties.ValueMember = "This"; lueItem3.Properties.DisplayMember = "ItemNo"; lueItem4.Properties.DataSource = items; lueItem4.Properties.ValueMember = "This"; lueItem4.Properties.DisplayMember = "ItemNo"; lueItem5.Properties.DataSource = items; lueItem5.Properties.ValueMember = "This"; lueItem5.Properties.DisplayMember = "ItemNo"; lueItem6.Properties.DataSource = items; lueItem6.Properties.ValueMember = "This"; lueItem6.Properties.DisplayMember = "ItemNo"; lueItem7.Properties.DataSource = items; lueItem7.Properties.ValueMember = "This"; lueItem7.Properties.DisplayMember = "ItemNo"; lueItem8.Properties.DataSource = items; lueItem8.Properties.ValueMember = "This"; lueItem8.Properties.DisplayMember = "ItemNo"; lueItem9.Properties.DataSource = items; lueItem9.Properties.ValueMember = "This"; lueItem9.Properties.DisplayMember = "ItemNo"; XPCollection<OrderType> orderTypes = new XPCollection<OrderType>(uow); SortingCollection sortProps = new SortingCollection(null); sortProps.Add(new SortProperty("Name", SortingDirection.Ascending)); orderTypes.Sorting = sortProps; lueOrderType1.Properties.DataSource = orderTypes; lueOrderType1.Properties.ValueMember = "Name"; lueOrderType1.Properties.DisplayMember = "Name"; lueOrderType2.Properties.DataSource = orderTypes; lueOrderType2.Properties.ValueMember = "Name"; lueOrderType2.Properties.DisplayMember = "Name"; lueOrderType3.Properties.DataSource = orderTypes; lueOrderType3.Properties.ValueMember = "Name"; lueOrderType3.Properties.DisplayMember = "Name"; lueOrderType4.Properties.DataSource = orderTypes; lueOrderType4.Properties.ValueMember = "Name"; lueOrderType4.Properties.DisplayMember = "Name"; lueOrderType5.Properties.DataSource = orderTypes; lueOrderType5.Properties.ValueMember = "Name"; lueOrderType5.Properties.DisplayMember = "Name"; lueOrderType6.Properties.DataSource = orderTypes; lueOrderType6.Properties.ValueMember = "Name"; lueOrderType6.Properties.DisplayMember = "Name"; lueOrderType7.Properties.DataSource = orderTypes; lueOrderType7.Properties.ValueMember = "Name"; lueOrderType7.Properties.DisplayMember = "Name"; lueOrderType8.Properties.DataSource = orderTypes; lueOrderType8.Properties.ValueMember = "Name"; lueOrderType8.Properties.DisplayMember = "Name"; lueOrderType9.Properties.DataSource = orderTypes; lueOrderType9.Properties.ValueMember = "Name"; lueOrderType9.Properties.DisplayMember = "Name"; }
public static void BindData(ASPxGridView gv, DevExpress.Xpo.Session s, string objectname, string filter = "", string DefaultSorting="", params object[] parameter) { try { DynamicDataTableClassInfo classInfo = dynamicClasses[objectname]; if (classInfo != null) { XPServerCollectionSource ds = new XPServerCollectionSource(s, dynamicClasses[objectname], CriteriaOperator.Parse(filter, parameter)); ds.DefaultSorting = DefaultSorting; gv.DataSource = ds; //gv.KeyFieldName = classInfo.KeyProperty.DisplayName; } else throw new Exception(string.Format("Đối tượng {0} không tìm thấy trong database. Nếu không có dữ liệu hiển thị thì XPOProfiles để xem điều kiện lọc đúng chưa", objectname)); } catch (Exception ex) { SiAuto.Main.LogColored(Color.Red, "Loi BindData:" + ex.ToString()); throw ex; } }
public static void BindData(ASPxRadioButtonList rbllist, DevExpress.Xpo.Session s, string objectname, string filter = "", params object[] parameter) { try { DynamicDataTableClassInfo classInfo = dynamicClasses[objectname]; if (classInfo != null) { XPServerCollectionSource ds = new XPServerCollectionSource(s, dynamicClasses[objectname], CriteriaOperator.Parse(filter, parameter)); rbllist.DataSource = ds; } else throw new Exception(string.Format("Đối tượng {0} không tìm thấy trong database. Nếu không có dữ liệu hiển thị thì XPOProfiles để xem điều kiện lọc đúng chưa", objectname)); } catch (Exception ex) { SiAuto.Main.LogColored(Color.Red, "Loi BindData:" + ex.ToString()); throw ex; } }
public MainForm() { InitializeComponent(); string tmpString; /* * string * sqlConn = MSSqlConnectionProvider.GetConnectionString("i-nozhenko", "sa", "123", "testdb"); * sqlConn = MSSqlConnectionProvider.GetConnectionString("NOZHENKO-I-XP\\SQLEXPRESS", "testdb"); * * XpoDefault.DataLayer = XpoDefault.GetDataLayer(sqlConn, AutoCreateOption.DatabaseAndSchema); */ /* * Staff * staff = new Staff(XpoDefault.Session) { Name = "Test", Salary = 10, Dep = 1, BirthDate = DateTime.Now, NullField = 123 }; * * staff.Save(); */ XpoDefault.ConnectionString = MSSqlConnectionProvider.GetConnectionString("i-nozhenko", "sa", "123", "testdb"); //XpoDefault.ConnectionString = MSSqlConnectionProvider.GetConnectionString("NOZHENKO-I-XP\\SQLEXPRESS", "testdb"); Session session = new Session(); #if TEST_QUERY // https://documentation.devexpress.com/#CoreLibraries/CustomDocument4060 // https://www.devexpress.com/Support/Center/Example/Details/E1883 var res = (from master in new XPQuery <TestMaster>(session) join detail in new XPQuery <TestDetail>(session) on master /*.Id*/ equals detail.Master /*.Id*/ where master.Id == 1 select new { Id = master.Id, Name = detail.Name }).ToList(); #endif #if TEST_COMPARER List <Staff> listStaff1 = session.GetObjects(session.GetClassInfo(typeof(Staff)), CriteriaOperator.Parse("Id=?", 1), null, 0, 0, true, true).OfType <Staff>().ToList(), listStaff2 = session.GetObjects(session.GetClassInfo(typeof(Staff)), CriteriaOperator.Parse("Id=?", 1), null, 0, 0, true, true).OfType <Staff>().ToList(); var intersect = listStaff1.Intersect(listStaff2).ToList(); var except = listStaff1.Except(listStaff2).ToList(); var sequenceEqual = listStaff1.SequenceEqual(listStaff2); Session session1 = new Session(), session2 = new Session(); listStaff1 = session1.GetObjects(session1.GetClassInfo(typeof(Staff)), CriteriaOperator.Parse("Id=?", 1), null, 0, 0, true, true).OfType <Staff>().ToList(); listStaff2 = session2.GetObjects(session2.GetClassInfo(typeof(Staff)), CriteriaOperator.Parse("Id=?", 1), null, 0, 0, true, true).OfType <Staff>().ToList(); intersect = listStaff1.Intersect(listStaff2).ToList(); intersect = listStaff1.Intersect(listStaff2, new StaffEqualityComparerById()).ToList(); except = listStaff1.Except(listStaff2).ToList(); except = listStaff1.Except(listStaff2, new StaffEqualityComparerById()).ToList(); sequenceEqual = listStaff1.SequenceEqual(listStaff2, new StaffEqualityComparerById()); #endif session.IdentityMapBehavior = IdentityMapBehavior.Weak; XPClassInfo classInfoMasterDetail = session.GetClassInfo(typeof(TestMaster)); #if TEST_SESSION XPClassInfo classInfoTestDetail = session.GetClassInfo(typeof(TestDetail)); session.ObjectLoaded += session_ObjectLoaded; session.GetObjectsByKey(classInfoTestDetail, new List <object> { 4L, 5L, 6L }, true); TestMaster testMaster = session.GetObjectByKey <TestMaster>(2L, false); if (testMaster != null) { session.PreFetch(new[] { testMaster }, "Details"); foreach (TestDetail testDetail in testMaster.Details) { tmpString = testDetail.Name; } } #endif #if TEST_TABLE_4_TYPES TestTable4Types testTable4Types; #if TEST_VARBINARY byte[] dataI = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7 }, dataII = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 }; if ((testTable4Types = session.GetObjectByKey <TestTable4Types>(1L, true)) != null) { if (testTable4Types.VarBinary28 == null || testTable4Types.VarBinary28.Length == 0) { testTable4Types.VarBinary28 = dataI; testTable4Types.Save(); } } if ((testTable4Types = session.GetObjectByKey <TestTable4Types>(2L, true)) != null) { if (testTable4Types.VarBinary28 == null || testTable4Types.VarBinary28.Length == 0) { testTable4Types.VarBinary28 = dataI; testTable4Types.Save(); } } if ((testTable4Types = session.GetObjectByKey <TestTable4Types>(3L, true)) != null) { if (testTable4Types.VarBinary28 == null || testTable4Types.VarBinary28.Length == 0) { testTable4Types.VarBinary28 = dataII; testTable4Types.Save(); } } var arrDataI = session.GetObjects(session.GetClassInfo(typeof(TestTable4Types)), new BinaryOperator(new OperandProperty("VarBinary28"), new OperandValue(dataI), BinaryOperatorType.Equal), null, 0, 0, false, true).OfType <TestTable4Types>().ToArray(); var arrDataII = session.GetObjects(session.GetClassInfo(typeof(TestTable4Types)), new BinaryOperator(new OperandProperty("VarBinary28"), new OperandValue(dataII), BinaryOperatorType.Equal), null, 0, 0, false, true).OfType <TestTable4Types>().ToArray(); #endif if ((testTable4Types = session.GetObjectByKey <TestTable4Types>(1L, true)) != null) { tmpString = testTable4Types.Doc.InnerXml; XmlNodeList roots = testTable4Types.Doc.GetElementsByTagName("root"); XmlNode root = roots != null && roots.Count > 0 ? roots[0] : null; if (root != null) { XmlElement newItem = testTable4Types.Doc.CreateElement("item"); XmlAttribute newItemAttribute = testTable4Types.Doc.CreateAttribute("id"); XmlText newItemText = testTable4Types.Doc.CreateTextNode((11 * (root.ChildNodes.Count + 1)).ToString()); newItemAttribute.Value = (root.ChildNodes.Count + 1).ToString(); newItem.Attributes.Append(newItemAttribute); newItem.AppendChild(newItemText); root.AppendChild(newItem); } testTable4Types.Save(); var _root_ = testTable4Types.Doc.SelectNodes("/root"); var __root__ = testTable4Types.Doc.SelectSingleNode("/root"); } #endif Staff staff; XPClassInfo classInfoStaff = session.GetClassInfo(typeof(Staff)), classInfoTestTable4Types = session.GetClassInfo(typeof(TestTable4Types)); XPMemberInfo memberInfoSalary = classInfoStaff.GetPersistentMember("Salary"); if (memberInfoSalary.MemberType.ReflectedType == typeof(XPObjectType)) { tmpString = memberInfoSalary.MemberType.FullName; } ICollection collection; try { collection = session.GetObjectsByKey(classInfoStaff, null, true); } catch (NullReferenceException e) { Console.WriteLine(e.Message); } collection = session.GetObjectsByKey(classInfoStaff, new List <object>(), true); collection = session.GetObjectsByKey(classInfoStaff, new List <object> { 1L }, true); if ((staff = session.FindObject(typeof(Staff), CriteriaOperator.Parse("Id=?", 1)) as Staff) != null) { tmpString = staff.Name; var pName = staff.ClassInfo.FindMember("Name"); if (pName != null) { var name = staff.GetMemberValue("Name"); } var m = staff.ClassInfo.Members.Where(mi => mi.MemberType.FullName == "System.String").Select(mi => mi).ToList(); var cp = staff.ClassInfo.CollectionProperties.Cast <XPMemberInfo>() /*.Where(mi => mi.MemberType.FullName == "System.String")*/.Select(mi => mi).ToList(); var op = staff.ClassInfo.ObjectProperties.Cast <XPMemberInfo>().Where(mi => mi.MemberType.FullName == "System.String").Select(mi => mi).ToList(); var pp = staff.ClassInfo.PersistentProperties.Cast <XPMemberInfo>().Where(mi => mi.MemberType.FullName == "System.String").Select(mi => mi).ToList(); var up = staff.ClassInfo.PersistentProperties.Cast <XPMemberInfo>().FirstOrDefault(mi => mi.Attributes.Any(a => a is UniqueAttribute)); #if TEST_ON_PROPERTY_CHANGED staff.Name = tmpString; #endif } if ((staff = session.FindObject(typeof(Staff), CriteriaOperator.Parse("Id=?", 111)) as Staff) != null) { tmpString = staff.Name; } var _cp_ = classInfoMasterDetail.CollectionProperties; XPServerCollectionSource xpServerCollectionSourceStaff = new XPServerCollectionSource(session, classInfoStaff), xpServerCollectionSourceMasterDetail = new XPServerCollectionSource(session, classInfoMasterDetail); CriteriaOperator joinCriteria = new OperandProperty("^.Master") == new OperandProperty("Id"); JoinOperand joinOperand = new JoinOperand("TestMaster", joinCriteria); XPCollection <TestDetail> s = new XPCollection <TestDetail>(session, joinOperand); /* * select * * from * "dbo"."TestDetail" N0 * where * ( * N0."GCRecord" is null * and exists * ( * select * from "dbo"."TestMaster" N1 where (N1."GCRecord" is null and (N0."IdMaster" = N1."Id")) * ) * ) */ foreach (TestDetail d in s) { } gridControlStaff.DataSource = xpServerCollectionSourceStaff; gridViewStaff.OptionsSelection.MultiSelect = true; gridViewStaff.Appearance.SelectedRow.BackColor = Color.FromArgb(192, 192, 255); gridViewStaff.Appearance.SelectedRow.BackColor2 = Color.Transparent; gridViewStaff.Appearance.SelectedRow.Options.UseBackColor = true; //gridControlStaff.MainView.ExportToXls("test.xls"); //gridControlStaff.MainView.ExportToXlsx("test.xlsx"); gridControlMasterDetail.DataSource = xpServerCollectionSourceMasterDetail; gridControlMasterDetail.ViewRegistered += GridControlMasterDetail_ViewRegistered; gridControlADOdotNETDataTable.DataSource = GetDataTable(); gridControlTestTable4Types.DataSource = new XPCollection(session, typeof(TestTable4Types)); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmEventBrw)); this.gcolStatus = new DevExpress.XtraGrid.Columns.GridColumn(); this.pnlBody = new System.Windows.Forms.Panel(); this.pnlBrowse = new System.Windows.Forms.Panel(); this.grdEvent = new DevExpress.XtraGrid.GridControl(); this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.xpServerCollectionSource1 = new DevExpress.Xpo.XPServerCollectionSource(); this.session1 = new DevExpress.Xpo.Session(); this.gvwEvent = new DevExpress.XtraGrid.Views.Grid.GridView(); this.gcolEventID = new DevExpress.XtraGrid.Columns.GridColumn(); this.colCalendarEventID = new DevExpress.XtraGrid.Columns.GridColumn(); this.colStartDateTime = new DevExpress.XtraGrid.Columns.GridColumn(); this.colEndDateTime = new DevExpress.XtraGrid.Columns.GridColumn(); this.gColName = new DevExpress.XtraGrid.Columns.GridColumn(); this.gcolClass = new DevExpress.XtraGrid.Columns.GridColumn(); this.gcolProgram = new DevExpress.XtraGrid.Columns.GridColumn(); this.gcolDescription = new DevExpress.XtraGrid.Columns.GridColumn(); this.gcolPhonetic = new DevExpress.XtraGrid.Columns.GridColumn(); this.gcolNameRomaji = new DevExpress.XtraGrid.Columns.GridColumn(); this.gcolEventType = new DevExpress.XtraGrid.Columns.GridColumn(); this.gcolScheduledIns = new DevExpress.XtraGrid.Columns.GridColumn(); this.gcolRealIns = new DevExpress.XtraGrid.Columns.GridColumn(); this.gcolDateLastLogin = new DevExpress.XtraGrid.Columns.GridColumn(); this.gcolDateCreated = new DevExpress.XtraGrid.Columns.GridColumn(); this.gcolLastModified = new DevExpress.XtraGrid.Columns.GridColumn(); this.gcolLastModifiedByUser = new DevExpress.XtraGrid.Columns.GridColumn(); this.gcolIsRecur = new DevExpress.XtraGrid.Columns.GridColumn(); this.gcolDept = new DevExpress.XtraGrid.Columns.GridColumn(); this.gcolClient = new DevExpress.XtraGrid.Columns.GridColumn(); this.gcolInstructor = new DevExpress.XtraGrid.Columns.GridColumn(); this.gcolExceptionReason = new DevExpress.XtraGrid.Columns.GridColumn(); this.gcolCourseId = new DevExpress.XtraGrid.Columns.GridColumn(); this.gcolDayOfWeek = new DevExpress.XtraGrid.Columns.GridColumn(); this.colDateAndTime = new DevExpress.XtraGrid.Columns.GridColumn(); this.pnlFilter = new System.Windows.Forms.Panel(); this.pnlFilterContainer = new System.Windows.Forms.Panel(); this.cmbClass = new System.Windows.Forms.ComboBox(); this.lblClass = new System.Windows.Forms.Label(); this.datePickerEnd = new System.Windows.Forms.DateTimePicker(); this.cmbProgram = new System.Windows.Forms.ComboBox(); this.lblYear = new System.Windows.Forms.Label(); this.lblProgram = new System.Windows.Forms.Label(); this.datePickerStart = new System.Windows.Forms.DateTimePicker(); this.cmbInstructor = new System.Windows.Forms.ComboBox(); this.lblMonth = new System.Windows.Forms.Label(); this.lblInstructor = new System.Windows.Forms.Label(); this.btnClear = new System.Windows.Forms.Button(); this.cmbClient = new System.Windows.Forms.ComboBox(); this.lblClient = new System.Windows.Forms.Label(); this.pnl_SpeedSearch = new System.Windows.Forms.Panel(); this.pnl_SpeedSearch1 = new System.Windows.Forms.Panel(); this.txt_SpeedSearch = new System.Windows.Forms.TextBox(); this.label1 = new System.Windows.Forms.Label(); this.pnl_Find = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel(); this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.txtSearch = new System.Windows.Forms.TextBox(); this.chk_Anywhere = new System.Windows.Forms.CheckBox(); this.btn_Clear = new System.Windows.Forms.Button(); this.btn_Find = new System.Windows.Forms.Button(); this.lbl_Find = new System.Windows.Forms.Label(); this.chk_AdvanceSearch = new System.Windows.Forms.CheckBox(); this.imgContext = new System.Windows.Forms.ImageList(this.components); this.persistentRepository1 = new DevExpress.XtraEditors.Repository.PersistentRepository(this.components); this.repositoryItemTextEdit1 = new DevExpress.XtraEditors.Repository.RepositoryItemTextEdit(); this.pnlBody.SuspendLayout(); this.pnlBrowse.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.grdEvent)).BeginInit(); this.contextMenuStrip1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.xpServerCollectionSource1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.session1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.gvwEvent)).BeginInit(); this.pnlFilter.SuspendLayout(); this.pnlFilterContainer.SuspendLayout(); this.pnl_SpeedSearch.SuspendLayout(); this.pnl_SpeedSearch1.SuspendLayout(); this.pnl_Find.SuspendLayout(); this.panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.repositoryItemTextEdit1)).BeginInit(); this.SuspendLayout(); // // gcolStatus // this.gcolStatus.Caption = "Status"; this.gcolStatus.FieldName = "EventStatus"; this.gcolStatus.Name = "gcolStatus"; this.gcolStatus.Width = 70; // // pnlBody // this.pnlBody.Controls.Add(this.pnlBrowse); this.pnlBody.Controls.Add(this.pnlFilter); this.pnlBody.Controls.Add(this.pnl_SpeedSearch); this.pnlBody.Controls.Add(this.pnl_Find); this.pnlBody.Dock = System.Windows.Forms.DockStyle.Fill; this.pnlBody.Location = new System.Drawing.Point(0, 0); this.pnlBody.Name = "pnlBody"; this.pnlBody.Size = new System.Drawing.Size(868, 481); this.pnlBody.TabIndex = 30; this.pnlBody.Resize += new System.EventHandler(this.pnlBody_Resize); // // pnlBrowse // this.pnlBrowse.Controls.Add(this.grdEvent); this.pnlBrowse.Dock = System.Windows.Forms.DockStyle.Fill; this.pnlBrowse.Location = new System.Drawing.Point(0, 188); this.pnlBrowse.Name = "pnlBrowse"; this.pnlBrowse.Size = new System.Drawing.Size(868, 293); this.pnlBrowse.TabIndex = 45; // // grdEvent // this.grdEvent.ContextMenuStrip = this.contextMenuStrip1; this.grdEvent.DataSource = this.xpServerCollectionSource1; this.grdEvent.Dock = System.Windows.Forms.DockStyle.Fill; this.grdEvent.Location = new System.Drawing.Point(0, 0); this.grdEvent.MainView = this.gvwEvent; this.grdEvent.Name = "grdEvent"; //this.grdEvent.ServerMode = true; this.grdEvent.Size = new System.Drawing.Size(868, 293); this.grdEvent.TabIndex = 26; this.grdEvent.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { this.gvwEvent}); this.grdEvent.DoubleClick += new System.EventHandler(this.grdEvent_DoubleClick); this.grdEvent.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.grdEvent_KeyPress); this.grdEvent.Click += new System.EventHandler(this.grdEvent_Click); // // contextMenuStrip1 // this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.openToolStripMenuItem, this.deleteToolStripMenuItem}); this.contextMenuStrip1.Name = "contextMenuStrip1"; this.contextMenuStrip1.Size = new System.Drawing.Size(135, 64); // // openToolStripMenuItem // this.openToolStripMenuItem.Name = "openToolStripMenuItem"; this.openToolStripMenuItem.Size = new System.Drawing.Size(134, 30); this.openToolStripMenuItem.Text = "Open"; this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click); // // deleteToolStripMenuItem // this.deleteToolStripMenuItem.Name = "deleteToolStripMenuItem"; this.deleteToolStripMenuItem.Size = new System.Drawing.Size(134, 30); this.deleteToolStripMenuItem.Text = "Delete"; this.deleteToolStripMenuItem.Click += new System.EventHandler(this.deleteToolStripMenuItem_Click); // // xpServerCollectionSource1 // this.xpServerCollectionSource1.ObjectType = typeof(Scheduler.BusinessLayer.EventsPO); this.xpServerCollectionSource1.Session = this.session1; // // gvwEvent // this.gvwEvent.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Style3D; this.gvwEvent.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] { this.gcolEventID, this.colCalendarEventID, this.colStartDateTime, this.colEndDateTime, this.gColName, this.gcolClass, this.gcolProgram, this.gcolDescription, this.gcolPhonetic, this.gcolNameRomaji, this.gcolEventType, this.gcolScheduledIns, this.gcolRealIns, this.gcolStatus, this.gcolDateLastLogin, this.gcolDateCreated, this.gcolLastModified, this.gcolLastModifiedByUser, this.gcolIsRecur, this.gcolDept, this.gcolClient, this.gcolInstructor, this.gcolExceptionReason, this.gcolCourseId, this.gcolDayOfWeek, this.colDateAndTime}); this.gvwEvent.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus; this.gvwEvent.GridControl = this.grdEvent; this.gvwEvent.Name = "gvwEvent"; this.gvwEvent.OptionsBehavior.Editable = false; this.gvwEvent.OptionsBehavior.KeepGroupExpandedOnSorting = false; this.gvwEvent.OptionsNavigation.AutoMoveRowFocus = false; this.gvwEvent.OptionsView.ShowDetailButtons = false; this.gvwEvent.OptionsView.ShowGroupPanel = false; this.gvwEvent.OptionsView.ShowHorizontalLines = DevExpress.Utils.DefaultBoolean.False; ; this.gvwEvent.OptionsView.ShowIndicator = false; this.gvwEvent.SortInfo.AddRange(new DevExpress.XtraGrid.Columns.GridColumnSortInfo[] { new DevExpress.XtraGrid.Columns.GridColumnSortInfo(this.gcolClass, DevExpress.Data.ColumnSortOrder.Ascending)}); this.gvwEvent.RowCellStyle += new DevExpress.XtraGrid.Views.Grid.RowCellStyleEventHandler(this.gvwEvent_RowCellStyle); // // gcolEventID // this.gcolEventID.Caption = "Event ID"; this.gcolEventID.FieldName = "EventId"; this.gcolEventID.Name = "gcolEventID"; // // colCalendarEventID // this.colCalendarEventID.Caption = "CalendarEventID"; this.colCalendarEventID.FieldName = "CalendarEventId"; this.colCalendarEventID.Name = "colCalendarEventID"; // // colStartDateTime // this.colStartDateTime.Caption = "Start Date"; this.colStartDateTime.DisplayFormat.FormatString = "MM/dd/yyyy HH:mm"; this.colStartDateTime.DisplayFormat.FormatType = DevExpress.Utils.FormatType.DateTime; this.colStartDateTime.FieldName = "StartDateTime"; this.colStartDateTime.MinWidth = 90; this.colStartDateTime.Name = "colStartDateTime"; this.colStartDateTime.Width = 105; // // colEndDateTime // this.colEndDateTime.Caption = "End Date"; this.colEndDateTime.DisplayFormat.FormatString = "MM/dd/yyyy HH:mm"; this.colEndDateTime.DisplayFormat.FormatType = DevExpress.Utils.FormatType.DateTime; this.colEndDateTime.FieldName = "EndDateTime"; this.colEndDateTime.MinWidth = 90; this.colEndDateTime.Name = "colEndDateTime"; this.colEndDateTime.Width = 90; // // gColName // this.gColName.Caption = "Event Name"; this.gColName.FieldName = "Name"; this.gColName.Name = "gColName"; this.gColName.Visible = true; this.gColName.VisibleIndex = 5; this.gColName.Width = 216; // // gcolClass // this.gcolClass.Caption = "Class"; this.gcolClass.FieldName = "Class"; this.gcolClass.Name = "gcolClass"; this.gcolClass.Width = 98; // // gcolProgram // this.gcolProgram.Caption = "Program"; this.gcolProgram.FieldName = "Program"; this.gcolProgram.Name = "gcolProgram"; this.gcolProgram.Visible = true; this.gcolProgram.VisibleIndex = 3; this.gcolProgram.Width = 189; // // gcolDescription // this.gcolDescription.Caption = "Description"; this.gcolDescription.FieldName = "Description"; this.gcolDescription.Name = "gcolDescription"; this.gcolDescription.Width = 114; // // gcolPhonetic // this.gcolPhonetic.Caption = "Name Phonetic"; this.gcolPhonetic.FieldName = "NamePhonetic"; this.gcolPhonetic.Name = "gcolPhonetic"; this.gcolPhonetic.Width = 90; // // gcolNameRomaji // this.gcolNameRomaji.Caption = "Name Romaji"; this.gcolNameRomaji.FieldName = "NameRomaji"; this.gcolNameRomaji.Name = "gcolNameRomaji"; this.gcolNameRomaji.Width = 90; // // gcolEventType // this.gcolEventType.Caption = "Event Type"; this.gcolEventType.FieldName = "EventType"; this.gcolEventType.Name = "gcolEventType"; this.gcolEventType.Width = 61; // // gcolScheduledIns // this.gcolScheduledIns.Caption = "Scheduled Instructor"; this.gcolScheduledIns.FieldName = "ScheduledTeacher"; this.gcolScheduledIns.Name = "gcolScheduledIns"; this.gcolScheduledIns.Visible = true; this.gcolScheduledIns.VisibleIndex = 6; this.gcolScheduledIns.Width = 167; // // gcolRealIns // this.gcolRealIns.Caption = "Real Instructor"; this.gcolRealIns.FieldName = "RealTeacher"; this.gcolRealIns.Name = "gcolRealIns"; this.gcolRealIns.Width = 80; // // gcolDateLastLogin // this.gcolDateLastLogin.Caption = "Date Last Login"; this.gcolDateLastLogin.FieldName = "DatelastLogin"; this.gcolDateLastLogin.Name = "gcolDateLastLogin"; // // gcolDateCreated // this.gcolDateCreated.Caption = "Date Created"; this.gcolDateCreated.FieldName = "DateCreated"; this.gcolDateCreated.Name = "gcolDateCreated"; // // gcolLastModified // this.gcolLastModified.Caption = "Date Last Modified"; this.gcolLastModified.FieldName = "DateLastModified"; this.gcolLastModified.Name = "gcolLastModified"; // // gcolLastModifiedByUser // this.gcolLastModifiedByUser.Caption = "Last Modified User ID"; this.gcolLastModifiedByUser.FieldName = "LastModifiedByUserID"; this.gcolLastModifiedByUser.Name = "gcolLastModifiedByUser"; // // gcolIsRecur // this.gcolIsRecur.Caption = "IsRecur"; this.gcolIsRecur.FieldName = "RecurrenceText"; this.gcolIsRecur.Name = "gcolIsRecur"; // // gcolDept // this.gcolDept.Caption = "Department"; this.gcolDept.FieldName = "Department"; this.gcolDept.Name = "gcolDept"; this.gcolDept.Visible = true; this.gcolDept.VisibleIndex = 4; this.gcolDept.Width = 197; // // gcolClient // this.gcolClient.Caption = "Client"; this.gcolClient.FieldName = "Client"; this.gcolClient.Name = "gcolClient"; this.gcolClient.Visible = true; this.gcolClient.VisibleIndex = 2; this.gcolClient.Width = 197; // // gcolInstructor // this.gcolInstructor.Caption = "Actual Instructor"; this.gcolInstructor.FieldName = "Instructor"; this.gcolInstructor.Name = "gcolInstructor"; this.gcolInstructor.Visible = true; this.gcolInstructor.VisibleIndex = 7; this.gcolInstructor.Width = 167; // // gcolExceptionReason // this.gcolExceptionReason.Caption = "Exception Reason"; this.gcolExceptionReason.FieldName = "ExceptionReason"; this.gcolExceptionReason.Name = "gcolExceptionReason"; this.gcolExceptionReason.Visible = true; this.gcolExceptionReason.VisibleIndex = 8; this.gcolExceptionReason.Width = 222; // // gcolCourseId // this.gcolCourseId.Caption = "CourseId"; this.gcolCourseId.FieldName = "CourseId"; this.gcolCourseId.Name = "gcolCourseId"; // // gcolDayOfWeek // this.gcolDayOfWeek.Caption = "Day Of Week"; this.gcolDayOfWeek.FieldName = "DayOfWeek"; this.gcolDayOfWeek.Name = "gcolDayOfWeek"; this.gcolDayOfWeek.Visible = true; this.gcolDayOfWeek.VisibleIndex = 1; this.gcolDayOfWeek.Width = 124; // // colDateAndTime // this.colDateAndTime.Caption = "Date and Time"; this.colDateAndTime.DisplayFormat.FormatString = "G"; this.colDateAndTime.DisplayFormat.FormatType = DevExpress.Utils.FormatType.DateTime; this.colDateAndTime.FieldName = "DateAndTime"; this.colDateAndTime.Name = "colDateAndTime"; this.colDateAndTime.SortMode = DevExpress.XtraGrid.ColumnSortMode.Value; this.colDateAndTime.Visible = true; this.colDateAndTime.VisibleIndex = 0; this.colDateAndTime.Width = 268; // // pnlFilter // this.pnlFilter.BackColor = System.Drawing.SystemColors.GrayText; this.pnlFilter.Controls.Add(this.pnlFilterContainer); this.pnlFilter.Dock = System.Windows.Forms.DockStyle.Top; this.pnlFilter.Location = new System.Drawing.Point(0, 128); this.pnlFilter.Name = "pnlFilter"; this.pnlFilter.Size = new System.Drawing.Size(868, 60); this.pnlFilter.TabIndex = 44; // // pnlFilterContainer // this.pnlFilterContainer.Controls.Add(this.cmbClass); this.pnlFilterContainer.Controls.Add(this.lblClass); this.pnlFilterContainer.Controls.Add(this.datePickerEnd); this.pnlFilterContainer.Controls.Add(this.cmbProgram); this.pnlFilterContainer.Controls.Add(this.lblYear); this.pnlFilterContainer.Controls.Add(this.lblProgram); this.pnlFilterContainer.Controls.Add(this.datePickerStart); this.pnlFilterContainer.Controls.Add(this.cmbInstructor); this.pnlFilterContainer.Controls.Add(this.lblMonth); this.pnlFilterContainer.Controls.Add(this.lblInstructor); this.pnlFilterContainer.Controls.Add(this.btnClear); this.pnlFilterContainer.Controls.Add(this.cmbClient); this.pnlFilterContainer.Controls.Add(this.lblClient); this.pnlFilterContainer.Dock = System.Windows.Forms.DockStyle.Fill; this.pnlFilterContainer.Location = new System.Drawing.Point(0, 0); this.pnlFilterContainer.Name = "pnlFilterContainer"; this.pnlFilterContainer.Size = new System.Drawing.Size(868, 60); this.pnlFilterContainer.TabIndex = 16; // // cmbClass // this.cmbClass.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbClass.DropDownWidth = 173; this.cmbClass.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.cmbClass.ItemHeight = 21; this.cmbClass.Items.AddRange(new object[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}); this.cmbClass.Location = new System.Drawing.Point(502, 32); this.cmbClass.Name = "cmbClass"; this.cmbClass.Size = new System.Drawing.Size(137, 29); this.cmbClass.TabIndex = 12; this.cmbClass.SelectedIndexChanged += new System.EventHandler(this.cmbClass_SelectedIndexChanged); // // lblClass // this.lblClass.AutoSize = true; this.lblClass.BackColor = System.Drawing.SystemColors.GrayText; this.lblClass.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblClass.Location = new System.Drawing.Point(446, 36); this.lblClass.Name = "lblClass"; this.lblClass.Size = new System.Drawing.Size(54, 21); this.lblClass.TabIndex = 11; this.lblClass.Text = "Class"; // // datePickerEnd // this.datePickerEnd.Checked = false; this.datePickerEnd.CustomFormat = "MM/dd/yyyy"; this.datePickerEnd.Format = System.Windows.Forms.DateTimePickerFormat.Custom; this.datePickerEnd.Location = new System.Drawing.Point(85, 33); this.datePickerEnd.Name = "datePickerEnd"; this.datePickerEnd.Size = new System.Drawing.Size(93, 27); this.datePickerEnd.TabIndex = 15; this.datePickerEnd.ValueChanged += new System.EventHandler(this.datePickerValueChanged); // // cmbProgram // this.cmbProgram.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbProgram.DropDownWidth = 173; this.cmbProgram.Items.AddRange(new object[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}); this.cmbProgram.Location = new System.Drawing.Point(502, 6); this.cmbProgram.Name = "cmbProgram"; this.cmbProgram.Size = new System.Drawing.Size(137, 29); this.cmbProgram.TabIndex = 10; this.cmbProgram.SelectedIndexChanged += new System.EventHandler(this.cmbProgram_SelectedIndexChanged); // // lblYear // this.lblYear.AutoSize = true; this.lblYear.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblYear.Location = new System.Drawing.Point(13, 11); this.lblYear.Name = "lblYear"; this.lblYear.Size = new System.Drawing.Size(97, 21); this.lblYear.TabIndex = 0; this.lblYear.Text = "Start Date"; // // lblProgram // this.lblProgram.AutoSize = true; this.lblProgram.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblProgram.Location = new System.Drawing.Point(446, 11); this.lblProgram.Name = "lblProgram"; this.lblProgram.Size = new System.Drawing.Size(83, 21); this.lblProgram.TabIndex = 9; this.lblProgram.Text = "Program"; // // datePickerStart // this.datePickerStart.Checked = false; this.datePickerStart.CustomFormat = "MM/dd/yyyy"; this.datePickerStart.Format = System.Windows.Forms.DateTimePickerFormat.Custom; this.datePickerStart.Location = new System.Drawing.Point(85, 7); this.datePickerStart.Name = "datePickerStart"; this.datePickerStart.Size = new System.Drawing.Size(93, 27); this.datePickerStart.TabIndex = 14; this.datePickerStart.ValueChanged += new System.EventHandler(this.datePickerValueChanged); // // cmbInstructor // this.cmbInstructor.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbInstructor.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.cmbInstructor.ItemHeight = 21; this.cmbInstructor.Items.AddRange(new object[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}); this.cmbInstructor.Location = new System.Drawing.Point(277, 32); this.cmbInstructor.Name = "cmbInstructor"; this.cmbInstructor.Size = new System.Drawing.Size(137, 29); this.cmbInstructor.TabIndex = 8; this.cmbInstructor.SelectedIndexChanged += new System.EventHandler(this.cmbInstructor_SelectedIndexChanged); // // lblMonth // this.lblMonth.AutoSize = true; this.lblMonth.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblMonth.Location = new System.Drawing.Point(13, 36); this.lblMonth.Name = "lblMonth"; this.lblMonth.Size = new System.Drawing.Size(87, 21); this.lblMonth.TabIndex = 2; this.lblMonth.Text = "End Date"; // // lblInstructor // this.lblInstructor.AutoSize = true; this.lblInstructor.BackColor = System.Drawing.SystemColors.GrayText; this.lblInstructor.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblInstructor.Location = new System.Drawing.Point(212, 36); this.lblInstructor.Name = "lblInstructor"; this.lblInstructor.Size = new System.Drawing.Size(97, 21); this.lblInstructor.TabIndex = 7; this.lblInstructor.Text = "Instructor"; // // btnClear // this.btnClear.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btnClear.ForeColor = System.Drawing.Color.Black; this.btnClear.Location = new System.Drawing.Point(13, 4); this.btnClear.Name = "btnClear"; this.btnClear.Size = new System.Drawing.Size(128, 57); this.btnClear.TabIndex = 13; this.btnClear.Text = "Clear All Filters"; this.btnClear.Visible = false; this.btnClear.Click += new System.EventHandler(this.btnClear_Click); // // cmbClient // this.cmbClient.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbClient.Items.AddRange(new object[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}); this.cmbClient.Location = new System.Drawing.Point(277, 6); this.cmbClient.Name = "cmbClient"; this.cmbClient.Size = new System.Drawing.Size(137, 29); this.cmbClient.TabIndex = 6; this.cmbClient.SelectedIndexChanged += new System.EventHandler(this.cmbClient_SelectedIndexChanged); // // lblClient // this.lblClient.AutoSize = true; this.lblClient.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblClient.Location = new System.Drawing.Point(212, 11); this.lblClient.Name = "lblClient"; this.lblClient.Size = new System.Drawing.Size(59, 21); this.lblClient.TabIndex = 5; this.lblClient.Text = "Client"; // // pnl_SpeedSearch // this.pnl_SpeedSearch.BackColor = System.Drawing.Color.Black; this.pnl_SpeedSearch.Controls.Add(this.pnl_SpeedSearch1); this.pnl_SpeedSearch.Location = new System.Drawing.Point(103, 412); this.pnl_SpeedSearch.Name = "pnl_SpeedSearch"; this.pnl_SpeedSearch.Size = new System.Drawing.Size(306, 102); this.pnl_SpeedSearch.TabIndex = 42; this.pnl_SpeedSearch.Visible = false; // // pnl_SpeedSearch1 // this.pnl_SpeedSearch1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(38)))), ((int)(((byte)(143)))), ((int)(((byte)(230))))); this.pnl_SpeedSearch1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.pnl_SpeedSearch1.Controls.Add(this.txt_SpeedSearch); this.pnl_SpeedSearch1.Controls.Add(this.label1); this.pnl_SpeedSearch1.Location = new System.Drawing.Point(7, 6); this.pnl_SpeedSearch1.Name = "pnl_SpeedSearch1"; this.pnl_SpeedSearch1.Size = new System.Drawing.Size(294, 92); this.pnl_SpeedSearch1.TabIndex = 39; // // txt_SpeedSearch // this.txt_SpeedSearch.Location = new System.Drawing.Point(17, 41); this.txt_SpeedSearch.Name = "txt_SpeedSearch"; this.txt_SpeedSearch.Size = new System.Drawing.Size(252, 27); this.txt_SpeedSearch.TabIndex = 10; this.txt_SpeedSearch.TextChanged += new System.EventHandler(this.txt_SpeedSearch_TextChanged); this.txt_SpeedSearch.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txt_SpeedSearch_KeyDown); this.txt_SpeedSearch.Leave += new System.EventHandler(this.txt_SpeedSearch_Leave); this.txt_SpeedSearch.KeyUp += new System.Windows.Forms.KeyEventHandler(this.txt_SpeedSearch_KeyUp); // // label1 // this.label1.AutoSize = true; this.label1.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label1.ForeColor = System.Drawing.Color.White; this.label1.Location = new System.Drawing.Point(89, 6); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(103, 19); this.label1.TabIndex = 0; this.label1.Text = "Fast Search"; // // pnl_Find // this.pnl_Find.BackColor = System.Drawing.SystemColors.Window; this.pnl_Find.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.pnl_Find.Controls.Add(this.panel1); this.pnl_Find.Controls.Add(this.txtSearch); this.pnl_Find.Controls.Add(this.chk_Anywhere); this.pnl_Find.Controls.Add(this.btn_Clear); this.pnl_Find.Controls.Add(this.btn_Find); this.pnl_Find.Controls.Add(this.lbl_Find); this.pnl_Find.Controls.Add(this.chk_AdvanceSearch); this.pnl_Find.Dock = System.Windows.Forms.DockStyle.Top; this.pnl_Find.Location = new System.Drawing.Point(0, 0); this.pnl_Find.Name = "pnl_Find"; this.pnl_Find.Size = new System.Drawing.Size(868, 128); this.pnl_Find.TabIndex = 28; // // panel1 // this.panel1.Controls.Add(this.pictureBox1); this.panel1.Dock = System.Windows.Forms.DockStyle.Right; this.panel1.Location = new System.Drawing.Point(582, 0); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(282, 124); this.panel1.TabIndex = 10; // // pictureBox1 // this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill; this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image"))); this.pictureBox1.Location = new System.Drawing.Point(0, 0); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new System.Drawing.Size(282, 124); this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.pictureBox1.TabIndex = 0; this.pictureBox1.TabStop = false; // // txtSearch // this.txtSearch.Location = new System.Drawing.Point(103, 25); this.txtSearch.Name = "txtSearch"; this.txtSearch.Size = new System.Drawing.Size(473, 27); this.txtSearch.TabIndex = 9; this.txtSearch.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtSearch_KeyDown); // // chk_Anywhere // this.chk_Anywhere.BackColor = System.Drawing.SystemColors.Window; this.chk_Anywhere.FlatStyle = System.Windows.Forms.FlatStyle.System; this.chk_Anywhere.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.chk_Anywhere.Location = new System.Drawing.Point(336, 62); this.chk_Anywhere.Name = "chk_Anywhere"; this.chk_Anywhere.RightToLeft = System.Windows.Forms.RightToLeft.No; this.chk_Anywhere.Size = new System.Drawing.Size(247, 36); this.chk_Anywhere.TabIndex = 7; this.chk_Anywhere.Text = "Search Anywhere in Fields"; this.chk_Anywhere.UseVisualStyleBackColor = false; // // btn_Clear // this.btn_Clear.BackColor = System.Drawing.SystemColors.Control; this.btn_Clear.FlatStyle = System.Windows.Forms.FlatStyle.System; this.btn_Clear.Location = new System.Drawing.Point(592, 62); this.btn_Clear.Name = "btn_Clear"; this.btn_Clear.Size = new System.Drawing.Size(120, 33); this.btn_Clear.TabIndex = 6; this.btn_Clear.Text = "Clear"; this.btn_Clear.UseVisualStyleBackColor = false; this.btn_Clear.Click += new System.EventHandler(this.btn_Clear_Click); // // btn_Find // this.btn_Find.BackColor = System.Drawing.SystemColors.Control; this.btn_Find.FlatStyle = System.Windows.Forms.FlatStyle.System; this.btn_Find.Location = new System.Drawing.Point(592, 21); this.btn_Find.Name = "btn_Find"; this.btn_Find.Size = new System.Drawing.Size(120, 33); this.btn_Find.TabIndex = 4; this.btn_Find.Text = "Find"; this.btn_Find.UseVisualStyleBackColor = false; this.btn_Find.Click += new System.EventHandler(this.btn_Find_Click); // // lbl_Find // this.lbl_Find.AutoSize = true; this.lbl_Find.Location = new System.Drawing.Point(24, 27); this.lbl_Find.Name = "lbl_Find"; this.lbl_Find.Size = new System.Drawing.Size(46, 21); this.lbl_Find.TabIndex = 0; this.lbl_Find.Text = " Find"; // // chk_AdvanceSearch // this.chk_AdvanceSearch.BackColor = System.Drawing.SystemColors.Window; this.chk_AdvanceSearch.Checked = true; this.chk_AdvanceSearch.CheckState = System.Windows.Forms.CheckState.Checked; this.chk_AdvanceSearch.FlatStyle = System.Windows.Forms.FlatStyle.System; this.chk_AdvanceSearch.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.chk_AdvanceSearch.Location = new System.Drawing.Point(103, 62); this.chk_AdvanceSearch.Name = "chk_AdvanceSearch"; this.chk_AdvanceSearch.RightToLeft = System.Windows.Forms.RightToLeft.No; this.chk_AdvanceSearch.Size = new System.Drawing.Size(178, 36); this.chk_AdvanceSearch.TabIndex = 8; this.chk_AdvanceSearch.Text = "Search All Fields"; this.chk_AdvanceSearch.UseVisualStyleBackColor = false; // // imgContext // this.imgContext.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imgContext.ImageStream"))); this.imgContext.TransparentColor = System.Drawing.Color.Fuchsia; this.imgContext.Images.SetKeyName(0, ""); this.imgContext.Images.SetKeyName(1, ""); // // persistentRepository1 // this.persistentRepository1.Items.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] { this.repositoryItemTextEdit1}); // // repositoryItemTextEdit1 // this.repositoryItemTextEdit1.AllowFocused = false; this.repositoryItemTextEdit1.AutoHeight = false; this.repositoryItemTextEdit1.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder; this.repositoryItemTextEdit1.Name = "repositoryItemTextEdit1"; // // frmEventBrw // this.AutoScaleBaseSize = new System.Drawing.Size(8, 20); this.ClientSize = new System.Drawing.Size(868, 481); this.Controls.Add(this.pnlBody); this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Name = "frmEventBrw"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "frmEventBrw"; this.Load += new System.EventHandler(this.frmEventBrw_Load); this.Resize += new System.EventHandler(this.frmEventBrw_Resize); this.pnlBody.ResumeLayout(false); this.pnlBrowse.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.grdEvent)).EndInit(); this.contextMenuStrip1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.xpServerCollectionSource1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.session1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.gvwEvent)).EndInit(); this.pnlFilter.ResumeLayout(false); this.pnlFilterContainer.ResumeLayout(false); this.pnlFilterContainer.PerformLayout(); this.pnl_SpeedSearch.ResumeLayout(false); this.pnl_SpeedSearch1.ResumeLayout(false); this.pnl_SpeedSearch1.PerformLayout(); this.pnl_Find.ResumeLayout(false); this.pnl_Find.PerformLayout(); this.panel1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.repositoryItemTextEdit1)).EndInit(); this.ResumeLayout(false); }
public void InitializeDataBaseListView() { XPODataHelper datahelper = new XPODataHelper(); IObjectSpace space = datahelper.Connect(); // Create a Session object. Session session1 = ((XPObjectSpace)space).Session; // Create an XPClassInfo object corresponding to the Person class. XPClassInfo classInfo = session1.GetClassInfo(typeof(GIBS.Module.Models.Programs.HAP.HAPApplication)); // Create an XPServerCollectionSource object. XPServerCollectionSource xpServerCollectionSource1 = new XPServerCollectionSource(session1, classInfo); gridControl1.Dock = DockStyle.Fill; // Bind the grid control to the data source. gridControl1.DataSource = xpServerCollectionSource1; gridControl1.MainView.HideEditor(); //clear the columns ((ColumnView)gridControl1.Views[0]).Columns.Clear(); //add searchable properties to grid ((ColumnView)gridControl1.Views[0]).Columns.AddVisible("FullName"); ((ColumnView)gridControl1.Views[0]).Columns.AddField("Client.FirstName"); ((ColumnView)gridControl1.Views[0]).Columns.AddField("Client.LastName"); ((ColumnView)gridControl1.Views[0]).Columns.AddField("Client.FAST"); ((ColumnView)gridControl1.Views[0]).Columns.AddField("Address.StreetAddress1"); ((ColumnView)gridControl1.Views[0]).Columns.AddField("Address.FullAddress"); ((ColumnView)gridControl1.Views[0]).Columns.AddField("Address.City.Name"); ((ColumnView)gridControl1.Views[0]).Columns.AddField("LDC.Name"); ((ColumnView)gridControl1.Views[0]).Columns.AddField("ApplicationType"); ((ColumnView)gridControl1.Views[0]).Columns.AddField("Oid"); //((ColumnView)gridControl1.Views[0]).Columns.AddField("SocialHousing"); //show the find panel ((ColumnView)gridControl1.Views[0]).ShowFindPanel(); ((ColumnView)gridControl1.Views[0]).OptionsFind.AlwaysVisible = true; //add event listener for when row changes ((ColumnView)gridControl1.Views[0]).FocusedRowChanged += Form1_FocusedRowChanged; }
protected override Object RecreateCollection(CriteriaOperator criteria, SortingCollection sortings) { XPClassInfo objectClassInfo = null; if (XafTypesInfo.XpoTypeInfoSource.TypeIsKnown(ObjectTypeInfo.Type)) { objectClassInfo = XafTypesInfo.XpoTypeInfoSource.GetEntityClassInfo(ObjectTypeInfo.Type); } if (objectClassInfo != null) { serverCollection = new XPServerCollectionSource(this.ObjectSpace.Session, objectClassInfo, criteria); } else { serverCollection = new XPServerCollectionSource(this.ObjectSpace.Session, this.ObjectTypeInfo.Type, criteria); } SetDisplayablePropertiesToCollection(); return serverCollection; }