Nothing Special   »   [go: up one dir, main page]

Load The Dataset // Assign The "Percentquota" Expression, and Set Format To Be A Percentage

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

[C#] Handling the Form Load Event

Copy Code

private void RadGridViewLab2_Load(object sender, EventArgs e) { // load the dataset this.salesPersonTableAdapter.Fill(this.adventureWorksDataSet.SalesPerson); // assign the "PercentQuota" expression, and set format to be a percentage this.radGridView1.Columns["PercentQuota"].Expression = "SalesYTD/SalesQuota"; this.radGridView1.Columns["PercentQuota"].FormatString = "{0:P}"; // create a new "Over 15 Percent" checkbox GridViewCheckBoxColumn checkboxColumn = new GridViewCheckBoxColumn(); checkboxColumn.Name = "CheckBoxColumn"; checkboxColumn.HeaderText = "Over 15%"; checkboxColumn.Width = 60; radGridView1.Columns.Add(checkboxColumn); checkboxColumn.Expression = "PercentQuota > 15"; // set column formats this.radGridView1.Columns["SalesQuota"].FormatString = "{0:C}"; this.radGridView1.Columns["Bonus"].FormatString = "{0:C}"; this.radGridView1.Columns["SalesYTD"].FormatString = "{0:C}"; this.radGridView1.Columns["SalesLastYear"].FormatString = "{0:C}"; this.radGridView1.Columns["CommissionPct"].FormatString = "{0:P}"; // get the best fit for each column based on header text and data radGridView1.MasterTemplate.BestFitColumns(); }
1.

You might also like