public FormBugListView(IBugService svc, ISingleBugViewPresenter sbPres, [Named("ViewSettings")]ISettingsOriginator viewSettings) { InitializeComponent(); _presenter = new BugListViewPresenter(this, svc); _singleBugPresenter = sbPres; _viewSettings = viewSettings; SelectedBugs = new ObservableCollection<IBug>(); Projects = new List<IProject>(); CommandToApply = new YouTrackCommand() { DisableNotifications = false }; comboBoxProject.DataSource = bindingSourceProjects; //Set up grid dataGridViewBugs.Columns.Add(new DataGridViewCheckBoxColumn() { ReadOnly = false, AutoSizeMode = DataGridViewAutoSizeColumnMode.None, Resizable = DataGridViewTriState.False, Width = 20 }); dataGridViewBugs.Columns.Add(new DataGridViewTextBoxColumn() { DataPropertyName = "ID", ReadOnly = true, Resizable = DataGridViewTriState.True }); dataGridViewBugs.Columns.Add(new DataGridViewTextBoxColumn() { DataPropertyName = "Summary", ReadOnly = true, Resizable = DataGridViewTriState.True }); dataGridViewBugs.Columns.Add(new DataGridViewTextBoxColumn() { DataPropertyName = "Description", ReadOnly = true, Resizable = DataGridViewTriState.True, AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill }); _linkCol = new DataGridViewLinkColumn() { LinkBehavior = LinkBehavior.NeverUnderline, UseColumnTextForLinkValue = true, Text = "view", ReadOnly = true, Resizable = DataGridViewTriState.False, Width = 50, DefaultCellStyle = new DataGridViewCellStyle(dataGridViewBugs.DefaultCellStyle) { Alignment = DataGridViewContentAlignment.MiddleCenter } }; dataGridViewBugs.Columns.Add(_linkCol); dataGridViewBugs.CellContentClick += new DataGridViewCellEventHandler(dataGridViewBugs_CellContentClick); bindingSourceProjects.CurrentChanged += (s, ea) => { if (!bindingSourceProjects.IsBindingSuspended) SelectedProject = bindingSourceProjects.Current as IProject; }; comboBoxPage.SelectedIndexChanged += (s, ea) => UpdatePage(); comboBoxPage.KeyUp += (s, ea) => { if (ea.KeyCode == Keys.Enter) UpdatePage(); }; bindingSourceBugs.DataSourceChanged += new EventHandler(bindingSourceBugs_DataSourceChanged); SelectedBugs.CollectionChanged += (s, ea) => labelSelected.Text = String.Format("Selected: {0}", SelectedBugs.Count); checkBoxApplyCommand.CheckStateChanged += (s, ea) => { _applyCommand = checkBoxApplyCommand.Checked; }; textBoxCommand.TextChanged += (s, ea) => { _commandToApply.Command = textBoxCommand.Text; }; }
private void BindGrid() { try { DAL.DataClasses1DataContext objdal=new DAL.DataClasses1DataContext(); dataGridView1.DataSource = from c in objdal.Videos select c; //hide navigation column dataGridView1.Columns[0].ReadOnly = true; //make the id column read only //add new button column to the DataGridView //This column displays a delete icon in each row DataGridViewLinkColumn delbut = new DataGridViewLinkColumn(); delbut.Width = 20; delbut.Text = "Add/Update"; delbut.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; delbut.UseColumnTextForLinkValue = true; dataGridView1.Columns.Add(delbut); DataGridViewLinkColumn Update = new DataGridViewLinkColumn(); Update.Width = 20; Update.Text = "Delete"; Update.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; Update.UseColumnTextForLinkValue = true; dataGridView1.Columns.Add(Update); } catch (Exception exp) { MessageBox.Show(exp.Message); } }
private void BindDataGridView3Column() { //this.DepartmentCanBoundary; this.dataGridView1.AutoGenerateColumns = false; DataGridViewLinkColumn modify = new DataGridViewLinkColumn(); modify.Text = "修改"; modify.Name = "LinkModify"; modify.HeaderText = "修改"; modify.UseColumnTextForLinkValue = true; this.dataGridView3.Columns.Add(modify); this.dataGridView1.AutoGenerateColumns = false; DataGridViewLinkColumn resetPwd = new DataGridViewLinkColumn(); resetPwd.Text = "重置密码"; resetPwd.Name = "LinkResetPwd"; resetPwd.HeaderText = "重置密码"; resetPwd.UseColumnTextForLinkValue = true; this.dataGridView3.Columns.Add(resetPwd); this.dataGridView1.AutoGenerateColumns = false; DataGridViewLinkColumn delete = new DataGridViewLinkColumn(); delete.Text = "删除"; delete.Name = "LinkDelete"; delete.HeaderText = "删除"; delete.UseColumnTextForLinkValue = true; this.dataGridView3.Columns.Add(delete); }
private void btnAdd_Click(object sender, EventArgs e) { frmWithdrawalDetail frm = new frmWithdrawalDetail(); frm.ShowDialog(); DialogResult result = frm.ShowDialog(this); if (result == DialogResult.OK) { Withdrawal s = new Withdrawal(); s.AvailableStock = frm.AvailableStock; s.ItemId = frm.ItemId; s.ItemName = frm.ItemName; s.SubTotal = frm.SubTotal; s.Quatity = frm.Quatity; dgvData.ColumnCount = 5; dgvData.Columns[0].Name = "Item ID"; dgvData.Columns[1].Name = "Item Name"; dgvData.Columns[2].Name = "Item Quantity"; dgvData.Columns[3].Name = "Item Price"; dgvData.Columns[4].Name = "Sub Total"; string[] row = new string[] { s.ItemId.ToString(), s.ItemName, s.Quatity.ToString(), "", s.SubTotal.ToString() }; dgvData.Rows.Add(row); //row = new string[] { "2", "Product 2", "2000" }; //dgvData.Rows.Add(row); //row = new string[] { "3", "Product 3", "3000" }; //dgvData.Rows.Add(row); //row = new string[] { "4", "Product 4", "4000" }; //dgvData.Rows.Add(row); //DataGridViewCheckBoxColumn chk = new DataGridViewCheckBoxColumn(); //dgvData.Columns.Add(chk); //chk.HeaderText = "Check Data"; //chk.Name = "chk"; //dgvData.Rows[2].Cells[3].Value = true; DataGridViewLinkColumn Editlink = new DataGridViewLinkColumn(); Editlink.UseColumnTextForLinkValue = true; Editlink.HeaderText = "Edit"; Editlink.DataPropertyName = "lnkColumn"; Editlink.LinkBehavior = LinkBehavior.SystemDefault; Editlink.Text = "Edit"; dgvData.Columns.Add(Editlink); DataGridViewLinkColumn Deletelink = new DataGridViewLinkColumn(); Deletelink.UseColumnTextForLinkValue = true; Deletelink.HeaderText = "delete"; Deletelink.DataPropertyName = "lnkColumn"; Deletelink.LinkBehavior = LinkBehavior.SystemDefault; Deletelink.Text = "Delete"; dgvData.Columns.Add(Deletelink); } else { } //frm.Dispose(); }
public void bindClientList() { ClientManager cl = new ClientManager(); DataSet ds = cl.getClientList(); if (ds.Tables[0].Rows.Count > 0) { ClientGrid.AutoGenerateColumns = false; ClientGrid.DataSource = null; //Set Columns Count ClientGrid.ColumnCount = 6; //Add Columns ClientGrid.Columns[0].Name = "ClientID"; ClientGrid.Columns[0].HeaderText = "Client ID"; ClientGrid.Columns[0].DataPropertyName = "ClientID"; ClientGrid.Columns[1].HeaderText = "Client Name"; ClientGrid.Columns[1].Name = "ClientName"; ClientGrid.Columns[1].DataPropertyName = "ClientName"; ClientGrid.Columns[2].Name = "LocationID"; ClientGrid.Columns[2].HeaderText = "Location ID"; ClientGrid.Columns[2].DataPropertyName = "LocationID"; ClientGrid.Columns[3].Name = "ClientEmail"; ClientGrid.Columns[3].HeaderText = "Client Email"; ClientGrid.Columns[3].DataPropertyName = "ClientEmail"; ClientGrid.Columns[4].Name = "ClientPhoneNo"; ClientGrid.Columns[4].HeaderText = "Contac No"; ClientGrid.Columns[4].DataPropertyName = "ClientPhoneNo"; ClientGrid.Columns[5].Name = "ClientAddress"; ClientGrid.Columns[5].HeaderText = "Client Address"; ClientGrid.Columns[5].DataPropertyName = "ClientAddress"; ClientGrid.DataSource = ds.Tables[0]; DataGridViewLinkColumn Editlink = new DataGridViewLinkColumn(); Editlink.UseColumnTextForLinkValue = true; Editlink.HeaderText = "Edit"; Editlink.DataPropertyName = "lnkForEditColumn"; Editlink.LinkBehavior = LinkBehavior.SystemDefault; Editlink.Text = "Edit"; ClientGrid.Columns.Add(Editlink); DataGridViewLinkColumn Deletelink = new DataGridViewLinkColumn(); Deletelink.UseColumnTextForLinkValue = true; Deletelink.HeaderText = "delete"; Deletelink.DataPropertyName = "lnkForDeleteColumn"; Deletelink.LinkBehavior = LinkBehavior.SystemDefault; Deletelink.Text = "Delete"; ClientGrid.Columns.Add(Deletelink); //DataGridViewButtonColumn db = new DataGridViewButtonColumn(); //db.Text = "Delete"; //ClientGrid.Columns.Insert(6, (DataGridViewColumn)db); } }
public void bindIncomeGrid() { IncomeDetailManager cl = new IncomeDetailManager(); DataSet ds = cl.ListIncomeDetails(); if (ds.Tables[0].Rows.Count > 0) { IncomeDetailGrid.AutoGenerateColumns = false; IncomeDetailGrid.DataSource = null; //Set Columns Count IncomeDetailGrid.ColumnCount = 6; //Add Columns IncomeDetailGrid.Columns[0].Name = "TransactionID"; IncomeDetailGrid.Columns[0].HeaderText = "Transaction ID"; IncomeDetailGrid.Columns[0].DataPropertyName = "TransactionID"; IncomeDetailGrid.Columns[1].HeaderText = "Name"; IncomeDetailGrid.Columns[1].Name = "Name"; IncomeDetailGrid.Columns[1].DataPropertyName = "Name"; IncomeDetailGrid.Columns[2].Name = "LocationID"; IncomeDetailGrid.Columns[2].HeaderText = "Location"; IncomeDetailGrid.Columns[2].DataPropertyName = "LocationID"; IncomeDetailGrid.Columns[3].Name = "Date"; IncomeDetailGrid.Columns[3].HeaderText = "Date"; IncomeDetailGrid.Columns[3].DataPropertyName = "Date"; IncomeDetailGrid.Columns[4].Name = "Amount"; IncomeDetailGrid.Columns[4].HeaderText = "Amount"; IncomeDetailGrid.Columns[4].DataPropertyName = "Amount"; IncomeDetailGrid.Columns[5].Name = "Note"; IncomeDetailGrid.Columns[5].HeaderText = "Note"; IncomeDetailGrid.Columns[5].DataPropertyName = "Note"; IncomeDetailGrid.DataSource = ds.Tables[0]; DataGridViewLinkColumn Editlink = new DataGridViewLinkColumn(); Editlink.UseColumnTextForLinkValue = true; Editlink.HeaderText = "Edit"; Editlink.DataPropertyName = "lnkForEditColumn"; Editlink.LinkBehavior = LinkBehavior.SystemDefault; Editlink.Text = "Edit"; IncomeDetailGrid.Columns.Add(Editlink); DataGridViewLinkColumn Deletelink = new DataGridViewLinkColumn(); Deletelink.UseColumnTextForLinkValue = true; Deletelink.HeaderText = "delete"; Deletelink.DataPropertyName = "lnkForDeleteColumn"; Deletelink.LinkBehavior = LinkBehavior.SystemDefault; Deletelink.Text = "Delete"; IncomeDetailGrid.Columns.Add(Deletelink); //DataGridViewButtonColumn db = new DataGridViewButtonColumn(); //db.Text = "Delete"; //IncomeDetailGrid.Columns.Insert(6, (DataGridViewColumn)db); } }
public iGrid() : base() { this.AllRows = new List<object[]>(); this.colBorrar = new DataGridViewLinkColumn(); this.colEditar = new DataGridViewLinkColumn(); this.ActualPage = 0; this.RowsPerPage = 10; this.FormatGrid(); }
private DataGridViewColumn MakeColumn(int documentIndex) { DataGridViewColumn col = new DataGridViewLinkColumn(); col.HeaderText = "文件名稱" + documentIndex; col.Name = "document" + documentIndex; col.Width = 60; col.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft; col.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; return col; }
public void bindBuildingGrid() { BuildingManager b = new BuildingManager(); DataSet ds = b.listBuildingbyLocation(LocationID); if (ds.Tables[0].Rows.Count > 0) { BuildingGrid.AutoGenerateColumns = false; BuildingGrid.DataSource = null; //Set Columns Count BuildingGrid.ColumnCount = 3; //Add Columns BuildingGrid.Columns[0].Name = "BuildingID"; BuildingGrid.Columns[0].HeaderText = "BuildingID"; BuildingGrid.Columns[0].DataPropertyName = "BuildingID"; BuildingGrid.Columns[1].HeaderText = "Building Name"; BuildingGrid.Columns[1].Name = "BuildingName"; BuildingGrid.Columns[1].DataPropertyName = "BuildingName"; BuildingGrid.Columns[2].Name = "BuildingDescription"; BuildingGrid.Columns[2].HeaderText = "Building Description"; BuildingGrid.Columns[2].DataPropertyName = "BuildingDescription"; BuildingGrid.DataSource = ds.Tables[0]; //Buttons DataGridViewLinkColumn Editlink = new DataGridViewLinkColumn(); Editlink.UseColumnTextForLinkValue = true; Editlink.HeaderText = "Edit"; Editlink.DataPropertyName = "lnkForEditColumn"; Editlink.LinkBehavior = LinkBehavior.SystemDefault; Editlink.Text = "Edit"; BuildingGrid.Columns.Add(Editlink); DataGridViewLinkColumn Deletelink = new DataGridViewLinkColumn(); Deletelink.UseColumnTextForLinkValue = true; Deletelink.HeaderText = "delete"; Deletelink.DataPropertyName = "lnkForDeleteColumn"; Deletelink.LinkBehavior = LinkBehavior.SystemDefault; Deletelink.Text = "Delete"; BuildingGrid.Columns.Add(Deletelink); DataGridViewLinkColumn AddBuilding = new DataGridViewLinkColumn(); AddBuilding.UseColumnTextForLinkValue = true; AddBuilding.HeaderText = "Add Flats"; AddBuilding.DataPropertyName = "lnkForFlatsColumn"; AddBuilding.LinkBehavior = LinkBehavior.SystemDefault; AddBuilding.Text = "Add Flats"; BuildingGrid.Columns.Add(AddBuilding); } }
private void FormatDgv() { if (dgvMain.Columns.Contains("KeyID")) dgvMain.Columns["KeyID"].Visible = false; if (dgvMain.Columns.Contains("sPassword")) dgvMain.Columns["sPassword"].Visible = false; if (dgvMain.Columns.Contains("LastUpdate")) dgvMain.Columns["LastUpdate"].Visible = false; if (dgvMain.Columns.Contains("sUserName")) { dgvMain.Columns["sUserName"].HeaderText = "用户名"; } if (dgvMain.Columns.Contains("sLoginName")) { dgvMain.Columns["sLoginName"].HeaderText = "登录名"; } if (dgvMain.Columns.Contains("IsEnable")) { dgvMain.Columns["IsEnable"].HeaderText = "是否启用"; } if (!dgvMain.Columns.Contains("编辑")) { DataGridViewLinkColumn dlc = new DataGridViewLinkColumn(); dlc.HeaderText = "编辑"; dlc.Name = "编辑"; dgvMain.Columns.Add(dlc); } //if (!dgvMain.Columns.Contains("禁用")) //{ // DataGridViewLinkColumn dlc = new DataGridViewLinkColumn(); // dlc.HeaderText = "禁用"; // dlc.Name = "禁用"; // dgvMain.Columns.Add(dlc); //} if (dgvMain.Columns.Contains("编辑")) { for (int i = 0; i < dgvMain.RowCount; i++) { dgvMain.Rows[i].Cells["编辑"].Value = "编辑"; //dgvMain.Rows[i].Cells["禁用"].Value = "禁用"; } } CommonFunc.FormatDGVWithBg(dgvMain); }
public void bindLocation() { LocationManager ls = new LocationManager(); DataSet ds = ls.ListLocations(); if (ds.Tables[0].Rows.Count > 0) { LocationGrid.AutoGenerateColumns = false; LocationGrid.DataSource = null; //Set Columns Count LocationGrid.ColumnCount = 3; //Add Columns LocationGrid.Columns[0].Name = "Id"; LocationGrid.Columns[0].HeaderText = "Id"; LocationGrid.Columns[0].DataPropertyName = "id"; LocationGrid.Columns[1].HeaderText = "Location Name"; LocationGrid.Columns[1].Name = "LocationName"; LocationGrid.Columns[1].DataPropertyName = "LocationName"; LocationGrid.Columns[2].Name = "Address"; LocationGrid.Columns[2].HeaderText = "Location Address"; LocationGrid.Columns[2].DataPropertyName = "LocationAddress"; LocationGrid.DataSource = ds.Tables[0]; //Buttons DataGridViewLinkColumn Editlink = new DataGridViewLinkColumn(); Editlink.UseColumnTextForLinkValue = true; Editlink.HeaderText = "Edit"; Editlink.DataPropertyName = "lnkForEditColumn"; Editlink.LinkBehavior = LinkBehavior.SystemDefault; Editlink.Text = "Edit"; LocationGrid.Columns.Add(Editlink); DataGridViewLinkColumn Deletelink = new DataGridViewLinkColumn(); Deletelink.UseColumnTextForLinkValue = true; Deletelink.HeaderText = "delete"; Deletelink.DataPropertyName = "lnkForDeleteColumn"; Deletelink.LinkBehavior = LinkBehavior.SystemDefault; Deletelink.Text = "Delete"; LocationGrid.Columns.Add(Deletelink); DataGridViewLinkColumn AddBuilding = new DataGridViewLinkColumn(); AddBuilding.UseColumnTextForLinkValue = true; AddBuilding.HeaderText = "Add Building"; AddBuilding.DataPropertyName = "lnkForBuildingColumn"; AddBuilding.LinkBehavior = LinkBehavior.SystemDefault; AddBuilding.Text = "Add Building"; LocationGrid.Columns.Add(AddBuilding); } }
public void bindFlatGrid() { FlatManager f = new FlatManager(); DataSet ds = f.ListFlats(BuildingID); if (ds.Tables[0].Rows.Count > 0) { FlatGrid.AutoGenerateColumns = false; FlatGrid.DataSource = null; //Set Columns Count FlatGrid.ColumnCount = 3; //Add Columns FlatGrid.Columns[0].Name = "Id"; FlatGrid.Columns[0].HeaderText = "Id"; FlatGrid.Columns[0].DataPropertyName = "FlatID"; FlatGrid.Columns[1].HeaderText = "FlatNo"; FlatGrid.Columns[1].Name = "FlatNo"; FlatGrid.Columns[1].DataPropertyName = "FlatNo"; FlatGrid.Columns[2].Name = "Price"; FlatGrid.Columns[2].HeaderText = "Price"; FlatGrid.Columns[2].DataPropertyName = "Price"; FlatGrid.DataSource = ds.Tables[0]; //Buttons DataGridViewLinkColumn Editlink = new DataGridViewLinkColumn(); Editlink.UseColumnTextForLinkValue = true; Editlink.HeaderText = "Edit"; Editlink.DataPropertyName = "lnkForEditColumn"; Editlink.LinkBehavior = LinkBehavior.SystemDefault; Editlink.Text = "Edit"; FlatGrid.Columns.Add(Editlink); DataGridViewLinkColumn Deletelink = new DataGridViewLinkColumn(); Deletelink.UseColumnTextForLinkValue = true; Deletelink.HeaderText = "delete"; Deletelink.DataPropertyName = "lnkForDeleteColumn"; Deletelink.LinkBehavior = LinkBehavior.SystemDefault; Deletelink.Text = "Delete"; FlatGrid.Columns.Add(Deletelink); DataGridViewLinkColumn AddBuilding = new DataGridViewLinkColumn(); AddBuilding.UseColumnTextForLinkValue = true; AddBuilding.HeaderText = "Sell"; AddBuilding.DataPropertyName = "lnkForSellColumn"; AddBuilding.LinkBehavior = LinkBehavior.SystemDefault; AddBuilding.Text = "Sell"; FlatGrid.Columns.Add(AddBuilding); } }
public void bindCategory() { CategoryManager cs = new CategoryManager(); DataSet ds = cs.listAllCategory(); if (ds.Tables[0].Rows.Count > 0) { CategoryGrid.AutoGenerateColumns = false; CategoryGrid.DataSource = null; //Set Columns Count CategoryGrid.ColumnCount = 4; //Add Columns CategoryGrid.Columns[0].Name = "Id"; CategoryGrid.Columns[0].HeaderText = "Id"; CategoryGrid.Columns[0].DataPropertyName = "CategoryID"; CategoryGrid.Columns[1].HeaderText = "Category Name"; CategoryGrid.Columns[1].Name = "CategoryName"; CategoryGrid.Columns[1].DataPropertyName = "CategoryName"; CategoryGrid.Columns[2].Name = "Description"; CategoryGrid.Columns[2].HeaderText = "Category Description"; CategoryGrid.Columns[2].DataPropertyName = "CategoryDesc"; CategoryGrid.Columns[3].Name = "CategoryType"; CategoryGrid.Columns[3].HeaderText = "Category Type"; CategoryGrid.Columns[3].DataPropertyName = "CategoryType"; CategoryGrid.DataSource = ds.Tables[0]; //Buttons DataGridViewLinkColumn Editlink = new DataGridViewLinkColumn(); Editlink.UseColumnTextForLinkValue = true; Editlink.HeaderText = "Edit"; Editlink.DataPropertyName = "lnkForEditColumn"; Editlink.LinkBehavior = LinkBehavior.SystemDefault; Editlink.Text = "Edit"; CategoryGrid.Columns.Add(Editlink); DataGridViewLinkColumn Deletelink = new DataGridViewLinkColumn(); Deletelink.UseColumnTextForLinkValue = true; Deletelink.HeaderText = "delete"; Deletelink.DataPropertyName = "lnkForDeleteColumn"; Deletelink.LinkBehavior = LinkBehavior.SystemDefault; Deletelink.Text = "Delete"; CategoryGrid.Columns.Add(Deletelink); //DataGridViewButtonColumn db = new DataGridViewButtonColumn(); //db.Text = "Delete"; //CategoryGrid.Columns.Insert(4, (DataGridViewColumn)db); } }
public void LinkTest() { SWF.DataGridViewLinkColumn column = new SWF.DataGridViewLinkColumn(); column.HeaderText = "Link Column"; SWF.DataGridViewLinkCell cell = new SWF.DataGridViewLinkCell(); cell.Value = "Link cell 1"; SWF.DataGridViewLinkCell cell1 = new SWF.DataGridViewLinkCell(); cell1.Value = "Link cell 2"; ColumnCellTest(column, cell, false, cell1); }
public void LinkTest () { SWF.DataGridViewLinkColumn column = new SWF.DataGridViewLinkColumn (); column.HeaderText = "Link Column"; SWF.DataGridViewLinkCell cell = new SWF.DataGridViewLinkCell (); cell.Value = "Link cell 1"; SWF.DataGridViewLinkCell cell1 = new SWF.DataGridViewLinkCell (); cell1.Value = "Link cell 2"; ColumnCellTest (column, cell, false, cell1); }
//code ends public MealEntryUI() { InitializeComponent(); //This code is for the delete and edit options in datagridview //code starts from here DataGridViewLinkColumn Deletelink = new DataGridViewLinkColumn(); Deletelink.UseColumnTextForLinkValue = true; Deletelink.HeaderText = "Delete"; Deletelink.DataPropertyName = "lnkColumn"; Deletelink.LinkBehavior = LinkBehavior.SystemDefault; Deletelink.Text = "Delete"; mealEntryInfoDataGridView.Columns.Add(Deletelink); //code end }
public static DataGridViewLinkColumn createDgvLinkColumn(String dataPropertyName, String headerText, Type valueType, int width, bool visible) { DataGridViewLinkColumn column = new DataGridViewLinkColumn(); column.DataPropertyName = dataPropertyName; column.Name = dataPropertyName; //column.UseColumnTextForLinkValue = true; //column.HeaderText = headerText; //column.ValueType = valueType; column.Width = width; //column.Frozen = true; column.Visible = visible; column.ReadOnly = true; return column; }
public void FilldgvComments() { // set dgvComments up dgvComments.Rows.Clear(); dgvComments.RowHeadersVisible = false; dgvComments.ColumnHeadersVisible = false; //set the first column of dgvComments to delete DataGridViewLinkColumn del = new DataGridViewLinkColumn(); dgvComments.Columns.Add(del); del.Text = "Delete"; del.Name = "del"; del.UseColumnTextForLinkValue = true; //set the databound columns of dgvComments dgvComments.ColumnCount = 5; dgvComments.Columns[1].Name = "DateAdded"; dgvComments.Columns[2].Name = "Text"; dgvComments.Columns[3].Name = "Username"; dgvComments.Columns[4].Name = "Comment Id"; dgvComments.Columns[4].Visible = false; //Fill list with comments then bind to rows of dgvComments comments = service.ViewComments(jobId); string[] row = new string[] { }; for (int i = 0; i < comments.Count; i++ ) { row = new string[] { "Delete", comments[i].DateAdded.ToString(), comments[i].Text, comments[i].Username, comments[i].CommentId.ToString()}; dgvComments.Rows.Add(row); // allow text wrapping for comment text dgvComments.Columns[2].DefaultCellStyle.WrapMode = DataGridViewTriState.True; dgvComments.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells; dgvComments.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells; } dgvComments.CellBorderStyle = DataGridViewCellBorderStyle.None; dgvComments.BorderStyle = BorderStyle.None; dgvComments.AllowUserToAddRows = false; dgvComments.Columns[2].Width = 400; // set selection to same colour as background dgvComments.DefaultCellStyle.SelectionBackColor = dgvComments.DefaultCellStyle.BackColor; dgvComments.DefaultCellStyle.SelectionForeColor = dgvComments.DefaultCellStyle.ForeColor; }
public DataGridViewLinkColumn AddLinkColumn(string sColumnName, string sHeader, bool bIsVisible, int nPosition) { DataGridViewLinkColumn column = new DataGridViewLinkColumn(); column.UseColumnTextForLinkValue = true; column.HeaderText = sHeader; column.Name = sColumnName; column.ActiveLinkColor = System.Drawing.Color.White; column.LinkBehavior = LinkBehavior.SystemDefault; column.LinkColor = System.Drawing.Color.Blue; column.TrackVisitedState = true; column.VisitedLinkColor = System.Drawing.Color.YellowGreen; column.Visible = bIsVisible; column.DisplayIndex = nPosition; column.DataPropertyName = sColumnName; return column; }
private void Button25_Click(object sender, EventArgs e) { DataGridViewLinkColumn x = new DataGridViewLinkColumn(); x.HeaderText = "xxx"; x.Text = "xxx"; x.UseColumnTextForLinkValue = true; this.dataGridView7.Columns.Add(x); //====================== DataGridViewTextBoxColumn y = new DataGridViewTextBoxColumn(); y.HeaderText = "ProductName"; y.DataPropertyName = "ProductName"; this.dataGridView7.Columns.Add(y); }
internal void Initialize(MetaType metaType, Siaqodb siaqodb, List <Sqo.MetaType> typesList, List <int> oidsFiltered) { this.metaType = metaType; this.siaqodb = siaqodb; this.typesList = typesList; if (oidsFiltered == null) { oids = siaqodb.LoadAllOIDs(metaType); } else { oids = oidsFiltered; } if (oids == null) { MessageBox.Show("FileName of this Type has not default name of siaqodb database file!"); } dataGridView1.Columns.Clear(); dataGridView1.Columns.Add("OID", "OID"); foreach (MetaField f in metaType.Fields) { if (typeof(IList).IsAssignableFrom(f.FieldType)) { System.Windows.Forms.DataGridViewLinkColumn column = new System.Windows.Forms.DataGridViewLinkColumn(); column.Name = f.Name; column.HeaderText = f.Name; column.ValueType = f.FieldType; dataGridView1.Columns.Add(column); } else if (f.FieldType == null)//complex type { System.Windows.Forms.DataGridViewLinkColumn column = new System.Windows.Forms.DataGridViewLinkColumn(); column.Name = f.Name; column.HeaderText = f.Name; column.ValueType = typeof(string); dataGridView1.Columns.Add(column); } else { dataGridView1.Columns.Add(f.Name, f.Name); } } }
public override object Clone() { DataGridViewLinkColumn column; System.Type type = base.GetType(); if (type == columnType) { column = new DataGridViewLinkColumn(); } else { column = (DataGridViewLinkColumn) Activator.CreateInstance(type); } if (column != null) { base.CloneInternal(column); column.Text = this.text; } return column; }
private static DataGridViewLinkColumn GetPrintButton() { var print = new System.Windows.Forms.DataGridViewLinkColumn(); print.Text = "Print"; print.Name = "Print"; print.UseColumnTextForLinkValue = true; print.LinkBehavior = LinkBehavior.SystemDefault; print.HeaderText = "Print"; print.Name = "Print"; // print.DefaultCellStyle.Font = new Font(FontFamily.GenericSansSerif, 8.00f); print.LinkColor = Color.Blue; print.TrackVisitedState = true; print.Text = "Print"; print.UseColumnTextForLinkValue = true; return(print); }
private void FormHyperlinks_Load(object sender, EventArgs e) { DataTable dt = new DataTable(); dt.Columns.Add("prva"); dt.Columns.Add("druga"); dt.Rows.Add(1, "aaaaaaaaaaaaaaaaaa"); dt.Rows.Add(2, "bbbbbbbbbbbbbbbb"); dt.Rows.Add(3, "cccccccccccccccc"); dataGridView1.DataSource = dt; DataGridViewLinkColumn col = new DataGridViewLinkColumn(); //col.UseColumnTextForLinkValue = true; //col.HeaderText = "linkam"; //col.DataPropertyName = "druga"; //col.ActiveLinkColor = Color.White; //col.LinkBehavior = LinkBehavior.SystemDefault; //col.LinkColor = Color.Blue; //col.TrackVisitedState = true; //col.VisitedLinkColor = Color.YellowGreen; const int COLNUM = 1; col.Name = "MoNoLinkLabel"; col.HeaderText = "MO No"; col.Text = "prva"; col.DataPropertyName = dataGridView1.Columns[COLNUM].DataPropertyName; // datatable column name //col.Width = 90; col.LinkColor = Color.MediumBlue; //SystemColors.WindowText; col.LinkBehavior = LinkBehavior.HoverUnderline; //col.ActiveLinkColor = Color.White; //col.VisitedLinkColor = Color.Purple; col.TrackVisitedState = false; col.SortMode = DataGridViewColumnSortMode.Automatic; // bez ovoga kolona nije sortabilna za korisnika col.DisplayIndex = COLNUM; // određuje poredak te kolone //dataGridView1.Columns[COLNUM].Visible = false; // skrivamo kolonu koju smo zamijenili dataGridView1.Columns.Add(col); //namjerno skrivam i kolonu "prva" u kojoj je id //dataGridView1.Columns["prva"].Visible = false; }
public FileSystemDataGridView() { if (Program.IsRuntime) { this.BackgroundColor = Color.White; this.ColumnHeadersVisible = false; this.RowHeadersVisible = false; this.AllowUserToResizeRows = false; this.AllowUserToResizeColumns = false; this.GridColor = Color.FromKnownColor(KnownColor.ControlLight); DataGridViewImageColumn imageColumn = new DataGridViewImageColumn(false); imageColumn.Width = 20; imageColumn.ValuesAreIcons = false; imageColumn.Image = Resources.browse_document; imageColumn.AutoSizeMode = DataGridViewAutoSizeColumnMode.None; DataGridViewTextBoxColumn textBoxColumn = new DataGridViewTextBoxColumn(); textBoxColumn.Width = 50; textBoxColumn.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; DataGridViewLinkColumn browseColumn = new DataGridViewLinkColumn(); browseColumn.TrackVisitedState = false; browseColumn.Width = 65; browseColumn.AutoSizeMode = DataGridViewAutoSizeColumnMode.None; DataGridViewLinkColumn delColumn = new DataGridViewLinkColumn(); delColumn.TrackVisitedState = false; delColumn.Width = 65; delColumn.AutoSizeMode = DataGridViewAutoSizeColumnMode.None; this.Columns.Add(imageColumn); this.Columns.Add(textBoxColumn); this.Columns.Add(browseColumn); this.Columns.Add(delColumn); this.Rows.Clear(); this.CurrentCell = this[1, 0]; } }
//code ends public BazarCostEntryUI() { InitializeComponent(); amountTextBox.ForeColor = Color.LightGray; amountTextBox.Text = @"Please Enter Amount"; this.amountTextBox.Leave += new System.EventHandler(this.amountTextBox_Leave); this.amountTextBox.Enter += new System.EventHandler(this.amountTextBox_Enter); //This code is for the delete and edit options in datagridview //code starts from here DataGridViewLinkColumn Deletelink = new DataGridViewLinkColumn(); Deletelink.UseColumnTextForLinkValue = true; Deletelink.HeaderText = "Delete"; Deletelink.DataPropertyName = "lnkColumn"; Deletelink.LinkBehavior = LinkBehavior.SystemDefault; Deletelink.Text = "Delete"; bazarCostDataGridView.Columns.Add(Deletelink); //code end }
//code ends public MemberCodeEntryUI() { InitializeComponent(); //This code is for watermask textbox memberNameTextBox.ForeColor = Color.LightGray; memberNameTextBox.Text = @"Please Enter Name"; this.memberNameTextBox.Leave += new System.EventHandler(this.memberNameTextBox_Leave); this.memberNameTextBox.Enter += new System.EventHandler(this.memberNameTextBox_Enter); roomNoTextBox.ForeColor = Color.LightGray; roomNoTextBox.Text = @"Please Enter Room Number"; this.roomNoTextBox.Leave += new System.EventHandler(this.roomNoTextBox_Leave); this.roomNoTextBox.Enter += new System.EventHandler(this.roomNoTextBox_Enter); addressTextBox.ForeColor = Color.LightGray; addressTextBox.Text = @"Please Enter Address"; this.addressTextBox.Leave += new System.EventHandler(this.addressTextBox_Leave); this.addressTextBox.Enter += new System.EventHandler(this.addressTextBox_Enter); //code ends here //This code is for the delete and edit options in datagridview //code starts from here DataGridViewLinkColumn Editlink = new DataGridViewLinkColumn(); Editlink.UseColumnTextForLinkValue = true; Editlink.HeaderText = "Edit"; Editlink.DataPropertyName = "lnkColumn"; Editlink.LinkBehavior = LinkBehavior.SystemDefault; Editlink.Text = "Edit"; memberCodeDataGridView.Columns.Add(Editlink); DataGridViewLinkColumn Deletelink = new DataGridViewLinkColumn(); Deletelink.UseColumnTextForLinkValue = true; Deletelink.HeaderText = "Delete"; Deletelink.DataPropertyName = "lnkColumn"; Deletelink.LinkBehavior = LinkBehavior.SystemDefault; Deletelink.Text = "Delete"; memberCodeDataGridView.Columns.Add(Deletelink); //code end }
public Yj_CJ_Input() { InitializeComponent(); this.Caption = "城建档案原件挂接"; this.Text = "城建档案原件挂接"; this.IsStop = false; dgvResult = new UIPublicClass.UserContorls.CustomDataGridView(); tclmZDJH = new DataGridViewTextBoxColumn(); tclmPath = new DataGridViewTextBoxColumn(); tclmArchive = new DataGridViewTextBoxColumn(); lclmResult = new DataGridViewLinkColumn(); dgvResult.Dock = DockStyle.Fill; dgvResult.AllowUserToAddRows = false; dgvResult.AllowUserToDeleteRows = false; dgvResult.ReadOnly = true; dgvResult.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { tclmZDJH, tclmPath, tclmArchive, lclmResult }); this.tclmZDJH.HeaderText = "总登记号"; this.tclmZDJH.Name = "总登记号"; this.tclmZDJH.Width = 70; this.tclmPath.HeaderText = "扫描件"; this.tclmPath.Name = "扫描件"; this.tclmPath.Width = 150; this.tclmArchive.HeaderText = "档案信息"; this.tclmArchive.Name = "档案信息"; this.tclmArchive.Width = 190; this.lclmResult.HeaderText = "校验结果"; this.lclmResult.Name = "校验结果"; this.lclmResult.Width = 70; pnlDgv.Controls.Add(dgvResult); dgvResult.CellClick += new DataGridViewCellEventHandler(dgvResult_CellClick); }
private void AddColumns(System.Windows.Forms.DataGridView dgvTmep) { DataGridViewLinkColumn dgvLink1 = new DataGridViewLinkColumn(); dgvLink1.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; dgvLink1.HeaderText = "修改救援措施"; dgvLink1.Name = "Measure"; dgvLink1.Text = "修改"; dgvLink1.UseColumnTextForLinkValue = true; dgvLink1.Resizable = DataGridViewTriState.False; dgvTmep.Columns.Add(dgvLink1); DataGridViewLinkColumn dgvLink2 = new DataGridViewLinkColumn(); dgvLink2.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; dgvLink2.HeaderText = "完成救援"; dgvLink2.Name = "EndHelp"; dgvLink2.Text = "完成"; dgvLink2.UseColumnTextForLinkValue = true; dgvLink2.Resizable = DataGridViewTriState.False; dgvTmep.Columns.Add(dgvLink2); }
private static DataGridViewLinkColumn GetRejectButton() { var print = new System.Windows.Forms.DataGridViewLinkColumn(); print.Text = "Action"; // print.Name = "lnkReject"; print.UseColumnTextForLinkValue = true; print.LinkBehavior = LinkBehavior.SystemDefault; print.HeaderText = ""; print.Name = "Reject"; // print.DefaultCellStyle.Font = new Font(FontFamily.GenericSansSerif, 6.00f); print.LinkColor = Color.Black; print.TrackVisitedState = true; print.HeaderText = "Skip/Reject"; //print. // print.Text = "Print"; print.UseColumnTextForLinkValue = true; print.DefaultCellStyle.SelectionBackColor = Color.White; //print.InheritedStyle = return(print); }
private void InitDataGridView() { for (int i = 0; i < _outOfDBGridView.Rows.Count; i++) { _outOfDBGridView.Rows.RemoveAt(i); } _outOfDBGridView.Columns.Clear(); var zNameColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); zNameColumn.Name = "z_code"; zNameColumn.HeaderText = "Z-code"; zNameColumn.DisplayIndex = 0; zNameColumn.ReadOnly = true; zNameColumn.MinimumWidth = 60; zNameColumn.DataPropertyName = "z_code"; var artistColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); artistColumn.Name = "ArtistName"; artistColumn.HeaderText = "Исполнитель"; artistColumn.DisplayIndex = 1; artistColumn.ReadOnly = true; artistColumn.MinimumWidth = 150; artistColumn.DataPropertyName = "ArtistName"; var nameColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); nameColumn.Name = "SongName"; nameColumn.HeaderText = "Песня"; nameColumn.DisplayIndex = 2; nameColumn.ReadOnly = true; nameColumn.MinimumWidth = 220; nameColumn.DataPropertyName = "SongName"; var chooseFileLinkColumn = new System.Windows.Forms.DataGridViewLinkColumn(); chooseFileLinkColumn.Name = "ChooseFile"; chooseFileLinkColumn.HeaderText = "Выбрать файл"; chooseFileLinkColumn.UseColumnTextForLinkValue = true; chooseFileLinkColumn.Text = "Выбрать Файл"; chooseFileLinkColumn.DisplayIndex = 4; var tryToFindLinkColumn = new System.Windows.Forms.DataGridViewLinkColumn(); tryToFindLinkColumn.Name = "TryToFind"; tryToFindLinkColumn.HeaderText = "Поиск в БД эфира"; tryToFindLinkColumn.UseColumnTextForLinkValue = true; tryToFindLinkColumn.Text = "Автомат. Поиск"; tryToFindLinkColumn.DisplayIndex = 5; var pathColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); pathColumn.Name = "Path"; pathColumn.HeaderText = "Путь к файлу"; pathColumn.DisplayIndex = 3; _outOfDBGridView.Columns.Add(zNameColumn); _outOfDBGridView.Columns.Add(artistColumn); _outOfDBGridView.Columns.Add(nameColumn); _outOfDBGridView.Columns.Add(pathColumn); _outOfDBGridView.Columns.Add(chooseFileLinkColumn); _outOfDBGridView.Columns.Add(tryToFindLinkColumn); _outOfDBGridView.AutoGenerateColumns = false; _outOfDBGridView.AllowUserToAddRows = false; _outOfDBGridView.RowHeadersVisible = false; _outOfDBGridView.DataSource = SongsTable; _outOfDBGridView.CellContentClick += new DataGridViewCellEventHandler(OutOfDbSongsDataGridViewCellClick); }
/// <summary> /// 给DataGrid赋值数据源,并且对列进行顺序 /// </summary> private void SortDataGrid(DataTable dt) { this.dgvMain.Columns.Clear(); this.dgvMain.DataSource = dt; DataGridViewLinkColumn editCol = new DataGridViewLinkColumn(); editCol.Name = "edit"; editCol.HeaderText = "修改信息"; editCol.Text = "修改"; editCol.Width = 60; editCol.UseColumnTextForLinkValue = true; this.dgvMain.Columns.Add(editCol); DataGridViewLinkColumn deleteCol = new DataGridViewLinkColumn(); deleteCol.Name = "delete"; deleteCol.HeaderText = "删除信息"; deleteCol.Text = "删除"; deleteCol.Width = 60; deleteCol.UseColumnTextForLinkValue = true; this.dgvMain.Columns.Add(deleteCol); this.dgvMain.Columns["Id"].Visible = false; this.dgvMain.Columns["EmpID"].Visible = false; this.dgvMain.Columns["PathNo"].HeaderText = "路线编号"; this.dgvMain.Columns["PathName"].HeaderText = "路线名称"; //this.dbgvMain.Columns["Id"].DisplayIndex = 0; //this.dbgvMain.Columns["PathNo"].DisplayIndex = 1; //this.dbgvMain.Columns["PathName"].DisplayIndex = 2; this.dgvMain.Columns["EmpNo"].HeaderText = "员工编号"; this.dgvMain.Columns["EmpName"].HeaderText = "员工姓名"; }
private void LoadInventory() { BSInventoryItem bs = new BSInventoryItem(); List<InventoryItem> itemlist = new List<InventoryItem>(); InventoryItem s = new InventoryItem(); DataGridViewLinkColumn Editlink = new DataGridViewLinkColumn(); Editlink.UseColumnTextForLinkValue = true; Editlink.HeaderText = ""; Editlink.DataPropertyName = "lnkColumn"; Editlink.LinkBehavior = LinkBehavior.SystemDefault; Editlink.Text = "Edit"; dgvData.Columns.Add(Editlink); DataGridViewLinkColumn Deletelink = new DataGridViewLinkColumn(); Deletelink.UseColumnTextForLinkValue = true; Deletelink.HeaderText = ""; Deletelink.DataPropertyName = "lnkColumn"; Deletelink.LinkBehavior = LinkBehavior.SystemDefault; Deletelink.Text = "Delete"; dgvData.Columns.Add(Deletelink); itemlist = bs.getInventoryItem(0, 0); dgvData.DataSource = null; dgvData.Rows.Clear(); dgvData.Columns.Clear(); dgvData.Refresh(); dgvData.DataSource = itemlist; for (int i = 0; i < dgvData.ColumnCount; i++) { if (dgvData.Columns[i].HeaderText.ToUpper() == VJColumnName.CONST_ITEM_ID.ToUpper() || dgvData.Columns[i].HeaderText.ToUpper() == VJColumnName.CONST_CATEGORY_ID.ToUpper()|| dgvData.Columns[i].HeaderText.ToUpper() == VJColumnName.CONST_CREATED_BY.ToUpper()|| dgvData.Columns[i].HeaderText.ToUpper() == VJColumnName.CONST_MODIFIED_BY.ToUpper()) { dgvData.Columns[i].Visible = false; } } }
private void BindDataGridView2Column() { // 添加修改模版信息 this.dataGridView2.AutoGenerateColumns = false; DataGridViewLinkColumn edit = new DataGridViewLinkColumn(); edit.Text = "修改"; edit.Name = "LinkEdit"; edit.HeaderText = "修改"; edit.UseColumnTextForLinkValue = true; this.dataGridView2.Columns.Add(edit); // 删除修改模版信息 this.dataGridView2.AutoGenerateColumns = false; DataGridViewLinkColumn delete = new DataGridViewLinkColumn(); delete.Text = "删除"; delete.Name = "LinkDelete"; delete.HeaderText = "删除"; delete.UseColumnTextForLinkValue = true; this.dataGridView2.Columns.Add(delete); }
private void InitializeComponent() { ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof (TechSupportPanel)); DataGridViewCellStyle gridViewCellStyle1 = new DataGridViewCellStyle(); DataGridViewCellStyle gridViewCellStyle2 = new DataGridViewCellStyle(); this.TechSupportPanel_HeaderLbl = new Label(); this.TechSupportPanel_CloseBtnBox = new CustomButtonPushHorizBox(); this.TechSupportPanel_CloseBtn = new CustomButtonPush(); this.TechSupportPanel_ButtonBarSeperator = new CustomLabelSeparator(); this.TechSupportPanel_GridView = new DataGridView(); this.CompanyColumn = new DataGridViewTextBoxColumn(); this.SupportWebsiteColumn = new DataGridViewLinkColumn(); this.TechSupportPanel_ShowOtherOperatorsBtn = new CustomButtonPush(); this.TechSupportPanel_HelpButtonLabelPair = new CustomHelpButtonLabelPair(); this.TechSupportPanel_CloseBtnBox.SuspendLayout(); this.TechSupportPanel_GridView.BeginInit(); this.SuspendLayout(); this.TechSupportPanel_HeaderLbl.BackColor = Color.Transparent; componentResourceManager.ApplyResources((object) this.TechSupportPanel_HeaderLbl, "TechSupportPanel_HeaderLbl"); this.TechSupportPanel_HeaderLbl.Name = "TechSupportPanel_HeaderLbl"; this.TechSupportPanel_CloseBtnBox.Controls.Add((Control) this.TechSupportPanel_CloseBtn); componentResourceManager.ApplyResources((object) this.TechSupportPanel_CloseBtnBox, "TechSupportPanel_CloseBtnBox"); this.TechSupportPanel_CloseBtnBox.HorizontalJustification = HorizontalJustificationEnum.Right; this.TechSupportPanel_CloseBtnBox.Name = "TechSupportPanel_CloseBtnBox"; this.TechSupportPanel_CloseBtn.BackColor = Color.White; this.TechSupportPanel_CloseBtn.BtnColor = PushButtonColorEnum.BlueGrey; this.TechSupportPanel_CloseBtn.BtnDoubleEndCaps = false; this.TechSupportPanel_CloseBtn.BtnEnabled = true; componentResourceManager.ApplyResources((object) this.TechSupportPanel_CloseBtn, "TechSupportPanel_CloseBtn"); this.TechSupportPanel_CloseBtn.Name = "TechSupportPanel_CloseBtn"; this.TechSupportPanel_ButtonBarSeperator.BackColor = Color.White; componentResourceManager.ApplyResources((object) this.TechSupportPanel_ButtonBarSeperator, "TechSupportPanel_ButtonBarSeperator"); this.TechSupportPanel_ButtonBarSeperator.Name = "TechSupportPanel_ButtonBarSeperator"; this.TechSupportPanel_ButtonBarSeperator.TabStop = false; this.TechSupportPanel_GridView.AllowUserToAddRows = false; this.TechSupportPanel_GridView.AllowUserToDeleteRows = false; this.TechSupportPanel_GridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; this.TechSupportPanel_GridView.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells; this.TechSupportPanel_GridView.BackgroundColor = Color.WhiteSmoke; this.TechSupportPanel_GridView.BorderStyle = BorderStyle.None; this.TechSupportPanel_GridView.ColumnHeadersBorderStyle = DataGridViewHeaderBorderStyle.Single; gridViewCellStyle1.Alignment = DataGridViewContentAlignment.MiddleLeft; gridViewCellStyle1.BackColor = Color.FromArgb(37, 101, 166); gridViewCellStyle1.Font = new Font("Tahoma", 9f); gridViewCellStyle1.ForeColor = Color.White; gridViewCellStyle1.SelectionBackColor = Color.FromArgb(37, 101, 166); gridViewCellStyle1.SelectionForeColor = Color.White; gridViewCellStyle1.WrapMode = DataGridViewTriState.True; this.TechSupportPanel_GridView.ColumnHeadersDefaultCellStyle = gridViewCellStyle1; this.TechSupportPanel_GridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.TechSupportPanel_GridView.Columns.AddRange((DataGridViewColumn) this.CompanyColumn, (DataGridViewColumn) this.SupportWebsiteColumn); gridViewCellStyle2.Alignment = DataGridViewContentAlignment.MiddleLeft; gridViewCellStyle2.BackColor = Color.WhiteSmoke; gridViewCellStyle2.Font = new Font("Tahoma", 9f); gridViewCellStyle2.ForeColor = Color.Black; gridViewCellStyle2.SelectionBackColor = Color.FromArgb(81, 149, 217); gridViewCellStyle2.SelectionForeColor = Color.Black; gridViewCellStyle2.WrapMode = DataGridViewTriState.False; this.TechSupportPanel_GridView.DefaultCellStyle = gridViewCellStyle2; this.TechSupportPanel_GridView.GridColor = Color.FromArgb(204, 204, 204); componentResourceManager.ApplyResources((object) this.TechSupportPanel_GridView, "TechSupportPanel_GridView"); this.TechSupportPanel_GridView.MultiSelect = false; this.TechSupportPanel_GridView.Name = "TechSupportPanel_GridView"; this.TechSupportPanel_GridView.ReadOnly = true; this.TechSupportPanel_GridView.RowHeadersVisible = false; this.TechSupportPanel_GridView.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.DisableResizing; this.TechSupportPanel_GridView.RowTemplate.Height = 24; this.TechSupportPanel_GridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect; this.TechSupportPanel_GridView.ShowEditingIcon = false; this.TechSupportPanel_GridView.CellContentClick += new DataGridViewCellEventHandler(this.OnCellContentClick); this.CompanyColumn.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; this.CompanyColumn.DataPropertyName = "CompanyName"; componentResourceManager.ApplyResources((object) this.CompanyColumn, "CompanyColumn"); this.CompanyColumn.Name = "CompanyColumn"; this.CompanyColumn.ReadOnly = true; this.CompanyColumn.Resizable = DataGridViewTriState.True; this.SupportWebsiteColumn.DataPropertyName = "SupportURL"; componentResourceManager.ApplyResources((object) this.SupportWebsiteColumn, "SupportWebsiteColumn"); this.SupportWebsiteColumn.Name = "SupportWebsiteColumn"; this.SupportWebsiteColumn.ReadOnly = true; this.TechSupportPanel_ShowOtherOperatorsBtn.BackColor = Color.White; this.TechSupportPanel_ShowOtherOperatorsBtn.BtnColor = PushButtonColorEnum.BlueGrey; this.TechSupportPanel_ShowOtherOperatorsBtn.BtnDoubleEndCaps = false; this.TechSupportPanel_ShowOtherOperatorsBtn.BtnEnabled = true; componentResourceManager.ApplyResources((object) this.TechSupportPanel_ShowOtherOperatorsBtn, "TechSupportPanel_ShowOtherOperatorsBtn"); this.TechSupportPanel_ShowOtherOperatorsBtn.Name = "TechSupportPanel_ShowOtherOperatorsBtn"; this.TechSupportPanel_HelpButtonLabelPair.BackColor = Color.Transparent; componentResourceManager.ApplyResources((object) this.TechSupportPanel_HelpButtonLabelPair, "TechSupportPanel_HelpButtonLabelPair"); this.TechSupportPanel_HelpButtonLabelPair.Name = "TechSupportPanel_HelpButtonLabelPair"; this.AutoScaleMode = AutoScaleMode.None; this.BackColor = Color.White; this.Controls.Add((Control) this.TechSupportPanel_HelpButtonLabelPair); this.Controls.Add((Control) this.TechSupportPanel_ShowOtherOperatorsBtn); this.Controls.Add((Control) this.TechSupportPanel_GridView); this.Controls.Add((Control) this.TechSupportPanel_CloseBtnBox); this.Controls.Add((Control) this.TechSupportPanel_ButtonBarSeperator); this.Controls.Add((Control) this.TechSupportPanel_HeaderLbl); componentResourceManager.ApplyResources((object) this, "$this"); this.Name = "TechSupportPanel"; this.TechSupportPanel_CloseBtnBox.ResumeLayout(false); this.TechSupportPanel_GridView.EndInit(); this.ResumeLayout(false); }
public void ExportAsDataGridView(ref DataGridView viewRef1) { int index = 0; int num3 = 0; int num4 = 0; int num5 = 0; int num6 = 0; int num2 = 0; Color[] colorArray = new Color[] { Color.LightGreen, Color.LightPink, Color.LightYellow, Color.LightSalmon, Color.LightSkyBlue, Color.LightGreen, Color.LightPink, Color.LightYellow, Color.LightSalmon, Color.LightSkyBlue, Color.LightGreen, Color.LightPink, Color.LightYellow, Color.LightSalmon, Color.LightSkyBlue }; viewRef1.DataSource = null; viewRef1.Rows.Clear(); viewRef1.Columns.Clear(); viewRef1.AllowUserToAddRows = true; viewRef1.AllowUserToDeleteRows = true; viewRef1.AllowUserToOrderColumns = true; viewRef1.AllowUserToResizeRows = false; DataTable table5 = new DataTable(); table5.Columns.Add("FollowTarget"); table5.Rows.Add(new object[] { "Member Name" }); table5.Rows.Add(new object[] { "Client Name" }); table5.Rows.Add(new object[] { "IP Address" }); DataTable table3 = new DataTable(); table3.Columns.Add("BetFollowMethod"); table3.Rows.Add(new object[] { "Normal" }); table3.Rows.Add(new object[] { "Opposite" }); DataTable table2 = new DataTable(); table2.Columns.Add("BetAmountStyle"); if (!this._isWebsiteBetStyleFixed) { table2.Rows.Add(new object[] { "Fixed $" }); table2.Rows.Add(new object[] { "Max Bet" }); table2.Rows.Add(new object[] { "Percent %" }); if (this._isToShowIndoSpecialBetStyle) { table2.Rows.Add(new object[] { "Indo Special" }); } table2.Rows.Add(new object[] { "None" }); } else { table2.Rows.Add(new object[] { "-DEFAULT-" }); } DataTable table4 = new DataTable(); table4.Columns.Add("FollowOddsOption"); table4.Rows.Add(new object[] { "Stop Bet If Odds <" }); table4.Rows.Add(new object[] { "Stop Bet If Odds Different >" }); table4.Rows.Add(new object[] { "None" }); DataTable table = new DataTable(); table.Columns.Add("AgentFollowOddsOption"); if (this._isToShowFollowToSameSportBook) { table.Rows.Add(new object[] { "Stop Bet If Agent Odds <" }); table.Rows.Add(new object[] { "None" }); } if (this._isToShowFollowTarget) { num3 = 1; DataGridViewComboBoxColumn column3 = new DataGridViewComboBoxColumn(); column3.Name = "FollowTarget"; column3.DisplayStyle = DataGridViewComboBoxDisplayStyle.DropDownButton; column3.DisplayMember = "FollowTarget"; column3.DataSource = table5; column3.HeaderText = "Follow Target"; viewRef1.Columns.Add(column3); viewRef1.Columns[viewRef1.Columns.Count - 1].Width = 100; viewRef1.Columns[viewRef1.Columns.Count - 1].DefaultCellStyle.BackColor = Color.LightBlue; } viewRef1.Columns.Add("MemberName", "Member Name"); viewRef1.Columns[viewRef1.Columns.Count - 1].DefaultCellStyle.Font = new Font(viewRef1.Font, FontStyle.Bold); viewRef1.Columns.Add("MinFollowLimit", "Min Follow Limit\r\n最低跟单金额"); viewRef1.Columns[viewRef1.Columns.Count - 1].Width = 110; if (this._isToShowMaxFollowLimit) { num6 = 1; viewRef1.Columns.Add("MaxFollowLimit", "Max Follow Limit\r\n最高跟单金额"); viewRef1.Columns[viewRef1.Columns.Count - 1].Width = 110; } DataGridViewComboBoxColumn dataGridViewColumn = new DataGridViewComboBoxColumn(); dataGridViewColumn.Name = "FollowType"; dataGridViewColumn.DisplayStyle = DataGridViewComboBoxDisplayStyle.DropDownButton; dataGridViewColumn.DisplayMember = "BetFollowMethod"; dataGridViewColumn.DataSource = table3; dataGridViewColumn.HeaderText = "Follow Type\r\n跟 正/反"; viewRef1.Columns.Add(dataGridViewColumn); viewRef1.Columns[viewRef1.Columns.Count - 1].Width = 80; viewRef1.Columns[viewRef1.Columns.Count - 1].DefaultCellStyle.BackColor = Color.LightBlue; if (this._isToShowBetTargetCollection) { num4 = 1; DataGridViewLinkColumn column4 = new DataGridViewLinkColumn(); column4.LinkColor = Color.Blue; column4.VisitedLinkColor = Color.Blue; column4.Name = "BetTarget"; column4.HeaderText = "Bet Target\r\n跟单类型"; column4.Text = "---"; viewRef1.Columns.Add(column4); viewRef1.Columns[viewRef1.Columns.Count - 1].Width = 100; viewRef1.Columns[viewRef1.Columns.Count - 1].DefaultCellStyle.BackColor = Color.LightBlue; } DataGridViewComboBoxColumn column2 = new DataGridViewComboBoxColumn(); column2.Name = "FollowOddsOption"; column2.DisplayStyle = DataGridViewComboBoxDisplayStyle.DropDownButton; column2.DataSource = table4; column2.DisplayMember = "FollowOddsOption"; column2.HeaderText = "Follow Odds Option\r\n下注行情设定"; viewRef1.Columns.Add(column2); viewRef1.Columns[viewRef1.Columns.Count - 1].Width = 0xa5; viewRef1.Columns[viewRef1.Columns.Count - 1].DefaultCellStyle.BackColor = Color.Cornsilk; viewRef1.Columns.Add("FollowOddsOptionValue", "Odds"); viewRef1.Columns[viewRef1.Columns.Count - 1].Width = 40; viewRef1.Columns[viewRef1.Columns.Count - 1].DefaultCellStyle.BackColor = Color.Cornsilk; if (this._isToShowFollowToSameSportBook) { num5 = 1; num2 = 2; DataGridViewComboBoxColumn column5 = new DataGridViewComboBoxColumn(); column5.Name = "AgentFollowOddsOption"; column5.DisplayStyle = DataGridViewComboBoxDisplayStyle.DropDownButton; column5.DataSource = table; column5.DisplayMember = "AgentFollowOddsOption"; column5.HeaderText = "Agent Follow Odds Option"; viewRef1.Columns.Add(column5); viewRef1.Columns[viewRef1.Columns.Count - 1].Width = 0xa5; viewRef1.Columns[viewRef1.Columns.Count - 1].DefaultCellStyle.BackColor = Color.Cornsilk; viewRef1.Columns.Add("AgentFollowOddsOptionValue", "Odds"); viewRef1.Columns[viewRef1.Columns.Count - 1].Width = 40; viewRef1.Columns[viewRef1.Columns.Count - 1].DefaultCellStyle.BackColor = Color.Cornsilk; DataGridViewCheckBoxColumn column6 = new DataGridViewCheckBoxColumn(); column6.Name = "BetToSameSportBook"; column6.HeaderText = "Bet To Same\r\nSportBook"; column6.Selected = false; viewRef1.Columns.Add(column6); viewRef1.Columns[viewRef1.Columns.Count - 1].Width = 60; viewRef1.Columns[viewRef1.Columns.Count - 1].DefaultCellStyle.BackColor = Color.LightBlue; } index = 0; List<WebsiteBetStyle>.Enumerator enumerator = this._objDefaultWebsiteBetStyleList.get_SourceList().GetEnumerator(); try { // enumerator; while (enumerator.MoveNext()) { WebsiteBetStyle current = enumerator.Current; DataGridViewComboBoxColumn column7 = new DataGridViewComboBoxColumn(); column7.Name = current.get_Website() + "t"; column7.DisplayStyle = DataGridViewComboBoxDisplayStyle.DropDownButton; column7.DisplayMember = "BetAmountStyle"; column7.DataSource = table2; column7.HeaderText = current.get_Website() + "\r\nBet Type"; viewRef1.Columns.Add(column7); viewRef1.Columns[viewRef1.Columns.Count - 1].Width = 100; viewRef1.Columns[viewRef1.Columns.Count - 1].DefaultCellStyle.BackColor = colorArray[index]; viewRef1.Columns.Add(current.get_Website() + "v", current.get_Website() + "\r\nAmount"); viewRef1.Columns[viewRef1.Columns.Count - 1].Width = 70; viewRef1.Columns[viewRef1.Columns.Count - 1].DefaultCellStyle.BackColor = colorArray[index]; index++; } } finally { enumerator.Dispose(); } List<Member>.Enumerator enumerator2 = this._objMemberList.GetEnumerator(); try { //enumerator2; while (enumerator2.MoveNext()) { Member member = enumerator2.Current; object[] values = new object[(viewRef1.Columns.Count - 1) + 1]; if (this._isToShowFollowTarget) { switch (member.get_FollowTarget()) { case EnumCollection.eFollowTarget.MemberName: values[0] = "Member Name"; break; case EnumCollection.eFollowTarget.ClientName: values[0] = "Client Name"; break; case EnumCollection.eFollowTarget.IPAddress: values[0] = "IP Address"; break; } } values[0 + num3] = member.get_Name(); values[1 + num3] = member.get_MinFollowLimit().ToString(); if (this._isToShowMaxFollowLimit) { values[2 + num3] = member.get_MaxFollowLimit().ToString(); } values[(2 + num3) + num6] = member.get_BetFollowMethod().ToString(); if (this._isToShowBetTargetCollection) { values[(3 + num3) + num6] = member.get_BetTargetCol().ToString(); } string str2 = ""; switch (member.get_FollowOddsOpt().get_FollowOddsOption()) { case EnumCollection.eFollowOddsOption.None: str2 = "None"; break; case EnumCollection.eFollowOddsOption.HaltIfOddsLessThan: str2 = "Stop Bet If Odds <"; break; case EnumCollection.eFollowOddsOption.HaltIfOddsDifferentMoreThan: str2 = "Stop Bet If Odds Different >"; break; } values[((3 + num3) + num4) + num6] = str2; if (member.get_FollowOddsOpt().get_FollowOddsOption() == EnumCollection.eFollowOddsOption.None) { values[((4 + num3) + num4) + num6] = "-"; } else { values[((4 + num3) + num4) + num6] = member.get_FollowOddsOpt().get_OddsValue().ToString("N3"); } if (this._isToShowFollowToSameSportBook) { string str3 = ""; switch (member.get_AgentFollowOddsOpt().get_FollowOddsOption()) { case EnumCollection.eFollowOddsOption.None: str3 = "None"; break; case EnumCollection.eFollowOddsOption.HaltIfAgentOddsLessThan: str3 = "Stop Bet If Agent Odds <"; break; } values[((5 + num3) + num4) + num6] = str3; if (member.get_AgentFollowOddsOpt().get_FollowOddsOption() == EnumCollection.eFollowOddsOption.None) { values[((6 + num3) + num4) + num6] = "-"; } else { values[((6 + num3) + num4) + num6] = member.get_AgentFollowOddsOpt().get_OddsValue().ToString("N3"); } values[((7 + num3) + num4) + num6] = member.get_IsFollowToSameSportBook(); } index = ((((5 + num3) + num4) + num5) + num6) + num2; foreach (WebsiteBetStyle style in this._objDefaultWebsiteBetStyleList.get_SourceList()) { WebsiteBetStyle websiteByName = member.get_WebsiteBetStyleList().GetWebsiteByName(style.get_Website()); if (websiteByName == null) { goto Label_0E58; } if (!this._isWebsiteBetStyleFixed) { switch (websiteByName.get_BetStyle()) { case EnumCollection.eBetAmountStyle.Fixed: values[index] = "Fixed $"; goto Label_0DBA; case EnumCollection.eBetAmountStyle.MaxBet: values[index] = "Max Bet"; goto Label_0DBA; case EnumCollection.eBetAmountStyle.Percent: values[index] = "Percent %"; goto Label_0DBA; case EnumCollection.eBetAmountStyle.IndoSpecial: if (!this._isToShowIndoSpecialBetStyle) { break; } values[index] = "Indo Special"; goto Label_0DBA; case EnumCollection.eBetAmountStyle.None: values[index] = "None"; goto Label_0DBA; default: goto Label_0DBA; } values[index] = "Fixed $"; } else { values[index] = "-DEFAULT-"; } Label_0DBA: index++; if ((websiteByName.get_BetStyle() == EnumCollection.eBetAmountStyle.IndoSpecial) & !this._isToShowIndoSpecialBetStyle) { values[index] = "$0"; } else { switch (websiteByName.get_BetStyle()) { case EnumCollection.eBetAmountStyle.Fixed: values[index] = "$" + websiteByName.get_BetValue().ToString(); goto Label_0E50; case EnumCollection.eBetAmountStyle.MaxBet: case EnumCollection.eBetAmountStyle.None: values[index] = "-"; goto Label_0E50; case EnumCollection.eBetAmountStyle.Percent: case EnumCollection.eBetAmountStyle.IndoSpecial: values[index] = websiteByName.get_BetValue().ToString() + "%"; goto Label_0E50; } } Label_0E50: index++; continue; Label_0E58: values[index] = "Fixed $"; index++; values[index] = "$0"; index++; } viewRef1.Rows.Add(values); } } finally { enumerator2.Dispose(); } }