private void populateActivations() { ulvActivations.Items.Clear(); ulvActivations.SubItemColumns.Clear(); ulvActivations.SelectedItems.Clear(); ulvActivations.ViewSettingsDetails.CheckBoxStyle = CheckBoxStyle.None; ulvActivations.ViewSettingsDetails.ImageSize = Size.Empty; ulvActivations.ViewSettingsDetails.FullRowSelect = true; ulvActivations.View = UltraListViewStyle.Details; ulvActivations.ViewSettingsList.MultiColumn = false; ulvActivations.ViewSettingsDetails.SubItemColumnsVisibleByDefault = true; ulvActivations.ViewSettingsDetails.AutoFitColumns = AutoFitColumns.ResizeAllColumns; ulvActivations.ItemSettings.SubItemsVisibleInToolTipByDefault = false; ulvActivations.ItemSettings.SelectionType = SelectionType.Single; ulvActivations.ItemSettings.AllowEdit = DefaultableBoolean.False; UltraListViewMainColumn mainColumn = ulvActivations.MainColumn; mainColumn.Text = "Activation ID"; mainColumn.DataType = typeof(Int32); mainColumn.Width = 90; UltraListViewSubItemColumn cExpirationDate = new UltraListViewSubItemColumn(); cExpirationDate.Text = "Expiration Date"; cExpirationDate.Width = 60; cExpirationDate.VisibleInDetailsView = DefaultableBoolean.True; cExpirationDate.DataType = typeof(String); UltraListViewSubItemColumn cIsActivated = new UltraListViewSubItemColumn(); cIsActivated.Text = "Activated"; cIsActivated.Width = 50; cIsActivated.VisibleInDetailsView = DefaultableBoolean.True; cIsActivated.DataType = typeof(String); UltraListViewSubItemColumn cIsEnabled = new UltraListViewSubItemColumn(); cIsEnabled.Text = "Enabled"; cIsEnabled.Width = 30; cIsEnabled.VisibleInDetailsView = DefaultableBoolean.True; cIsEnabled.DataType = typeof(String); ulvActivations.SubItemColumns.Add(cExpirationDate); ulvActivations.SubItemColumns.Add(cIsActivated); ulvActivations.SubItemColumns.Add(cIsEnabled); Activation[] acts = licenseService.GetActivationsByLicenseId(this.currentLicenseId); for (int i = 0; i < acts.Length; i++) { UltraListViewItem item = ulvActivations.Items.Add(acts[i].ID.ToString(), acts[i].ActivationCode); item.SubItems[0].Value = acts[i].ExpirationDate.ToShortDateString(); item.SubItems[1].Value = acts[i].IsActivated; item.SubItems[2].Value = acts[i].Enabled; } }
private void populateClients() { this.grpSites.Visible = false; LMan4.com.licensemanager4web.Client[] clients; ulvClients.Items.Clear(); ulvClients.SubItemColumns.Clear(); ulvClients.SelectedItems.Clear(); ulvClients.ViewSettingsDetails.CheckBoxStyle = CheckBoxStyle.None; ulvClients.ViewSettingsDetails.ImageSize = Size.Empty; ulvClients.ViewSettingsDetails.FullRowSelect = true; ulvClients.View = UltraListViewStyle.Details; ulvClients.ViewSettingsList.MultiColumn = false; ulvClients.ViewSettingsDetails.SubItemColumnsVisibleByDefault = true; ulvClients.ViewSettingsDetails.AutoFitColumns = AutoFitColumns.ResizeAllColumns; ulvClients.ItemSettings.SubItemsVisibleInToolTipByDefault = false; ulvClients.ItemSettings.SelectionType = SelectionType.Single; ulvClients.ItemSettings.AllowEdit = DefaultableBoolean.False; UltraListViewMainColumn mainColumn = ulvClients.MainColumn; mainColumn.Text = "Sales Force Id"; mainColumn.DataType = typeof(Int32); mainColumn.Width = 50; UltraListViewSubItemColumn cClientName = new UltraListViewSubItemColumn(); cClientName.Text = "Client Name"; cClientName.Width = 50; cClientName.VisibleInDetailsView = DefaultableBoolean.True; cClientName.DataType = typeof(String); UltraListViewSubItemColumn cNumSites = new UltraListViewSubItemColumn(); cNumSites.Text = "# Sites"; cNumSites.Width = 50; cNumSites.VisibleInDetailsView = DefaultableBoolean.True; cNumSites.DataType = typeof(String); ulvClients.SubItemColumns.Add(cClientName); ulvClients.SubItemColumns.Add(cNumSites); //get all clients clients = licenseService.GetAllClients(); for (int i = 0; i < clients.Length; i++) { UltraListViewItem item = ulvClients.Items.Add(clients[i].ID.ToString(), clients[i].SalesForceId.ToString()); item.SubItems[0].Value = clients[i].ClientName; item.SubItems[1].Value = clients[i].NumberOfSites; } this.ulvClients.Focus(); }
private void Init() { bDone.Hide(); bDelete.Hide(); updateProductUI(); // Load up the Listview // Set the control's View property to 'Details' ulvDETemplates.View = UltraListViewStyle.Details; // Set some properties so that SubItems (and their respective // columns) are visible by default in the views that support // columns, and also, make the column names and sub-item // values not appear in tooltips by default. ulvDETemplates.ViewSettingsDetails.SubItemColumnsVisibleByDefault = true; ulvDETemplates.ViewSettingsDetails.AutoFitColumns = AutoFitColumns.ResizeAllColumns; //ulvSessions.ViewSettingsTiles.SubItemsVisibleByDefault = true; ulvDETemplates.ItemSettings.SubItemsVisibleInToolTipByDefault = false; // Add columns in listview ulvDETemplates.MainColumn.Text = "Template Name"; ulvDETemplates.MainColumn.DataType = typeof(System.String); ulvDETemplates.MainColumn.Width = 100; UltraListViewSubItemColumn subItemColumn = null; subItemColumn = ulvDETemplates.SubItemColumns.Add("Description"); subItemColumn.DataType = typeof(System.String); subItemColumn.Text = "Description"; subItemColumn = ulvDETemplates.SubItemColumns.Add("ID"); subItemColumn.DataType = typeof(System.Int32); subItemColumn.Text = "ID"; subItemColumn.VisibleInDetailsView = DefaultableBoolean.False; // Get all manual data entry sessions and add them to list view control collection string sql = @"SELECT * FROM DataEntryTemplates ORDER BY DETName ASC"; DataTable dtdet = new DataTable(); dtdet = VWA4Common.DB.Retrieve(sql); _Count = dtdet.Rows.Count; if (dtdet.Rows.Count > 0) { foreach (DataRow row in dtdet.Rows) { string detname = row["DETName"].ToString(); string description = row["DETDescription"].ToString(); string detID = row["ID"].ToString(); UltraListViewItem item = ulvDETemplates.Items.Add(detID, detname); item.SubItems["Description"].Value = description; item.SubItems["ID"].Value = detID; } } }
private void loadPrintSeries(FormSeries fs) { this.activePrintSeriesId = fs.Id; this.newFfs = new List <FormFormSeries>(); ulvPrintSeries.Reset(); ulvPrintSeries.Width = pnlPrintSeries.Width; ulvPrintSeries.Height = pnlPrintSeries.Height; ulvPrintSeries.ViewSettingsDetails.CheckBoxStyle = CheckBoxStyle.CheckBox; ulvPrintSeries.View = UltraListViewStyle.Details; ulvPrintSeries.ItemSettings.Appearance.Image = imageList1.Images[0]; ulvPrintSeries.ViewSettingsDetails.SubItemColumnsVisibleByDefault = true; ulvPrintSeries.ViewSettingsDetails.AutoFitColumns = AutoFitColumns.ResizeAllColumns; ulvPrintSeries.ItemSettings.SubItemsVisibleInToolTipByDefault = false; ulvPrintSeries.ItemSettings.SelectionType = SelectionType.Single; UltraListViewMainColumn mainColumn = ulvPrintSeries.MainColumn; mainColumn.Text = "Enabled"; mainColumn.DataType = typeof(System.Int32); UltraListViewSubItemColumn cNumberOfCopies = new UltraListViewSubItemColumn(); cNumberOfCopies.Text = "# Copies"; cNumberOfCopies.Width = 50; cNumberOfCopies.VisibleInDetailsView = DefaultableBoolean.True; cNumberOfCopies.DataType = typeof(Int32); UltraListViewSubItemColumn cFormId = new UltraListViewSubItemColumn(); cFormId.Text = "FormId"; cFormId.VisibleInDetailsView = DefaultableBoolean.False; cFormId.DataType = typeof(Int32); ulvPrintSeries.SubItemColumns.Add(cNumberOfCopies); ulvPrintSeries.SubItemColumns.Add(cFormId); List <FormFormSeries> allffs = FormFormSeriesDAO.DAO.GetAllByFormSeriesId(fs.Id); allffs.AddRange(this.newFfs); foreach (FormFormSeries ffs in allffs) { VWA4Common.DataObject.Formx f = FormDAO.DAO.Load(ffs.FormId); UltraListViewItem i = ulvPrintSeries.Items.Add(ffs.Id.ToString(), f.Name); i.CheckState = ffs.Enabled ? CheckState.Checked : CheckState.Unchecked; i.SubItems[0].Value = ffs.NumberOfCopies; i.SubItems[1].Value = ffs.FormId; } this.pnlPrintSeries.Controls.Add(ulvPrintSeries); }
public LocationsTabView([ServiceDependency] WorkItem workItem) { this.workItem = workItem as LaytonWorkItem; InitializeComponent(); // Initialize the list and tree views // Set the DefaultImage to a folder icon, since that is the most common // type of item we will be displaying this.locationsList.ItemSettings.DefaultImage = Properties.Resources.location_16; // Populate the UltraListView's SubItemColumns collection with the columns that will represent the // additional information associated with the locations this.locationsList.SubItemColumns.Clear(); UltraListViewSubItemColumn column = null; // Set the text for the MainColumn this.locationsList.MainColumn.Text = "Name"; // Add a column for the Starting IP address column = this.locationsList.SubItemColumns.Add("Starting IP Address"); column.DataType = typeof(string); // Add a column for the Ending IP Address. column = this.locationsList.SubItemColumns.Add("Ending IP Address"); column.DataType = typeof(string); // Set the UltraWinListView.ColumnAutoSizeMode property so that when the end user double-clicks // on the right edge of a column header, the column's width is adjusted to fully // display the text for all visible items and the header. this.locationsList.ViewSettingsDetails.ColumnAutoSizeMode = Infragistics.Win.UltraWinListView.ColumnAutoSizeMode.VisibleItemsAndHeader; // Set UltraWinListView.AutoFitColumns to 'ResizeAllColumns' so that all columns fit in the available // horizontal space. this.locationsList.ViewSettingsDetails.AutoFitColumns = Infragistics.Win.UltraWinListView.AutoFitColumns.ResizeAllColumns; // Tree View // ========= // // Set the tree view to be dynamically expanded this.locationsTree.Override.ShowExpansionIndicator = ShowExpansionIndicator.CheckOnExpand; // Set the display style foe the tree so that we can swap between vista and 'standard' trees AuditWizardConfiguration configuration = new AuditWizardConfiguration(); this.locationsTree.DisplayStyle = (configuration.VistaTrees) ? UltraTreeDisplayStyle.WindowsVista : UltraTreeDisplayStyle.Standard; // Add the root node to the tree - we expand the tree as and when expanded PopulateRoot(); }
private void populateSites() { LMan4.com.licensemanager4web.Site[] sites; ulvSites.Items.Clear(); ulvSites.SubItemColumns.Clear(); ulvSites.SelectedItems.Clear(); ulvSites.ViewSettingsDetails.CheckBoxStyle = CheckBoxStyle.None; ulvSites.ViewSettingsDetails.ImageSize = Size.Empty; ulvSites.ViewSettingsDetails.FullRowSelect = true; ulvSites.View = UltraListViewStyle.Details; ulvSites.ViewSettingsList.MultiColumn = false; ulvSites.ViewSettingsDetails.SubItemColumnsVisibleByDefault = true; ulvSites.ViewSettingsDetails.AutoFitColumns = AutoFitColumns.ResizeAllColumns; ulvSites.ItemSettings.SubItemsVisibleInToolTipByDefault = false; ulvSites.ItemSettings.SelectionType = SelectionType.Single; ulvSites.ItemSettings.AllowEdit = DefaultableBoolean.False; UltraListViewMainColumn mainColumn = ulvSites.MainColumn; mainColumn.Text = "Sales Force ID"; mainColumn.DataType = typeof(Int32); mainColumn.Width = 50; UltraListViewSubItemColumn cSiteName = new UltraListViewSubItemColumn(); cSiteName.Text = "Site Name"; cSiteName.Width = 50; cSiteName.VisibleInDetailsView = DefaultableBoolean.True; cSiteName.DataType = typeof(String); ulvSites.SubItemColumns.Add(cSiteName); //get all sites by selected client sites = licenseService.GetAllSitesByClientId(Convert.ToInt32(this.ulvClients.SelectedItems[0].Key)); for (int i = 0; i < sites.Length; i++) { UltraListViewItem item = ulvSites.Items.Add(sites[i].ID.ToString(), sites[i].SalesForceId.ToString()); item.SubItems[0].Value = sites[i].SiteName; } this.ulvSites.Focus(); }
public frmSeriesProperties(FormSeries fs) { InitializeComponent(); updateProductUI(); this.lblNameValue.Text += fs.Name; this.lblDateCreatedValue.Text += fs.CreateDate.ToShortDateString(); this.lblLastModifiedDateValue.Text += fs.ModifiedDate.ToShortDateString(); UltraListView ulvForms = new UltraListView(); ulvForms.Reset(); ulvForms.Width = 306; ulvForms.Height = 236; ulvForms.View = UltraListViewStyle.Details; ulvForms.ItemSettings.Appearance.Image = imageList1.Images[0]; ulvForms.ViewSettingsDetails.SubItemColumnsVisibleByDefault = true; ulvForms.ViewSettingsDetails.AutoFitColumns = AutoFitColumns.ResizeAllColumns; ulvForms.ItemSettings.SubItemsVisibleInToolTipByDefault = false; ulvForms.ItemSettings.SelectionType = SelectionType.Single; UltraListViewMainColumn mainColumn = ulvForms.MainColumn; mainColumn.Text = "Form Name"; mainColumn.Width = 120; mainColumn.DataType = typeof(System.Int32); UltraListViewSubItemColumn cDocType = new UltraListViewSubItemColumn(); cDocType.Text = "Type"; cDocType.Width = 50; cDocType.VisibleInDetailsView = DefaultableBoolean.True; cDocType.DataType = typeof(String); UltraListViewSubItemColumn cDataEntryTemplate = new UltraListViewSubItemColumn(); cDataEntryTemplate.Text = "Data Entry Template"; cDataEntryTemplate.Width = 136; cDataEntryTemplate.VisibleInDetailsView = DefaultableBoolean.True; cDataEntryTemplate.DataType = typeof(Int32); ulvForms.SubItemColumns.Add(cDocType); ulvForms.SubItemColumns.Add(cDataEntryTemplate); ValueList docType = new ValueList(); ValueList dataEntryTemplate = new ValueList(); foreach (VWA4Common.DataObject.Formx f in FormDAO.DAO.GetAllBySeriesId(fs.Id)) { docType.ValueListItems.Add(f.DocumentType, f.DocumentType); dataEntryTemplate.ValueListItems.Add(f.DataEntryTemplateId, VWA4Common.DB.Retrieve(string.Format("select DETName from DataEntryTemplates where ID={0}", f.DataEntryTemplateId)).Rows[0]["DETName"].ToString()); UltraListViewItem i = ulvForms.Items.Add(Guid.NewGuid().ToString(), f.Name); i.SubItems[0].Value = f.DocumentType; i.SubItems[1].Value = f.DataEntryTemplateId; } ulvForms.SubItemColumns[0].ValueList = docType; ulvForms.SubItemColumns[1].ValueList = dataEntryTemplate; this.pnlFormsInSeries.Controls.Add(ulvForms); }
public void Init(string foodtypeid) { bDone.Hide(); lType.Text = "Select Each Format Type"; string rettypename = ""; string whereclause = ""; if (VWA4Common.GlobalSettings.GetTypeNameFromTypeID("food", foodtypeid, out rettypename)) { lType.Text += " for " + rettypename + ""; // Add the type name if not empty whereclause = " WHERE FoodTypeID = '" + foodtypeid + "' "; msgtag = " for Selected Food Type!"; } // Load up the Listview // Set the control's View property to 'Details' ulvEachFormats.View = UltraListViewStyle.Details; // Set some properties so that SubItems (and their respective // columns) are visible by default in the views that support // columns, and also, make the column names and sub-item // values not appear in tooltips by default. ulvEachFormats.ViewSettingsDetails.SubItemColumnsVisibleByDefault = true; ulvEachFormats.ViewSettingsDetails.AutoFitColumns = AutoFitColumns.ResizeAllColumns; //ulvSessions.ViewSettingsTiles.SubItemsVisibleByDefault = true; ulvEachFormats.ItemSettings.SubItemsVisibleInToolTipByDefault = false; // Add columns in listview ulvEachFormats.MainColumn.Text = "Each Format Type"; ulvEachFormats.MainColumn.DataType = typeof(System.String); UltraListViewSubItemColumn subItemColumn = null; subItemColumn = ulvEachFormats.SubItemColumns.Add("Quantity"); subItemColumn.DataType = typeof(System.Decimal); subItemColumn.Text = "Quantity"; subItemColumn = ulvEachFormats.SubItemColumns.Add("WeightMultiplier"); subItemColumn.DataType = typeof(System.Decimal); subItemColumn.Text = "Per"; subItemColumn = ulvEachFormats.SubItemColumns.Add("WeightUnits"); subItemColumn.DataType = typeof(System.String); subItemColumn.Text = "Weight Units"; subItemColumn = ulvEachFormats.SubItemColumns.Add("Description"); subItemColumn.DataType = typeof(System.String); subItemColumn.Text = "Description"; // Get all Each formats for this food type and add them to list view control collection string sql = @"SELECT * FROM EachFormats " + whereclause + " ORDER BY SortOrder ASC"; DataTable dteachfmt = new DataTable(); dteachfmt = VWA4Common.DB.Retrieve(sql); if (dteachfmt.Rows.Count > 0) { foreach (DataRow row in dteachfmt.Rows) { string eachformatid = row["ID"].ToString(); string eachformatname = row["EachFormatName"].ToString(); decimal eachquantity = decimal.Parse(row["EachQuantity"].ToString()); decimal wtmultiplier = decimal.Parse(row["WtMultiplier"].ToString()); int unitswtid = int.Parse(row["UnitsWtID"].ToString()); // Get UnitsWt info string wtunitsname = ""; string uniquename = ""; string displayfullname = ""; string displayabbreviatedname = ""; decimal conversionfactor = 0; string description = ""; VWA4Common.GlobalSettings.GetWtUnitsDataFromID(unitswtid, out wtunitsname, out displayfullname, out displayabbreviatedname, out conversionfactor, out description); UltraListViewItem item = ulvEachFormats.Items.Add(eachformatid, eachformatname); item.SubItems["Quantity"].Value = eachquantity; item.SubItems["WeightMultiplier"].Value = wtmultiplier; item.SubItems["WeightUnits"].Value = wtunitsname; item.SubItems["Description"].Value = description; // could add hidden column for uniquename if we need to use it } } }
private void populateLicensesList() { this.btnLoad.Enabled = false; LMan4.com.licensemanager4web.License[] licenses; ulvLicenses.Items.Clear(); ulvLicenses.SubItemColumns.Clear(); ulvLicenses.SelectedItems.Clear(); ulvLicenses.ViewSettingsDetails.CheckBoxStyle = CheckBoxStyle.None; ulvLicenses.ViewSettingsDetails.ImageSize = Size.Empty; ulvLicenses.ViewSettingsDetails.FullRowSelect = true; ulvLicenses.View = UltraListViewStyle.Details; ulvLicenses.ViewSettingsList.MultiColumn = false; ulvLicenses.ViewSettingsDetails.SubItemColumnsVisibleByDefault = true; ulvLicenses.ViewSettingsDetails.AutoFitColumns = AutoFitColumns.ResizeAllColumns; ulvLicenses.ItemSettings.SubItemsVisibleInToolTipByDefault = false; ulvLicenses.ItemSettings.SelectionType = SelectionType.Single; ulvLicenses.ItemSettings.AllowEdit = DefaultableBoolean.False; UltraListViewMainColumn mainColumn = ulvLicenses.MainColumn; mainColumn.Text = "ID"; mainColumn.DataType = typeof(Int32); mainColumn.Width = 50; UltraListViewSubItemColumn cLicenseName = new UltraListViewSubItemColumn(); cLicenseName.Text = "LicenseID"; cLicenseName.Width = 50; cLicenseName.VisibleInDetailsView = DefaultableBoolean.True; cLicenseName.DataType = typeof(String); UltraListViewSubItemColumn cProduct = new UltraListViewSubItemColumn(); cProduct.Text = "Product"; cProduct.Width = 50; cProduct.VisibleInDetailsView = DefaultableBoolean.True; cProduct.DataType = typeof(String); UltraListViewSubItemColumn cLicenseType = new UltraListViewSubItemColumn(); cLicenseType.Text = "License Type"; cLicenseType.Width = 50; cLicenseType.VisibleInDetailsView = DefaultableBoolean.True; cLicenseType.DataType = typeof(String); UltraListViewSubItemColumn cGeneratedBy = new UltraListViewSubItemColumn(); cGeneratedBy.Text = "Created By"; cGeneratedBy.Width = 50; cGeneratedBy.VisibleInDetailsView = DefaultableBoolean.True; cGeneratedBy.DataType = typeof(String); UltraListViewSubItemColumn cGeneratedTime = new UltraListViewSubItemColumn(); cGeneratedTime.Text = "Date Created"; cGeneratedTime.Width = 100; cGeneratedTime.VisibleInDetailsView = DefaultableBoolean.True; cGeneratedTime.DataType = typeof(String); ulvLicenses.SubItemColumns.Add(cLicenseName); ulvLicenses.SubItemColumns.Add(cProduct); ulvLicenses.SubItemColumns.Add(cLicenseType); ulvLicenses.SubItemColumns.Add(cGeneratedBy); ulvLicenses.SubItemColumns.Add(cGeneratedTime); if ((this.ddlClients.SelectedItem as Client).ID != -1 && (this.ddlSites.SelectedItem as Site).ID != -1) { licenses = licenseService.GetLicensesByClientIdAndSiteId(Convert.ToInt32((this.ddlClients.SelectedItem as Client).ID), Convert.ToInt32((this.ddlSites.SelectedItem as Site).ID)); } else if ((this.ddlClients.SelectedItem as Client).ID != -1) { licenses = licenseService.GetLicensesByClientId(Convert.ToInt32((this.ddlClients.SelectedItem as Client).ID)); } else { licenses = licenseService.GetAllLicenses(); } for (int i = 0; i < licenses.Length; i++) { UltraListViewItem item = ulvLicenses.Items.Add(licenses[i].ID.ToString(), licenses[i].ID.ToString()); item.SubItems[0].Value = licenses[i].LicenseID; item.SubItems[1].Value = licenses[i].Product; item.SubItems[2].Value = licenses[i].LicenseType; item.SubItems[3].Value = licenses[i].GeneratedBy; item.SubItems[4].Value = string.Format("{0} {1}", licenses[i].GeneratedTime.ToLongDateString(), licenses[i].GeneratedTime.ToShortTimeString()); } this.ulvLicenses.Focus(); }
private void loadForms() { ulvForms.Reset(); ulvForms.Width = 410; ulvForms.Height = 381; ulvForms.View = UltraListViewStyle.Details; ulvForms.ItemSettings.Appearance.Image = imageList1.Images[0]; ulvForms.ViewSettingsDetails.SubItemColumnsVisibleByDefault = true; ulvForms.ViewSettingsDetails.AutoFitColumns = AutoFitColumns.ResizeAllColumns; ulvForms.ItemSettings.SubItemsVisibleInToolTipByDefault = false; ulvForms.ItemSettings.SelectionType = SelectionType.Single; UltraListViewMainColumn mainColumn = ulvForms.MainColumn; mainColumn.Text = "Form Name"; mainColumn.Width = 120; mainColumn.DataType = typeof(System.Int32); UltraListViewSubItemColumn cDocType = new UltraListViewSubItemColumn(); cDocType.Text = "Type"; cDocType.Width = 50; cDocType.VisibleInDetailsView = DefaultableBoolean.True; cDocType.DataType = typeof(String); UltraListViewSubItemColumn cLastPrinted = new UltraListViewSubItemColumn(); cLastPrinted.Text = "Last Printed"; cLastPrinted.Width = 100; cLastPrinted.VisibleInDetailsView = DefaultableBoolean.True; cLastPrinted.DataType = typeof(String); UltraListViewSubItemColumn cDataEntryTemplate = new UltraListViewSubItemColumn(); cDataEntryTemplate.Text = "Data Entry Template"; cDataEntryTemplate.Width = 150; cDataEntryTemplate.VisibleInDetailsView = DefaultableBoolean.True; cDataEntryTemplate.DataType = typeof(Int32); ulvForms.SubItemColumns.Add(cDocType); ulvForms.SubItemColumns.Add(cLastPrinted); ulvForms.SubItemColumns.Add(cDataEntryTemplate); ValueList docType = new ValueList(); ValueList lastPrinted = new ValueList(); ValueList dataEntryTemplate = new ValueList(); foreach (VWA4Common.DataObject.Formx f in FormDAO.DAO.GetAll()) { docType.ValueListItems.Add(f.DocumentType, f.DocumentType); lastPrinted.ValueListItems.Add(f.LastPrintedDate, f.LastPrintedDate); if (f.DataEntryTemplateId > 0) { dataEntryTemplate.ValueListItems.Add(f.DataEntryTemplateId, VWA4Common.DB.Retrieve(string.Format("select DETName from DataEntryTemplates where ID={0}", f.DataEntryTemplateId)).Rows[0]["DETName"].ToString()); } UltraListViewItem i = ulvForms.Items.Add(f.Id.ToString(), f.Name); i.SubItems[0].Value = f.DocumentType; i.SubItems[1].Value = f.LastPrintedDate; i.SubItems[2].Value = f.DataEntryTemplateId > 0 ? f.DataEntryTemplateId.ToString() : ""; } ulvForms.SubItemColumns[0].ValueList = docType; ulvForms.SubItemColumns[1].ValueList = lastPrinted; ulvForms.SubItemColumns[2].ValueList = dataEntryTemplate; this.pnlForms.Controls.Add(ulvForms); }
public void Init() { updateProductUI(); // Load up the Listview // Set the control's View property to 'Details' ulvSessions.View = UltraListViewStyle.Details; // Set some properties so that SubItems (and their respective // columns) are visible by default in the views that support // columns, and also, make the column names and sub-item // values not appear in tooltips by default. ulvSessions.ViewSettingsDetails.SubItemColumnsVisibleByDefault = true; ulvSessions.ViewSettingsDetails.AutoFitColumns = AutoFitColumns.ResizeAllColumns; //ulvSessions.ViewSettingsTiles.SubItemsVisibleByDefault = true; ulvSessions.ItemSettings.SubItemsVisibleInToolTipByDefault = false; // Add columns in listview ulvSessions.MainColumn.Text = "Session ID"; ulvSessions.MainColumn.DataType = typeof(System.Int32); ulvSessions.MainColumn.Width = 65; UltraListViewSubItemColumn subItemColumn = null; subItemColumn = ulvSessions.SubItemColumns.Add("DataFromDate"); subItemColumn.DataType = typeof(System.DateTime); subItemColumn.Text = "Data From"; subItemColumn.HeaderAppearance.TextHAlign = HAlign.Center; subItemColumn.Width = 70; subItemColumn = ulvSessions.SubItemColumns.Add("SessionEnd"); subItemColumn.DataType = typeof(System.DateTime); subItemColumn.Text = "Last Entry"; subItemColumn.HeaderAppearance.TextHAlign = HAlign.Center; subItemColumn.Width = 70; subItemColumn = ulvSessions.SubItemColumns.Add("TransCount"); subItemColumn.DataType = typeof(System.Int32); subItemColumn.Text = "Transactions"; subItemColumn.HeaderAppearance.TextHAlign = HAlign.Center; subItemColumn.Width = 70; subItemColumn = ulvSessions.SubItemColumns.Add("User"); subItemColumn.DataType = typeof(System.String); subItemColumn.Text = "User"; subItemColumn.HeaderAppearance.TextHAlign = HAlign.Left; //subItemColumn = ulvSessions.SubItemColumns.Add("SessionNotes"); //subItemColumn.DataType = typeof(System.String); //subItemColumn.Text = "Session Notes"; // Get all manual data entry sessions and add them to list view control collection string sql = @"SELECT * FROM Transfers WHERE ManualDESession=TRUE ORDER BY Timestamp DESC"; DataTable dtsess = new DataTable(); dtsess = VWA4Common.DB.Retrieve(sql); foreach (DataRow row in dtsess.Rows) { string sessionID = row["TransKey"].ToString(); DateTime timestamp = DateTime.Parse(row["Timestamp"].ToString()); DateTime sessionend; DateTime.TryParse(row["SessionEnd"].ToString(), out sessionend); string username = ""; if (row["User"].ToString().Trim() != string.Empty) { string sql2 = @"SELECT TypeName FROM UserType WHERE TypeID = '" + row["User"].ToString() + "'"; DataTable dtuser = new DataTable(); dtuser = VWA4Common.DB.Retrieve(sql2); if (dtuser.Rows.Count > 0) { DataRow row2 = dtuser.Rows[0]; username = row2["TypeName"].ToString(); } } string sql3 = @"SELECT COUNT(*) FROM Weights WHERE TransKey=" + sessionID.ToString(); DataTable dttrans = new DataTable(); dttrans = VWA4Common.DB.Retrieve(sql3); string sessionnotes = row["SessionNotes"].ToString(); UltraListViewItem item = ulvSessions.Items.Add(sessionID, sessionID); item.SubItems["DataFromDate"].Value = timestamp; item.SubItems["DataFromDate"].Appearance.TextHAlign = HAlign.Center; item.SubItems["SessionEnd"].Value = sessionend; item.SubItems["SessionEnd"].Appearance.TextHAlign = HAlign.Center; item.SubItems["TransCount"].Value = int.Parse(dttrans.Rows[0][0].ToString()); item.SubItems["TransCount"].Appearance.TextHAlign = HAlign.Center; item.SubItems["User"].Value = username; //item.SubItems["SessionNotes"].Value = sessionnotes; } }