private void bindGrid1Data2(DataSet dsTemp) { DataColumn dc = new DataColumn(); dc.ColumnName = "percentage"; dsTemp.Tables[0].Columns.Add(dc); dataGridView2.DataSource = dsTemp.Tables[0]; dataGridView2.Columns["regionid"].Visible = false; dataGridView2.Columns["percentage"].HeaderText = "Percentage"; if (!dataGridView2.Columns.Contains("effectivedate")) { CalendarColumn col = new CalendarColumn(); col.HeaderText = "Effective Date"; col.Name = "effectivedate"; col.Width = 120; col.ValueType = typeof(DateTime); dataGridView2.Columns.Add(col); } }
private void bindGrid1Data2(DataSet dsTemp) { DataColumn dc = new DataColumn(); dc.ColumnName = "valueamount"; dsTemp.Tables[0].Columns.Add(dc); dataGridView2.DataSource = dsTemp.Tables[0]; dataGridView2.Columns["regionid"].Visible = false; dataGridView2.Columns["valueamount"].HeaderText = "Value/Amount"; dataGridView2.Columns["bytype"].DisplayIndex = 3; if (!dataGridView2.Columns.Contains("effectivedate")) { CalendarColumn col = new CalendarColumn(); col.HeaderText = "Effective Date"; col.Name = "effectivedate"; col.Width = 120; col.ValueType = typeof(DateTime); dataGridView2.Columns.Add(col); } if (!dataGridView2.Columns.Contains("productcat")) { DataGridViewComboBoxColumn comboboxColumn = new DataGridViewComboBoxColumn(); comboboxColumn.HeaderText = "Product Category"; comboboxColumn.Name = "productcat"; comboboxColumn.Width = 250; comboboxColumn.FlatStyle = FlatStyle.Flat; comboboxColumn = populateData(comboboxColumn); dataGridView2.Columns.Add(comboboxColumn); dataGridView2.Columns["productcat"].DisplayIndex = 4; } }