private void RadForm1_Load(object sender, EventArgs e) { this.productsTableAdapter.Fill(this.nwindDataSet.Products); this.radGridView1.DataSource = this.productsBindingSource; this.radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill; this.radGridView1.AllowAddNewRow = false; this.radGridView1.EnableGrouping = true; this.radGridView1.MasterTemplate.ShowGroupedColumns = true; this.radGridView1.TableElement.GroupHeaderHeight = 60; // group by CategoryID GroupDescriptor descriptor = new GroupDescriptor(); descriptor.GroupNames.Add("CategoryID", ListSortDirection.Ascending); this.radGridView1.GroupDescriptors.Add(descriptor); // add summary items GridViewSummaryItem item1 = new GridViewSummaryItem("UnitPrice", "Avg = {0:N2}", GridAggregateFunction.Avg); GridViewSummaryItem item2 = new GridViewSummaryItem("ProductID", "Count = {0}", GridAggregateFunction.Count); GridViewSummaryItem item4 = new GridViewSummaryItem("UnitsOnOrder", "Max = {0}", GridAggregateFunction.Max); GridViewSummaryItem item5 = new GridViewSummaryItem("UnitsInStock", "Sum = {0}", GridAggregateFunction.Sum); GridViewSummaryRowItem row = new GridViewSummaryRowItem(new GridViewSummaryItem[] { item1, item2, item4, item5 }); this.radGridView1.SummaryRowsTop.Add(row); }
public Form1() { InitializeComponent(); //This project demonstrates how to show the summary cells when the groups are collpased #region Populate with data for (int i = 0; i < 5; i++) { GridViewDecimalColumn col = new GridViewDecimalColumn("Col " + (i + 1)); this.radGridView1.Columns.Add(col); } for (int i = 0; i < 20; i++) { this.radGridView1.Rows.Add(i % 5, i % 3, i % 2, i, i); } #endregion #region Add summary items GridViewSummaryItem item1 = new GridViewSummaryItem("Col 1", "Sum = {0}", GridAggregateFunction.Sum); GridViewSummaryItem item2 = new GridViewSummaryItem("Col 2", "Avg = {0}", GridAggregateFunction.Avg); GridViewSummaryItem item4 = new GridViewSummaryItem("Col 4", "Max = {0}", GridAggregateFunction.Max); GridViewSummaryItem item5 = new GridViewSummaryItem("Col 5", "First = {0}", GridAggregateFunction.First); GridViewSummaryRowItem row = new GridViewSummaryRowItem(new GridViewSummaryItem[] { item1, item2, item4, item5 }); this.radGridView1.SummaryRowsTop.Add(row); #endregion this.radGridView1.TableElement.GroupHeaderHeight = 50; this.radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill; this.radGridView1.CreateCell += new GridViewCreateCellEventHandler(radGridView1_CreateCell); this.radGridView1.Columns.CollectionChanged += new NotifyCollectionChangedEventHandler(Columns_CollectionChanged); }
private void MyTimer_Tick(object sender, EventArgs e) { this.ProductsRadGridView.TableElement.Text = string.Empty; this.ProductsRadGridView.TableElement.BackgroundImage = null; FillProductsRadGridView(); if (ProductsRadGridView.Rows.Count == 0) { this.ProductsRadGridView.TableElement.Text = "Producto(s) no encontrado(s).."; } this.MyTimer.Stop(); ConditionalFormattingObject objFormat = new ConditionalFormattingObject("MyCondiction", ConditionTypes.Equal, "0", "", true); objFormat.CellForeColor = Color.Red; objFormat.RowBackColor = Color.SkyBlue; this.ProductsRadGridView.Columns["Stock"] .ConditionalFormattingObjectList .Add(objFormat); GridViewSummaryItem summaryItem = new GridViewSummaryItem("ProductCode", "Producto(s) Reg. {0}", GridAggregateFunction.Count); GridViewSummaryRowItem summaryRowItem = new GridViewSummaryRowItem(); summaryRowItem.Add(summaryItem); ProductsRadGridView.SummaryRowsTop.Add(summaryRowItem); }
private void TotalExpenses() { GridViewSummaryItem summaryItemFreight = new GridViewSummaryItem("RequiarAmount", "الاجمالي={0}" + InformationsClass.Coin + " ", GridAggregateFunction.Sum); GridViewSummaryRowItem summaryRowItem = new GridViewSummaryRowItem(new GridViewSummaryItem[] { summaryItemFreight }); this.ExpensesGridView.SummaryRowsBottom.Clear(); this.ExpensesGridView.SummaryRowsBottom.Add(summaryRowItem); }
private void LoadMyCollection() { gridMyCollection.Columns["Cost"].SortOrder = RadSortOrder.Ascending; gridMyCollection.Columns["Name"].SortOrder = RadSortOrder.Ascending; gridMyCollection.MasterTemplate.GroupComparer = new GroupComparer(); gridMyCollection.DataSource = MyCollection.Cards; GridViewSummaryRowItem summaryRowItem = new GridViewSummaryRowItem(); GridViewSummaryItem summaryItem = new GridViewSummaryItem(); summaryItem.Name = "Own"; summaryItem.AggregateExpression = "Sum(IIf(Own > 0, 1, 0))"; summaryRowItem.Add(summaryItem); summaryItem = new GridViewSummaryItem(); summaryItem.Name = "Missing"; summaryItem.AggregateExpression = "Sum(IIf(Missing > 0, 1, 0))"; summaryRowItem.Add(summaryItem); summaryItem = new GridViewSummaryItem(); summaryItem.Name = "Dust"; summaryItem.AggregateExpression = "Sum(Dust * Missing)"; summaryRowItem.Add(summaryItem); gridMyCollection.SummaryRowsTop.Add(summaryRowItem); gridMyCollection.MasterTemplate.ShowTotals = true; gridMyCollection.MasterView.SummaryRows[0].PinPosition = PinnedRowPosition.Top; gridMyCollection.MasterTemplate.ExpandAllGroups(); }
private void UcConsignacionesPorEditorial_Load(object sender, EventArgs e) { this.Width = this.Parent.Width - 40; var incremento = 150; if (_itemsCount < 3) incremento = 100; else if (incremento < 6) incremento = 127; this.Height = 60 + incremento; splitContainer1.SplitterDistance = 45; var summaryItem = new GridViewSummaryItem { Name = "TotalARendir", Aggregate = GridAggregateFunction.Sum, FormatString = "{0:c}" }; var summaryRowItem = new GridViewSummaryRowItem {summaryItem}; this.GridTitulos.SummaryRowsBottom.Add(summaryRowItem); }
private void loadList() { IPaymentService payService = new PaymentService(); if (IDnum == "All") payment = new List<Payment>(payService.GetAllPayments()); else payment = new List<Payment>(payService.GetAllStudentsPayments(IDnum)); gridView.DataSource = payment; GroupDescriptor descriptor = new GroupDescriptor(); descriptor.GroupNames.Add("Student", ListSortDirection.Ascending); this.gridView.GroupDescriptors.Add(descriptor); GridViewSummaryItem summaryItem; if (IDnum != "All") summaryItem = new GridViewSummaryItem("Amount", "Total: {0} Balance: " + payment[0].Balance, GridAggregateFunction.Sum); else summaryItem = new GridViewSummaryItem("Amount", "Total: {0}", GridAggregateFunction.Sum); GridViewSummaryRowItem summaryRowItem = new GridViewSummaryRowItem(); summaryRowItem.Add(summaryItem); this.gridView.SummaryRowsBottom.Add(summaryRowItem); }
private void UcConsignacionesPorEditorial_Load(object sender, EventArgs e) { this.Width = this.Parent.Width - 40; var incremento = 150; if (_itemsCount < 3) { incremento = 100; } else if (incremento < 6) { incremento = 127; } this.Height = 60 + incremento; splitContainer1.SplitterDistance = 45; var summaryItem = new GridViewSummaryItem { Name = "TotalARendir", Aggregate = GridAggregateFunction.Sum, FormatString = "{0:c}" }; var summaryRowItem = new GridViewSummaryRowItem { summaryItem }; this.GridTitulos.SummaryRowsBottom.Add(summaryRowItem); }
private void SetUpLaporanPenjualan() { string sQuery = "call pGetPenjualanSales(" + dtSales_["salesid"].ToString() + ",'" + DateTime.Parse(dtBulan_["startdate"].ToString()).ToString("yyyy-MM-dd") + "' , '" + DateTime.Parse(dtBulan_["enddate"].ToString()).ToString("yyyy-MM-dd") + "')"; MySqlDataAdapter adapt = new MySqlDataAdapter(sQuery , ConfigurationManager.ConnectionStrings["NB.Properties.Settings.sinarekConnectionString"].ConnectionString); DataTable dt = new DataTable("Data"); adapt.Fill(dt); radGridView4.Columns.Clear(); radGridView4.DataSource = dt; radGridView4.ReadOnly = true; radGridView4.Columns["ProductShortChild"].HeaderText = "Barang"; radGridView4.Columns["ProductShortChild"].Width = 75; radGridView4.Columns["Target"].HeaderText = "Target"; radGridView4.Columns["Target"].Width = 75; radGridView4.Columns["Target"].FormatString = "{0:n2}"; radGridView4.Columns["Jumlah"].HeaderText = "Jumlah"; radGridView4.Columns["Jumlah"].Width = 100; radGridView4.Columns["Jumlah"].FormatString = "{0:n2}"; if (radGridView4.SummaryRowsTop.Count == 0) { GridViewSummaryRowItem summ = new GridViewSummaryRowItem(); summ.Add(new GridViewSummaryItem("Jumlah", "Total : ", GridAggregateFunction.Sum)); summ.Add(new GridViewSummaryItem("Target", "{0:n2}", GridAggregateFunction.Sum)); radGridView4.SummaryRowsTop.Add(summ); } }
private void AddSummaries() { this.grdLister.MasterGridViewTemplate.SummaryRowsBottom.Clear(); GridViewSummaryRowItem item2 = new GridViewSummaryRowItem(); GridViewSummaryItem c = new GridViewSummaryItem(); c.Aggregate = GridAggregateFunction.None; c.AggregateExpression = "SUM(PaidTotalRentCommission)"; c.Name = "DriverNo"; c.FormatString = "Gr. Total"; item2.Add(c); c = new GridViewSummaryItem(); c.Aggregate = GridAggregateFunction.Sum; c.AggregateExpression = "SUM(PaidAccountBookings)"; c.Name = "AccountBookings"; c.FormatString = "{0}"; item2.Add(c); c = new GridViewSummaryItem(); c.Aggregate = GridAggregateFunction.Sum; c.AggregateExpression = "SUM(PaidTotalRentCommission)"; c.Name = "TotalRentCommission"; c.FormatString = "{0}"; item2.Add(c); c = new GridViewSummaryItem(); c.Aggregate = GridAggregateFunction.Sum; c.AggregateExpression = "SUM(PaidOfficeToPay)"; c.Name = "OfficeToPay"; c.FormatString = "{0}"; item2.Add(c); c = new GridViewSummaryItem(); c.Aggregate = GridAggregateFunction.Sum; c.AggregateExpression = "SUM(PaidDriverToPay)"; c.Name = "DriverToPay"; c.FormatString = "{0}"; item2.Add(c); c = new GridViewSummaryItem(); c.Aggregate = GridAggregateFunction.Sum; c.AggregateExpression = "SUM(PaidPreviousBalance)"; c.Name = "PreviousBalance"; c.FormatString = "{0}"; item2.Add(c); this.grdLister.MasterGridViewTemplate.SummaryRowsBottom.Add(item2); this.grdLister.MasterView.SummaryRows[0].PinPosition = PinnedRowPosition.Bottom; }
private void TotalAmount() { GridViewSummaryItem summaryItemFreight = new GridViewSummaryItem("TotalSalary", "الاجمالي={0}" + InformationsClass.Coin + " ", GridAggregateFunction.Sum); GridViewSummaryRowItem summaryRowItem = new GridViewSummaryRowItem(new GridViewSummaryItem[] { summaryItemFreight }); this.ContractsGridView.SummaryRowsBottom.Clear(); this.ContractsGridView.SummaryRowsBottom.Add(summaryRowItem); /// }
private void AddSummaries() { GridViewSummaryRowItem item1 = new GridViewSummaryRowItem(); GridViewSummaryRowItem item2 = new GridViewSummaryRowItem(); item1.Add(new GridViewSummaryItem("CompanyName", "Count: {0}", GridAggregateFunction.Count)); item2.Add(new GridViewSummaryItem("ContactName", "Count: {0}", GridAggregateFunction.Count)); this.radGridView1.MasterTemplate.SummaryRowsTop.Add(item1); this.radGridView1.MasterTemplate.SummaryRowsBottom.Add(item2); }
public RadForm1() { InitializeComponent(); leftGrid.ShowGroupPanel = false; rightGrid.ShowGroupPanel = false; leftGrid.AllowAddNewRow = false; rightGrid.AllowAddNewRow = false; leftGrid.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill; rightGrid.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill; GridViewSummaryRowItem summaryItem = new GridViewSummaryRowItem(); summaryItem.Add(new GridViewSummaryItem("Number 1", "Total {0}", GridAggregateFunction.Sum)); this.leftGrid.MasterTemplate.SummaryRowsBottom.Add(summaryItem); this.rightGrid.MasterTemplate.SummaryRowsBottom.Add(summaryItem); }
private void TotalActivites() { GridViewSummaryItem summaryItemFreight1 = new GridViewSummaryItem("SubTotalCost", "الاجمالي={0}"+InformationsClass.Coin+"", GridAggregateFunction.Sum); GridViewSummaryRowItem summaryRowItem1 = new GridViewSummaryRowItem(new GridViewSummaryItem[] { summaryItemFreight1 }); this.gridViewTemplate2.SummaryRowsBottom.Clear(); this.gridViewTemplate2.SummaryRowsBottom.Add(summaryRowItem1); /// GridViewSummaryItem summaryItemFreight = new GridViewSummaryItem("ActivityTotalCost", "الاجمالي العام={0}" + InformationsClass.Coin + "", GridAggregateFunction.Sum); GridViewSummaryRowItem summaryRowItem = new GridViewSummaryRowItem(new GridViewSummaryItem[] { summaryItemFreight }); this.ActivitiesGridView.SummaryRowsBottom.Clear(); this.ActivitiesGridView.SummaryRowsBottom.Add(summaryRowItem); }
private void frmDescripcionPuestos_Load(object sender, EventArgs e) { try { // Summatoria de datos GridViewSummaryRowItem item1 = new GridViewSummaryRowItem(); item1.Add(new GridViewSummaryItem("Total", "Total: {0:N2}", GridAggregateFunction.Sum)); this.grdDatos.SummaryRowsBottom.Add(item1); CargarEntidades(); LimpiarCampos(); LimpiarDatos(); CargarCContactos(); CalcularPuntos(); } catch (Exception) { throw; } }
public RadForm1() { InitializeComponent(); radGridView1.CreateCell += RadGridView1_CreateCell; radGridView1.DataSource = GetTable(); GridViewSummaryItem summaryItem = new GridViewSummaryItem(); summaryItem.Name = "Dosage"; summaryItem.Aggregate = GridAggregateFunction.Avg; GridViewSummaryRowItem summaryRowItem = new GridViewSummaryRowItem(); summaryRowItem.Add(summaryItem); this.radGridView1.SummaryRowsTop.Add(summaryRowItem); radGridView1.TableElement.RowHeight = 60; radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill; }
private void SetUpLaporanPenjualan() { //Update Data //string sQuery = "Select ProductShortChild,sum(ConvValue) as Jumlah,sum(convValue*targetquantifier) as Target From vLogOtherReport where salesid = " + dtSales_["salesid"].ToString() // + " and (tanggal between '" // + DateTime.Parse(dtBulan_["startdate"].ToString()).ToString("yyyy-MM-dd") // + "' and '" // + DateTime.Parse(dtBulan_["enddate"].ToString()).ToString("yyyy-MM-dd") + "')" // + " and logpelid <> -1 " // + " and tipeid = 1 and others = 0" // + " group by productshortchild" // + " order by productShortChild"; string sQuery = "call pGetPenjualanSales(" + dtSales_["salesid"].ToString() + ",'" + DateTime.Parse(dtBulan_["startdate"].ToString()).ToString("yyyy-MM-dd") + "' , '" + DateTime.Parse(dtBulan_["enddate"].ToString()).ToString("yyyy-MM-dd") + "')"; MySqlDataAdapter adapt = new MySqlDataAdapter(sQuery , ConfigurationManager.ConnectionStrings["NB.Properties.Settings.sinarekConnectionString"].ConnectionString); DataTable dt = new DataTable("Data"); adapt.Fill(dt); radGridView4.Columns.Clear(); radGridView4.DataSource = dt; radGridView4.ReadOnly = true; radGridView4.Columns["ProductShortChild"].HeaderText = "Barang"; radGridView4.Columns["ProductShortChild"].Width = 75; radGridView4.Columns["Target"].HeaderText = "Target"; radGridView4.Columns["Target"].Width = 75; radGridView4.Columns["Target"].FormatString = "{0:n2}"; radGridView4.Columns["Jumlah"].HeaderText = "Jumlah"; radGridView4.Columns["Jumlah"].Width = 100; radGridView4.Columns["Jumlah"].FormatString = "{0:n2}"; if (radGridView4.SummaryRowsTop.Count == 0) { GridViewSummaryRowItem summ = new GridViewSummaryRowItem(); summ.Add(new GridViewSummaryItem("Jumlah", "Total : ", GridAggregateFunction.Sum)); summ.Add(new GridViewSummaryItem("Target", "{0:n2}", GridAggregateFunction.Sum)); radGridView4.SummaryRowsTop.Add(summ); } }
private void LoadFreightSummary() { this.radGridViewDemo.MasterTemplate.AutoExpandGroups = true; this.radGridViewDemo.MasterTemplate.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill; this.radGridViewDemo.GroupDescriptors.Clear(); this.radGridViewDemo.GroupDescriptors.Add(new GridGroupByExpression("CustomerID Group By CustomerID")); GridViewSummaryRowItem item1 = new GridViewSummaryRowItem(); item1.Add(new GridViewSummaryItem("Freight", "Sum: {0:F2}; ", GridAggregateFunction.Sum)); this.radGridViewDemo.MasterTemplate.SummaryRowsBottom.Add(item1); GridViewSummaryRowItem item2 = new GridViewSummaryRowItem(); item2.Add(new GridViewSummaryItem("Freight", "Min: {0:F2}", GridAggregateFunction.Min)); this.radGridViewDemo.MasterTemplate.SummaryRowsTop.Add(item2); }
private void Form1_Load(object sender, EventArgs e) { this.PrepareGrid(this.gridBasket); this.gridBasket.Rows.Add(this.imageList1.Images[0], "Banana", "Ecuador", 50); this.gridBasket.Rows.Add(this.imageList1.Images[1], "Eggplant", "Turkey", 5); GridViewSummaryRowItem summaryItem = new GridViewSummaryRowItem(); summaryItem.Add(new GridViewSummaryItem("Price", "Total {0:c}", GridAggregateFunction.Sum)); this.gridBasket.MasterTemplate.SummaryRowsBottom.Add(summaryItem); this.PrepareGrid(this.gridViewProducts); this.gridViewProducts.Rows.Add(this.imageList1.Images[2], "Mushroom", "Ecuador", 20); this.gridViewProducts.Rows.Add(this.imageList1.Images[3], "Onion", "Italy", 30); this.gridViewProducts.Rows.Add(this.imageList1.Images[4], "Pear", "China", 100); this.gridViewProducts.Rows.Add(this.imageList1.Images[5], "Watermelon", "Bulgaria", 10); }
private void loadList() { IPaymentService payService = new PaymentService(); if (IDnum == "All") { payment = new List <Payment>(payService.GetAllPayments()); } else { payment = new List <Payment>(payService.GetAllStudentsPayments(IDnum)); } gridView.DataSource = payment; GroupDescriptor descriptor = new GroupDescriptor(); descriptor.GroupNames.Add("Student", ListSortDirection.Ascending); this.gridView.GroupDescriptors.Add(descriptor); GridViewSummaryItem summaryItem; if (IDnum != "All") { summaryItem = new GridViewSummaryItem("Amount", "Total: {0} Balance: " + payment[0].Balance, GridAggregateFunction.Sum); } else { summaryItem = new GridViewSummaryItem("Amount", "Total: {0}", GridAggregateFunction.Sum); } GridViewSummaryRowItem summaryRowItem = new GridViewSummaryRowItem(); summaryRowItem.Add(summaryItem); this.gridView.SummaryRowsBottom.Add(summaryRowItem); }
private void frmCapturaPedidos_Load(object sender, EventArgs e) { try { /* GRUPO POR TIPO Y ENTIDAD */ GroupDescriptor tipo = new GroupDescriptor(); tipo.GroupNames.Add("Tipo", ListSortDirection.Ascending); tipo.GroupNames.Add("Entidad", ListSortDirection.Ascending); this.gvDatos.GroupDescriptors.Add(tipo); /* SUMA DE TOTALES */ GridViewSummaryItem summaryItem = new GridViewSummaryItem("Total", "{0:C2}", GridAggregateFunction.Sum); GridViewSummaryRowItem summaryRowItem = new GridViewSummaryRowItem(); summaryRowItem.Add(summaryItem); this.gvDatos.SummaryRowsBottom.Add(summaryRowItem); this.gvDatos.MasterTemplate.ShowTotals = true; } catch (Exception ex) { RadMessageBox.Show("Ocurrió un error al cargar la pantalla\n" + ex.Message, this.Text, MessageBoxButtons.OK, RadMessageIcon.Error); } }
private void frmInputUJ_Load(object sender, EventArgs e) { // TODO: This line of code loads data into the 'sinarekDataSet.kota' table. You can move, or remove it, as needed. this.kotaTableAdapter.Fill(this.sinarekDataSet.kota); // TODO: This line of code loads data into the 'sinarekDataSet.vproductbase' table. You can move, or remove it, as needed. this.vproductbaseTableAdapter.Fill(this.sinarekDataSet.vproductbase); // TODO: This line of code loads data into the 'sinarekDataSet.logother' table. You can move, or remove it, as needed. this.logotherTableAdapter.FillByTipeLap(this.sinarekDataSet.logother, int.Parse(ujid_) , int.Parse(row_["logid"].ToString()) , int.Parse(lappenid_)); InitialiazeButtons(); GridViewSummaryRowItem summaryRowItem2 = new GridViewSummaryRowItem(); GridViewSummaryItem summaryItem = new GridViewSummaryItem(); summaryItem.Name = "Detail3"; summaryItem.FormatString = "Sisa Uang Jalan :"; summaryItem.Aggregate = GridAggregateFunction.Last; summaryRowItem2.Add(summaryItem); GridViewSummaryItem summaryItem2 = new GridViewSummaryItem(); summaryItem2.Name = "Total"; summaryItem2.FormatString = "{0:Rp #,###.00}"; summaryItem2.AggregateExpression = value_.ToString() + " - Sum(Total)"; summaryRowItem2.Add(summaryItem2); this.radGridView2.SummaryRowsTop.Add(summaryRowItem2); GridViewSummaryRowItem summaryRowItem = new GridViewSummaryRowItem(); GridViewSummaryItem summaryItem3 = new GridViewSummaryItem(); summaryItem3.Name = "Total"; summaryItem3.FormatString = "{0:Rp #,###.00}"; summaryItem3.Aggregate = GridAggregateFunction.Sum; summaryRowItem.Add(summaryItem3); GridViewSummaryItem summaryItem4 = new GridViewSummaryItem(); summaryItem4.Name = "Detail3"; summaryItem4.FormatString = "Total Biaya :"; summaryItem4.Aggregate = GridAggregateFunction.Sum; summaryRowItem.Add(summaryItem4); this.radGridView2.SummaryRowsTop.Add(summaryRowItem); }
private void AddSummaries() { //master template GridViewSummaryRowItem item1 = new GridViewSummaryRowItem(); GridViewSummaryRowItem item2 = new GridViewSummaryRowItem(); item1.Add(new GridViewSummaryItem("OrderID", "Count: {0}", GridAggregateFunction.Count)); item2.Add(new GridViewSummaryItem("Freight", "Max: {0}", GridAggregateFunction.Max)); this.radGridView1.MasterTemplate.SummaryRowsTop.Add(item1); this.radGridView1.MasterTemplate.SummaryRowsBottom.Add(item2); //child template GridViewSummaryRowItem item3 = new GridViewSummaryRowItem(); GridViewSummaryRowItem item4 = new GridViewSummaryRowItem(); item3.Add(new GridViewSummaryItem("UnitPrice", "Avg: {0:c}", GridAggregateFunction.Avg)); item4.Add(new GridViewSummaryItem("Quantity", "Sum: {0}", GridAggregateFunction.Sum)); this.radGridView1.MasterTemplate.Templates[0].SummaryRowsTop.Add(item3); this.radGridView1.MasterTemplate.Templates[0].SummaryRowsBottom.Add(item4); }
private void frmPerfil_Load(object sender, EventArgs e) { try { GroupDescriptor descriptor = new GroupDescriptor(); descriptor.GroupNames.Add("Grupo", ListSortDirection.Ascending); grdDatos.GroupDescriptors.Add(descriptor); // Summatoria de datos GridViewSummaryRowItem item1 = new GridViewSummaryRowItem(); item1.Add(new GridViewSummaryItem("Total", "Total: {0:N2}", GridAggregateFunction.Sum)); this.grdDatos.SummaryRowsBottom.Add(item1); LimpiarCampos(); CargarEntidades(); CargarEducacion(); CargarCompetencias(); CargarGrid(); CalcularPuntos(); } catch (Exception ex) { RadMessageBox.Show("Ocurrió un error al cargar la pantalla\n" + ex.Message, this.Text, MessageBoxButtons.OK, RadMessageIcon.Error); } }
public BillingView(int patientid) { InitializeComponent(); try { radBillDate.Value = DateTime.Now; FromDate.Value = DateTime.Now; ToDate.Value = DateTime.Now; GridViewSummaryRowItem countAmount = new GridViewSummaryRowItem(); countAmount.Add(new GridViewSummaryItem() { Aggregate = GridAggregateFunction.Sum, FormatString = "Total Debit = {0}", //FieldName = "Debit", Name = "Debit" }); countAmount.Add(new GridViewSummaryItem() { Aggregate = GridAggregateFunction.Sum, FormatString = "Total Credit = {0}", //FieldName = "Credit", Name = "Credit" }); this.FinanceGrid.SummaryRowsBottom.Add(countAmount); FillGrid(); this.FinanceGrid.Columns["BillingDate"].FormatString = "{0:dd/MMM/yyyy}"; } catch (Exception x) { FileLogger.LogError(x); } }
private void radButton1_Click(object sender, System.EventArgs e) { GridViewSummaryRowItem item = null; string formatString = string.Empty; bool updated = false; switch (this.radComboPosition.SelectedIndex) { case 0: item = CollectionItem( this.radGridViewDemo.MasterTemplate.SummaryRowGroupHeaders, 0, out updated); formatString = string.Format("{2} of {0}: {1}; ", radComboColumn.SelectedItem.Text, "{0}", (GridAggregateFunction)radComboFunction.SelectedIndex); break; case 1: item = CollectionItem( this.radGridViewDemo.MasterTemplate.SummaryRowsTop, this.radComboBox3.SelectedIndex, out updated ); if (updated) { RebuildComboBoxItems(this.radComboBox3, this.radGridViewDemo.MasterTemplate.SummaryRowsTop.Count); } formatString = string.Format("{0}: {1}; ", (GridAggregateFunction)radComboFunction.SelectedIndex, "{0}"); break; case 2: item = CollectionItem( this.radGridViewDemo.MasterTemplate.SummaryRowsBottom, this.radComboBox3.SelectedIndex, out updated ); if (updated) { RebuildComboBoxItems(this.radComboBox3, this.radGridViewDemo.MasterTemplate.SummaryRowsBottom.Count); } formatString = string.Format("{0}: {1}; ", (GridAggregateFunction)radComboFunction.SelectedIndex, "{0}"); break; } if (item == null) { return; } string fieldName = radComboColumn.SelectedItem.Text; item.Add(new GridViewSummaryItem( fieldName, formatString, (GridAggregateFunction)radComboFunction.SelectedIndex )); }
private void InitializeSetGridView() { this.rgv_GetData.Dock = DockStyle.Fill; // this.rgv_GetData.ReadOnly = true; this.rgv_GetData.AutoGenerateColumns = true; this.rgv_GetData.EnableFiltering = false; this.rgv_GetData.AllowAddNewRow = false; this.rgv_GetData.MasterTemplate.AutoGenerateColumns = false; this.rgv_GetData.ShowGroupedColumns = true; this.rgv_GetData.MasterTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill; this.rgv_GetData.EnableHotTracking = true; this.rgv_GetData.AutoSizeRows = true; GridViewSummaryRowItem summary = new GridViewSummaryRowItem(); summary.Add(new GridViewSummaryItem("SUPC", "{0:N2}", GridAggregateFunction.Sum)); this.rgv_GetData.MasterTemplate.SummaryRowsBottom.Add(summary); }
private void ProcessComission() { //Update Data string sQuery = "call pGetCommision(" + dtSales_["salesid"].ToString() + ",'" + DateTime.Parse(dtBulan_["startdate"].ToString()).ToString("yyyy-MM-dd") + "' , '" + DateTime.Parse(dtBulan_["enddate"].ToString()).ToString("yyyy-MM-dd") + "')"; MySqlDataAdapter adapt = new MySqlDataAdapter(sQuery , ConfigurationManager.ConnectionStrings["NB.Properties.Settings.sinarekConnectionString"].ConnectionString); DataTable dt = new DataTable("Data"); adapt.Fill(dt); radGridView2.Columns.Clear(); radGridView2.DataSource = dt; radGridView2.ReadOnly = true; radGridView2.Columns["ProductShortChild"].HeaderText = "Barang"; radGridView2.Columns["ProductShortChild"].Width = 75; radGridView2.Columns["DalamKota"].HeaderText = "DK"; radGridView2.Columns["Credit"].HeaderText = "Credit"; radGridView2.Columns["Target"].HeaderText = "Target"; radGridView2.Columns["Target"].Width = 100; radGridView2.Columns["Target"].FormatString = "{0:n2}"; radGridView2.Columns["Jumlah"].HeaderText = "Jumlah"; radGridView2.Columns["Jumlah"].Width = 100; radGridView2.Columns["Jumlah"].FormatString = "{0:n2}"; radGridView2.Columns["Komisi"].HeaderText = "Komisi"; radGridView2.Columns["Komisi"].Width = 100; radGridView2.Columns["Komisi"].FormatString = "{0:Rp #,##.##}"; radGridView2.Columns["JumlahKomisi"].HeaderText = "Hasil"; radGridView2.Columns["JumlahKomisi"].Width = 150; radGridView2.Columns["JumlahKomisi"].FormatString = "{0:Rp #,##0.00}"; if (radGridView2.SummaryRowsTop.Count == 0) { //Hard Coded decimal multiplier = 0.85M; if (percent_ == -1M) { multiplier = 1M; } else if (percent_ < 1) { multiplier = 0.85M; } else if (percent_ >= 1M && percent_ < 1.2M) { multiplier = 1M; } else { multiplier = 1.2M; } //< 100 % , JK * 0.85 //> 100 % and < 120 %, JK * 1 //> 120 % , JK * 120 % //Get Multiplier GridViewSummaryRowItem summ = new GridViewSummaryRowItem(); summ.Add(new GridViewSummaryItem("Target", "Total Bayar : x" + multiplier.ToString("n2"), GridAggregateFunction.Sum)); summ.Add(new GridViewSummaryItem("JumlahKomisi", "{0:Rp #,##0.00}", "sum(jumlahkomisi)*" + multiplier.ToString())); GridViewSummaryRowItem summ2 = new GridViewSummaryRowItem(); summ2.Add(new GridViewSummaryItem("Target", "Total :", GridAggregateFunction.Sum)); summ2.Add(new GridViewSummaryItem("JumlahKomisi", "{0:Rp #,##0.00}", GridAggregateFunction.Sum)); radGridView2.SummaryRowsTop.Add(summ); radGridView2.SummaryRowsTop.Add(summ2); } }
private void LoadDef() { using (var db = new DataClasses1DataContext()) { int yy = 2018; while (yy <= DateTime.Now.Year + 3) { cbbYY.Items.Add(yy.ToSt()); yy++; } cbbYY.Text = DateTime.Now.Year.ToSt(); //cbbMonth.Items.Add(""); int mm = 1; while (mm <= 12) { DateTime dTemp = new DateTime(yy, mm, 1); cbbMM.Items.Add(dTemp.ToString("MMM")); cbbMM2.Items.Add(dTemp.ToString("MMM")); mm++; } cbbMM.SelectedIndex = DateTime.Now.Month - 1; cbbMM2.SelectedIndex = DateTime.Now.Month - 1; var item = db.mh_Items.Where(x => x.Active && x.InventoryGroup == "FG") .Select(x => new ItemCombo { Item = x.InternalNo, ItemName = x.InternalName }).ToList(); item.Add(new ItemCombo { Item = "", ItemName = "" }); item = item.OrderBy(x => x.Item).ToList(); cbbItem.AutoSizeDropDownToBestFit = true; cbbItem.DisplayMember = "ItemName"; cbbItem.ValueMember = "Item"; cbbItem.DataSource = item; cbbItem.AutoCompleteMode = AutoCompleteMode.SuggestAppend; var Customers = db.mh_Customers.Where(x => x.Active) .Select(x => new CustomerCombo { No = x.No, Name = x.Name }).ToList(); Customers.Add(new CustomerCombo { No = "", Name = "", }); Customers = Customers.OrderBy(x => x.No).ToList(); cbbCSTM.AutoSizeDropDownToBestFit = true; cbbCSTM.DisplayMember = "Name"; cbbCSTM.ValueMember = "No"; cbbCSTM.DataSource = Customers; cbbCSTM.AutoCompleteMode = AutoCompleteMode.SuggestAppend; var sumaryRow = new GridViewSummaryRowItem(); dgvData.SummaryRowsBottom.Add(sumaryRow); dgvData.MasterTemplate.ShowTotals = true; var sum2 = new GridViewSummaryItem("Summary", "{0:N2}", GridAggregateFunction.Sum); sumaryRow.Add(sum2); //Default Column Month int im = 1; do { DateTime dTemp = new DateTime(2018, im, 1); dgvData.Columns.Insert(5 + im - 1, new GridViewDecimalColumn { Name = dTemp.ToString("MMM"), FieldName = dTemp.ToString("MMM"), HeaderText = dTemp.ToString("MMM"), FormatString = "{0:N2}", TextAlignment = ContentAlignment.MiddleRight, Width = 80, }); var sum1 = new GridViewSummaryItem(dTemp.ToString("MMM"), "{0:N2}", GridAggregateFunction.Sum); sumaryRow.Add(sum1); im++; } while (im <= 12); } }
private void InitializeSetGridView() { this.rgv_INVOICEID.ReadOnly = true; this.rgv_INVOICEID.AutoGenerateColumns = true; this.rgv_INVOICEID.AllowAddNewRow = false; this.rgv_INVOICEID.AllowDeleteRow = false; this.rgv_INVOICEID.AllowEditRow = false; this.rgv_INVOICEID.ShowGroupPanel = false; this.rgv_INVOICEID.EnableFiltering = false; this.rgv_INVOICEID.ShowGroupedColumns = true; this.rgv_INVOICEID.EnableCustomGrouping = false; this.rgv_INVOICEID.EnableCustomFiltering = false; this.rgv_INVOICEID.MasterTemplate.AutoGenerateColumns = false; this.rgv_INVOICEID.MasterTemplate.AllowCellContextMenu = false; this.rgv_INVOICEID.MasterTemplate.AllowColumnHeaderContextMenu = false; this.rgv_INVOICEID.MasterTemplate.EnableCustomGrouping = false; this.rgv_INVOICEID.MasterTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill; this.rgv_INVOICEID.EnableHotTracking = true; this.rgv_INVOICEID.AutoSizeRows = true; GridViewSummaryRowItem sumsaleprice = new GridViewSummaryRowItem(); sumsaleprice.Add(new GridViewSummaryItem("SALESPRICE", "{0:N2}", GridAggregateFunction.Sum)); this.rgv_INVOICEID.MasterTemplate.SummaryRowsBottom.Add(sumsaleprice); this.rgv_GetData.ReadOnly = true; this.rgv_GetData.AutoGenerateColumns = true; this.rgv_GetData.EnableFiltering = false; this.rgv_GetData.AllowAddNewRow = false; this.rgv_GetData.MasterTemplate.AutoGenerateColumns = false; this.rgv_GetData.ShowGroupedColumns = true; this.rgv_GetData.MasterTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill; this.rgv_GetData.EnableHotTracking = true; this.rgv_GetData.AutoSizeRows = true; GridViewSummaryRowItem summary = new GridViewSummaryRowItem(); summary.Add(new GridViewSummaryItem("SUPC", "{0:N2}", GridAggregateFunction.Sum)); this.rgv_GetData.MasterTemplate.SummaryRowsBottom.Add(summary); }
private void RefreshAll() { this.radGridView1.SummaryRowsBottom.Clear(); // TODO: This line of code loads data into the 'sinarekDataSet.vbotolkotor' table. You can move, or remove it, as needed. this.vbotolkotorTableAdapter.FillByTanggal(this.sinarekDataSet.vbotolkotor, dtpTanggal.Value); sinarekDataSet.vbotolkotorDataTable tbl = new sinarekDataSet.vbotolkotorDataTable(); this.vbotolkotorTableAdapter.FillByTipeTanggal(tbl, dtpTanggal.Value, "AWAL"); radGridView2.DataSource = tbl; if (radGridView2.Rows.Count == 1 && radGridView1.Rows.Count > 0) { string K100, K99, K98, K16, BTL, Total; K100 = radGridView2.Rows[0].Cells["K100"].Value.ToString(); K99 = radGridView2.Rows[0].Cells["K99"].Value.ToString(); K98 = radGridView2.Rows[0].Cells["K98"].Value.ToString(); K16 = radGridView2.Rows[0].Cells["K16"].Value.ToString(); BTL = radGridView2.Rows[0].Cells["BTL"].Value.ToString(); Total = radGridView2.Rows[0].Cells["Total"].Value.ToString(); GridViewSummaryRowItem summaryRowItem = new GridViewSummaryRowItem(); GridViewSummaryItem summaryItem = new GridViewSummaryItem(); summaryItem.Name = "K100"; summaryItem.FormatString = "{0:#,###}"; summaryItem.AggregateExpression = K100.ToString() + " + Sum(K100)"; summaryRowItem.Add(summaryItem); GridViewSummaryItem summaryItem2 = new GridViewSummaryItem(); summaryItem2.Name = "K98"; summaryItem2.FormatString = "{0:#,###}"; summaryItem2.AggregateExpression = K98.ToString() + " + Sum(K99) + Sum(K98)"; summaryRowItem.Add(summaryItem2); GridViewSummaryItem summaryItem9 = new GridViewSummaryItem(); summaryItem9.Name = "K16"; summaryItem9.FormatString = "{0:#,###}"; summaryItem9.AggregateExpression = "(" + K16 + "*16) + " + " Sum(K16*16) + Sum(BTL) + " + BTL; summaryRowItem.Add(summaryItem9); GridViewSummaryItem summaryItem4 = new GridViewSummaryItem(); summaryItem4.Name = "BTL"; summaryItem4.AggregateExpression = "0"; summaryRowItem.Add(summaryItem4); GridViewSummaryItem summaryItem5 = new GridViewSummaryItem(); summaryItem5.Name = "NoSJ"; summaryItem5.Aggregate = GridAggregateFunction.Last; summaryItem5.FormatString = "AKHIR"; summaryRowItem.Add(summaryItem5); GridViewSummaryItem summaryItem8 = new GridViewSummaryItem(); summaryItem8.Name = "Total"; summaryItem8.Aggregate = GridAggregateFunction.Sum; summaryItem8.FormatString = "{0:#,###}"; summaryRowItem.Add(summaryItem8); this.radGridView1.SummaryRowsBottom.Add(summaryRowItem); int val = 0 , div = 0 , rem = 0; try { GridViewSummaryItem summaryItem3 = radGridView1.SummaryRowsBottom[0][2]; string value = summaryItem3.Evaluate(radGridView1.MasterTemplate).ToString(); val = int.Parse(value.Split('.')[0]); div = Math.DivRem(val, 16, out rem); summaryItem3.AggregateExpression = div.ToString(); summaryItem4.AggregateExpression = rem.ToString(); } catch (Exception ex) { RadMessageBox.Show(ex.Message + " : " + ex.StackTrace, "SMS - Error"); } GridViewSummaryRowItem summaryRowItem2 = new GridViewSummaryRowItem(); GridViewSummaryItem summaryItem6 = new GridViewSummaryItem(); summaryItem6.Name = "K100"; summaryItem6.AggregateExpression = Total + " + ((Sum(K100)*100)" + " + ((Sum(K99) + Sum(K98))* 98)" + " + (Sum(K16)*16)" + " + Sum(BTL))"; summaryItem6.FormatString = "{0:#,###}"; summaryRowItem2.Add(summaryItem6); GridViewSummaryItem summaryItem7 = new GridViewSummaryItem(); summaryItem7.Name = "NoSJ"; summaryItem7.Aggregate = GridAggregateFunction.Last; summaryItem7.FormatString = "TOTAL BTL :"; summaryRowItem2.Add(summaryItem7); this.radGridView1.SummaryRowsBottom.Add(summaryRowItem2); } }
void SetGridView() { this.rgv_GetData.Dock = DockStyle.Fill; this.rgv_GetData.ReadOnly = true; this.rgv_GetData.AutoGenerateColumns = true; this.rgv_GetData.EnableFiltering = false; this.rgv_GetData.AllowAddNewRow = false; this.rgv_GetData.MasterTemplate.AutoGenerateColumns = false; this.rgv_GetData.ShowGroupedColumns = true; this.rgv_GetData.MasterTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill; this.rgv_GetData.EnableHotTracking = true; this.rgv_GetData.AutoSizeRows = true; GridViewSummaryRowItem summary = new GridViewSummaryRowItem(); summary.Add(new GridViewSummaryItem("JOBS", "{0:N2}", GridAggregateFunction.Sum)); summary.Add(new GridViewSummaryItem("BROKERS", "{0:N2}", GridAggregateFunction.Sum)); summary.Add(new GridViewSummaryItem("CENTER", "{0:N2}", GridAggregateFunction.Sum)); summary.Add(new GridViewSummaryItem("MIMIGRATION", "{0:N2}", GridAggregateFunction.Sum)); summary.Add(new GridViewSummaryItem("HOSPITAL", "{0:N2}", GridAggregateFunction.Sum)); summary.Add(new GridViewSummaryItem("DISTRICT", "{0:N2}", GridAggregateFunction.Sum)); summary.Add(new GridViewSummaryItem("SUMPAY", "{0:N2}", GridAggregateFunction.Sum)); summary.Add(new GridViewSummaryItem("SUPC", "{0:N2}", GridAggregateFunction.Sum)); summary.Add(new GridViewSummaryItem("TOTAL", "{0:N2}", GridAggregateFunction.Sum)); this.rgv_GetData.MasterTemplate.SummaryRowsBottom.Add(summary); }
private void InitializeGridView() { rgv_Payment.Dock = DockStyle.Fill; rgv_Payment.AutoGenerateColumns = true; rgv_Payment.EnableFiltering = false; rgv_Payment.AllowAddNewRow = false; rgv_Payment.MasterTemplate.AutoGenerateColumns = false; rgv_Payment.ShowGroupedColumns = true; rgv_Payment.MasterTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill; rgv_Payment.EnableHotTracking = true; rgv_Payment.AutoSizeRows = true; GridViewTextBoxColumn EMPLID = new GridViewTextBoxColumn(); EMPLID.Name = "EMPLID"; EMPLID.FieldName = "EMPLID"; EMPLID.HeaderText = "พนักงาน"; EMPLID.IsVisible = true; EMPLID.ReadOnly = true; EMPLID.BestFit(); rgv_Payment.Columns.Add(EMPLID); GridViewTextBoxColumn PAYID = new GridViewTextBoxColumn(); PAYID.Name = "PAYID"; PAYID.FieldName = "PAYID"; PAYID.HeaderText = "ID"; PAYID.IsVisible = true; PAYID.ReadOnly = true; PAYID.BestFit(); rgv_Payment.Columns.Add(PAYID); GridViewTextBoxColumn PAYNAME = new GridViewTextBoxColumn(); PAYNAME.Name = "PAYNAME"; PAYNAME.FieldName = "PAYNAME"; PAYNAME.HeaderText = "รายการ"; PAYNAME.IsVisible = true; PAYNAME.ReadOnly = true; PAYNAME.BestFit(); rgv_Payment.Columns.Add(PAYNAME); GridViewTextBoxColumn JOBS = new GridViewTextBoxColumn(); JOBS.Name = "JOBS"; JOBS.FieldName = "JOBS"; JOBS.HeaderText = "จัดหางาน"; JOBS.IsVisible = true; JOBS.ReadOnly = true; JOBS.BestFit(); rgv_Payment.Columns.Add(JOBS); GridViewTextBoxColumn BROKERS = new GridViewTextBoxColumn(); BROKERS.Name = "BROKERS"; BROKERS.FieldName = "BROKERS"; BROKERS.HeaderText = "โบรกเกอร์"; BROKERS.IsVisible = true; BROKERS.ReadOnly = true; BROKERS.BestFit(); rgv_Payment.Columns.Add(BROKERS); GridViewTextBoxColumn CENTER = new GridViewTextBoxColumn(); CENTER.Name = "CENTER"; CENTER.FieldName = "CENTER"; CENTER.HeaderText = "ศูนย์พูนผล"; CENTER.IsVisible = true; CENTER.ReadOnly = true; CENTER.BestFit(); rgv_Payment.Columns.Add(CENTER); GridViewTextBoxColumn MIMIGRATION = new GridViewTextBoxColumn(); MIMIGRATION.Name = "MIMIGRATION"; MIMIGRATION.FieldName = "MIMIGRATION"; MIMIGRATION.HeaderText = "ตม."; MIMIGRATION.IsVisible = true; MIMIGRATION.ReadOnly = true; MIMIGRATION.BestFit(); rgv_Payment.Columns.Add(MIMIGRATION); GridViewTextBoxColumn HOSPITAL = new GridViewTextBoxColumn(); HOSPITAL.Name = "HOSPITAL"; HOSPITAL.FieldName = "HOSPITAL"; HOSPITAL.HeaderText = "รพ."; HOSPITAL.IsVisible = true; HOSPITAL.ReadOnly = true; HOSPITAL.BestFit(); rgv_Payment.Columns.Add(HOSPITAL); GridViewTextBoxColumn DISTRICT = new GridViewTextBoxColumn(); DISTRICT.Name = "DISTRICT"; DISTRICT.FieldName = "DISTRICT"; DISTRICT.HeaderText = "อำเภอ."; DISTRICT.IsVisible = true; DISTRICT.ReadOnly = true; DISTRICT.BestFit(); rgv_Payment.Columns.Add(DISTRICT); GridViewTextBoxColumn SUMPAY = new GridViewTextBoxColumn(); SUMPAY.Name = "SUMPAY"; SUMPAY.FieldName = "SUMPAY"; SUMPAY.HeaderText = "รวม"; SUMPAY.IsVisible = true; SUMPAY.ReadOnly = true; SUMPAY.BestFit(); rgv_Payment.Columns.Add(SUMPAY); GridViewTextBoxColumn SUPC = new GridViewTextBoxColumn(); SUPC.Name = "SUPC"; SUPC.FieldName = "SUPC"; SUPC.HeaderText = "เข้าบริษัท"; SUPC.IsVisible = true; SUPC.ReadOnly = true; SUPC.BestFit(); rgv_Payment.Columns.Add(SUPC); GridViewTextBoxColumn TOTAL = new GridViewTextBoxColumn(); TOTAL.Name = "TOTAL"; TOTAL.FieldName = "TOTAL"; TOTAL.HeaderText = "ยอดเรียกเก็บ"; TOTAL.IsVisible = true; TOTAL.ReadOnly = true; TOTAL.BestFit(); rgv_Payment.Columns.Add(TOTAL); GridViewCommandColumn BTDELETE = new GridViewCommandColumn(); BTDELETE.Name = "BTDELETE"; BTDELETE.HeaderText = "ลบ"; BTDELETE.Width = 100; rgv_Payment.Columns.Add(BTDELETE); GridViewSummaryRowItem summary = new GridViewSummaryRowItem(); summary.Add(new GridViewSummaryItem("JOBS", "{0:N2}", GridAggregateFunction.Sum)); summary.Add(new GridViewSummaryItem("BROKERS", "{0:N2}", GridAggregateFunction.Sum)); summary.Add(new GridViewSummaryItem("CENTER", "{0:N2}", GridAggregateFunction.Sum)); summary.Add(new GridViewSummaryItem("MIMIGRATION", "{0:N2}", GridAggregateFunction.Sum)); summary.Add(new GridViewSummaryItem("HOSPITAL", "{0:N2}", GridAggregateFunction.Sum)); summary.Add(new GridViewSummaryItem("DISTRICT", "{0:N2}", GridAggregateFunction.Sum)); summary.Add(new GridViewSummaryItem("SUMPAY", "{0:N2}", GridAggregateFunction.Sum)); summary.Add(new GridViewSummaryItem("SUPC", "{0:N2}", GridAggregateFunction.Sum)); summary.Add(new GridViewSummaryItem("TOTAL", "{0:N2}", GridAggregateFunction.Sum)); this.rgv_Payment.MasterTemplate.SummaryRowsBottom.Add(summary); }
private void AddSummaries() { this.grdLister.MasterGridViewTemplate.SummaryRowsBottom.Clear(); GridViewSummaryRowItem item2 = new GridViewSummaryRowItem(); GridViewSummaryItem c = new GridViewSummaryItem(); c.Aggregate = GridAggregateFunction.None; c.Name = "DriverNo"; c.AggregateExpression = "SUM(Rent)"; c.FormatString = "Total"; item2.Add(c); // item2.Add(new GridViewSummaryItem("DriverNo", "Total", GridAggregateFunction.None)); c = new GridViewSummaryItem(); c.Aggregate = GridAggregateFunction.Sum; c.AggregateExpression = "SUM(" + COLS.PaidRent + ")"; c.Name = COLS.Rent; c.FormatString = "{0}"; item2.Add(c); c = new GridViewSummaryItem(); c.Aggregate = GridAggregateFunction.Sum; c.AggregateExpression = "SUM(" + COLS.PaidPreviousBalance + ")"; c.Name = COLS.PreviousBalance; c.FormatString = "{0}"; item2.Add(c); c = new GridViewSummaryItem(); c.Aggregate = GridAggregateFunction.Sum; c.AggregateExpression = "SUM(" + COLS.PaidCollection + ")"; c.Name = COLS.Collection; c.FormatString = "{0}"; item2.Add(c); c = new GridViewSummaryItem(); c.Aggregate = GridAggregateFunction.Sum; c.AggregateExpression = "SUM(" + COLS.OldPaidCollection + ")"; c.Name = COLS.OldCollection; c.FormatString = "{0}"; item2.Add(c); c = new GridViewSummaryItem(); c.Aggregate = GridAggregateFunction.Sum; c.AggregateExpression = "SUM(" + COLS.PaidAgentCommission + ")"; c.Name = COLS.AgentCommission; c.FormatString = "{0}"; item2.Add(c); c = new GridViewSummaryItem(); c.Aggregate = GridAggregateFunction.Sum; c.AggregateExpression = "SUM(" + COLS.PaidOldAgentBalance + ")"; c.Name = COLS.OldAgentBalance; c.FormatString = "{0}"; item2.Add(c); c = new GridViewSummaryItem(); c.Aggregate = GridAggregateFunction.Sum; c.AggregateExpression = "SUM(" + COLS.PaidAdjustment + ")"; c.Name = COLS.Adjustment; c.FormatString = "{0}"; item2.Add(c); c = new GridViewSummaryItem(); c.Aggregate = GridAggregateFunction.Sum; c.AggregateExpression = "SUM(" + COLS.OldPaidAdjustment + ")"; c.Name = COLS.OldAdjustment; c.FormatString = "{0}"; item2.Add(c); c = new GridViewSummaryItem(); c.Aggregate = GridAggregateFunction.Sum; c.AggregateExpression = "SUM(" + COLS.PaidTotal + ")"; c.Name = COLS.Total; c.FormatString = "{0}"; item2.Add(c); //item2.Add(new GridViewSummaryItem("Rent", "{0}", GridAggregateFunction.Sum)); //item2.Add(new GridViewSummaryItem("Collection", "{0}", GridAggregateFunction.Sum)); //item2.Add(new GridViewSummaryItem("AgentCommission", "{0}", GridAggregateFunction.Sum)); //item2.Add(new GridViewSummaryItem("OldAgentBalance", "{0}", GridAggregateFunction.Sum)); // item2.Add(new GridViewSummaryItem(COLS.Adjustment, "{0}", GridAggregateFunction.Sum)); //// item2.Add(new GridViewSummaryItem(COLS.PreviousBalance, "{0}", GridAggregateFunction.Sum)); // item2.Add(new GridViewSummaryItem("Total", "{0}", GridAggregateFunction.Sum)); this.grdLister.MasterGridViewTemplate.SummaryRowsBottom.Add(item2); this.grdLister.MasterView.SummaryRows[0].PinPosition = PinnedRowPosition.Bottom; }
private void InitializeGrid() { ///<summary> ///Инициализирует поля сетки. ///Если коллекция операций в экземпляре формы не инициализированна - действия не происходят. /// </summary> if (this.Summaries == null) { return; } this.radGridView.DataSource = this.Summaries; this.radGridView.Columns["Id"].IsVisible = false; this.radGridView.Columns["RowVersion"].IsVisible = false; this.radGridView.Columns["ActionDate"].IsVisible = false; this.radGridView.Columns["CurrentRateUSD"].IsVisible = false; this.radGridView.Columns["CurrentEuroToDollarRate"].IsVisible = false; this.radGridView.Columns["UserLastChanged"].IsVisible = false; this.radGridView.Columns["ReadOnly"].IsVisible = false; //Упорядчивание столбцов this.radGridView.Columns.Move(this.radGridView.Columns["SummaryDate"].Index, 0); this.radGridView.Columns.Move(this.radGridView.Columns["CashFlowType"].Index, 1); this.radGridView.Columns.Move(this.radGridView.Columns["Project"].Index, 2); this.radGridView.Columns.Move(this.radGridView.Columns["Accountable"].Index, 3); this.radGridView.Columns.Move(this.radGridView.Columns["BudgetItem"].Index, 4); this.radGridView.Columns.Move(this.radGridView.Columns["SummaUAH"].Index, 5); this.radGridView.Columns.Move(this.radGridView.Columns["SummaUSD"].Index, 6); this.radGridView.Columns.Move(this.radGridView.Columns["SummaEuro"].Index, 7); this.radGridView.Columns.Move(this.radGridView.Columns["TotalSumma"].Index, 8); this.radGridView.Columns.Move(this.radGridView.Columns["Description"].Index, 9); //Настройка данных столбцов //Явное указание свойства привязки. Необходимо для корректной работы сортировки и группировки ассоциированных обьктов. this.radGridView.Columns["Accountable"].HeaderText = "Подотчетник"; this.radGridView.Columns["Accountable"].FieldName = "Accountable.AccountableName"; this.radGridView.Columns["BudgetItem"].HeaderText = "Статья"; this.radGridView.Columns["BudgetItem"].FieldName = "BudgetItem.ItemName"; this.radGridView.Columns["CashFlowType"].HeaderText = "Приход/Расход"; this.radGridView.Columns["Description"].HeaderText = "Расшифровка"; this.radGridView.Columns["Project"].HeaderText = "Проект"; this.radGridView.Columns["Project"].FieldName = "Project.ProjectName"; this.radGridView.Columns["ReadOnly"].HeaderText = "Только чтение"; this.radGridView.Columns["SummaUAH"].HeaderText = "Сумма, грн."; this.radGridView.Columns["SummaUAH"].FormatString = "{0:C}"; this.radGridView.Columns["SummaUSD"].FormatInfo = CultureInfo.CreateSpecificCulture("uk-UA"); this.radGridView.Columns["SummaUSD"].HeaderText = "Сумма, $"; this.radGridView.Columns["SummaUSD"].FormatString = "{0:C}"; this.radGridView.Columns["SummaUSD"].FormatInfo = CultureInfo.CreateSpecificCulture("en-US"); this.radGridView.Columns["SummaEuro"].HeaderText = "Сумма, ЕВРО"; this.radGridView.Columns["SummaEuro"].FormatString = "{0:C}"; this.radGridView.Columns["SummaEuro"].FormatInfo = CultureInfo.CreateSpecificCulture("fr-FR"); this.radGridView.Columns["TotalSumma"].HeaderText = "Итого, $"; this.radGridView.Columns["TotalSumma"].FormatString = "{0:C}"; this.radGridView.Columns["TotalSumma"].FormatInfo = CultureInfo.CreateSpecificCulture("en-US"); this.radGridView.Columns["SummaryDate"].HeaderText = "Дата"; this.radGridView.Columns["SummaryDate"].FormatString = "{0:d}"; this.radGridView.Columns["SummaryDate"].TextAlignment = ContentAlignment.MiddleRight; //Добавление итогов this.radGridView.MasterTemplate.ShowTotals = true; GridViewSummaryItem summaryItemCount = new GridViewSummaryItem(); summaryItemCount.Name = "SummaryDate"; summaryItemCount.Aggregate = GridAggregateFunction.Count; summaryItemCount.FormatString = "Итог, количество = {0}"; GridViewSummaryItem summaryItemUAH = new GridViewSummaryItem(); summaryItemUAH.Name = "SummaUAH"; summaryItemUAH.Aggregate = GridAggregateFunction.Sum; summaryItemUAH.FormatString = "Итог, грн. = {0:N2} грн."; GridViewSummaryItem summaryItemUSD = new GridViewSummaryItem(); summaryItemUSD.Name = "SummaUSD"; summaryItemUSD.Aggregate = GridAggregateFunction.Sum; summaryItemUSD.FormatString = "Итог, $ = ${0:N2}"; GridViewSummaryItem summaryItemEuro = new GridViewSummaryItem(); summaryItemEuro.Name = "SummaEuro"; summaryItemEuro.Aggregate = GridAggregateFunction.Sum; summaryItemEuro.FormatString = "Итог, ЕВРО = {0:N2} EUR"; GridViewSummaryItem summaryItemTotal = new GridViewSummaryItem(); summaryItemTotal.Name = "TotalSumma"; summaryItemTotal.Aggregate = GridAggregateFunction.Sum; summaryItemTotal.FormatString = "Итог, $ = ${0:N2}"; GridViewSummaryRowItem summaryRowItem = new GridViewSummaryRowItem(); summaryRowItem.Add(summaryItemCount); summaryRowItem.Add(summaryItemUAH); summaryRowItem.Add(summaryItemUSD); summaryRowItem.Add(summaryItemEuro); summaryRowItem.Add(summaryItemTotal); if (this.radGridView.SummaryRowsTop != null && this.radGridView.SummaryRowsTop.Count > 0) { this.radGridView.SummaryRowsTop.Clear(); } this.radGridView.SummaryRowsTop.Add(summaryRowItem); }
void InitializeGridView() { this.rgv_EmplData.Dock = DockStyle.Fill; this.rgv_EmplData.ReadOnly = true; this.rgv_EmplData.AutoGenerateColumns = true; this.rgv_EmplData.EnableFiltering = false; this.rgv_EmplData.AllowAddNewRow = false; this.rgv_EmplData.MasterTemplate.AutoGenerateColumns = false; this.rgv_EmplData.ShowGroupedColumns = true; this.rgv_EmplData.MasterTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill; this.rgv_EmplData.EnableHotTracking = true; this.rgv_EmplData.AutoSizeRows = true; GridViewTextBoxColumn PAYDESC = new GridViewTextBoxColumn(); PAYDESC.Name = "PAYDESC"; PAYDESC.FieldName = "PAYDESC"; PAYDESC.HeaderText = "รายการ"; PAYDESC.IsVisible = true; PAYDESC.ReadOnly = true; PAYDESC.BestFit(); rgv_EmplData.Columns.Add(PAYDESC); GridViewTextBoxColumn JOBS = new GridViewTextBoxColumn(); JOBS.Name = "JOBS"; JOBS.FieldName = "JOBS"; JOBS.HeaderText = "จัดหางาน"; JOBS.IsVisible = true; JOBS.ReadOnly = true; JOBS.BestFit(); rgv_EmplData.Columns.Add(JOBS); GridViewTextBoxColumn BROKERS = new GridViewTextBoxColumn(); BROKERS.Name = "BROKERS"; BROKERS.FieldName = "BROKERS"; BROKERS.HeaderText = "โบรกเกอร์"; BROKERS.IsVisible = true; BROKERS.ReadOnly = true; BROKERS.BestFit(); rgv_EmplData.Columns.Add(BROKERS); GridViewTextBoxColumn CENTER = new GridViewTextBoxColumn(); CENTER.Name = "CENTER"; CENTER.FieldName = "CENTER"; CENTER.HeaderText = "ศูนย์พูลผล"; CENTER.IsVisible = true; CENTER.ReadOnly = true; CENTER.BestFit(); rgv_EmplData.Columns.Add(CENTER); GridViewTextBoxColumn MIMIGRATION = new GridViewTextBoxColumn(); MIMIGRATION.Name = "MIMIGRATION"; MIMIGRATION.FieldName = "MIMIGRATION"; BROKERS.HeaderText = "ตม."; MIMIGRATION.IsVisible = true; MIMIGRATION.ReadOnly = true; MIMIGRATION.BestFit(); rgv_EmplData.Columns.Add(MIMIGRATION); GridViewTextBoxColumn HOSPITAL = new GridViewTextBoxColumn(); HOSPITAL.Name = "HOSPITAL"; HOSPITAL.FieldName = "HOSPITAL"; HOSPITAL.HeaderText = "รพ."; HOSPITAL.IsVisible = true; HOSPITAL.ReadOnly = true; HOSPITAL.BestFit(); rgv_EmplData.Columns.Add(HOSPITAL); GridViewTextBoxColumn DISTRICT = new GridViewTextBoxColumn(); DISTRICT.Name = "DISTRICT"; DISTRICT.FieldName = "DISTRICT"; DISTRICT.HeaderText = "อำเภอ"; DISTRICT.IsVisible = true; DISTRICT.ReadOnly = true; DISTRICT.BestFit(); rgv_EmplData.Columns.Add(DISTRICT); GridViewTextBoxColumn SUMPAY = new GridViewTextBoxColumn(); SUMPAY.Name = "SUMPAY"; SUMPAY.FieldName = "SUMPAY"; SUMPAY.HeaderText = "รวม"; SUMPAY.IsVisible = true; SUMPAY.ReadOnly = true; SUMPAY.BestFit(); rgv_EmplData.Columns.Add(SUMPAY); GridViewTextBoxColumn SUPC = new GridViewTextBoxColumn(); SUPC.Name = "SUPC"; SUPC.FieldName = "SUPC"; SUPC.HeaderText = "SUPC"; SUPC.IsVisible = true; SUPC.ReadOnly = true; SUPC.BestFit(); rgv_EmplData.Columns.Add(SUPC); GridViewTextBoxColumn TOTAL = new GridViewTextBoxColumn(); TOTAL.Name = "TOTAL"; TOTAL.FieldName = "TOTAL"; TOTAL.HeaderText = "ยอดเรียกเก็บ"; TOTAL.IsVisible = true; TOTAL.ReadOnly = true; TOTAL.BestFit(); rgv_EmplData.Columns.Add(TOTAL); GridViewSummaryRowItem summary = new GridViewSummaryRowItem(); summary.Add(new GridViewSummaryItem("JOBS", "{0:N2}", GridAggregateFunction.Sum)); summary.Add(new GridViewSummaryItem("BROKERS", "{0:N2}", GridAggregateFunction.Sum)); summary.Add(new GridViewSummaryItem("CENTER", "{0:N2}", GridAggregateFunction.Sum)); summary.Add(new GridViewSummaryItem("MIMIGRATION", "{0:N2}", GridAggregateFunction.Sum)); summary.Add(new GridViewSummaryItem("HOSPITAL", "{0:N2}", GridAggregateFunction.Sum)); summary.Add(new GridViewSummaryItem("DISTRICT", "{0:N2}", GridAggregateFunction.Sum)); summary.Add(new GridViewSummaryItem("SUMPAY", "{0:N2}", GridAggregateFunction.Sum)); summary.Add(new GridViewSummaryItem("SUPC", "{0:N2}", GridAggregateFunction.Sum)); summary.Add(new GridViewSummaryItem("TOTAL", "{0:N2}", GridAggregateFunction.Sum)); this.rgv_EmplData.MasterTemplate.SummaryRowsBottom.Add(summary); }
private void btnRunReport_Click(object sender, EventArgs e) { DataTable dt = new DataTable(); SqlConnection con = new SqlConnection("Data Source=hermes\\Routematch60;Initial Catalog=RM_MN_AEOA;Integrated Security=True"); con.Open(); SqlCommand myCmd = new SqlCommand("AEOA_UltraReport2", con); //SqlCommand myCmd = new SqlCommand("AEOA_HourlyNSE2", con); myCmd.CommandTimeout = 45; myCmd.CommandType = CommandType.StoredProcedure; myCmd.Parameters.AddWithValue("@ReportStartDateTime", dtpStartDate.Value); myCmd.Parameters.AddWithValue("@ReportEndDateTime", dtpEndDate.Value); myCmd.Parameters.AddWithValue("@areaname", cbArea.Text); myCmd.ExecuteNonQuery(); SqlDataAdapter da = new SqlDataAdapter(myCmd); da.Fill(dt); gridMain.DataSource = dt; gridMain.MasterTemplate.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill; GridViewSummaryItem summaryPointsItem = new GridViewSummaryItem(); summaryPointsItem.Name = "Points"; summaryPointsItem.Aggregate = GridAggregateFunction.Sum; GridViewSummaryItem summaryTotalMilesItem = new GridViewSummaryItem(); summaryTotalMilesItem.Name = "Total Miles"; summaryTotalMilesItem.Aggregate = GridAggregateFunction.Sum; GridViewSummaryItem summaryAdultItem = new GridViewSummaryItem(); summaryAdultItem.Name = "Adult"; summaryAdultItem.Aggregate = GridAggregateFunction.Sum; GridViewSummaryItem summaryElderlyItem = new GridViewSummaryItem(); summaryElderlyItem.Name = "Elderly"; summaryElderlyItem.Aggregate = GridAggregateFunction.Sum; GridViewSummaryItem summaryChildItem = new GridViewSummaryItem(); summaryChildItem.Name = "Child"; summaryChildItem.Aggregate = GridAggregateFunction.Sum; GridViewSummaryItem summaryDisabledItem = new GridViewSummaryItem(); summaryDisabledItem.Name = "Disabled"; summaryDisabledItem.Aggregate = GridAggregateFunction.Sum; GridViewSummaryItem summaryNonAmbItem = new GridViewSummaryItem(); summaryNonAmbItem.Name = "NonAmb"; summaryNonAmbItem.Aggregate = GridAggregateFunction.Sum; GridViewSummaryItem summaryStudentItem = new GridViewSummaryItem(); summaryStudentItem.Name = "Student"; summaryStudentItem.Aggregate = GridAggregateFunction.Sum; GridViewSummaryItem summaryTotalPassengersItem = new GridViewSummaryItem(); summaryTotalPassengersItem.Name = "Total Passengers"; summaryTotalPassengersItem.Aggregate = GridAggregateFunction.Sum; GridViewSummaryItem summaryCashItem = new GridViewSummaryItem(); summaryCashItem.Name = "People that paid cash"; summaryCashItem.Aggregate = GridAggregateFunction.Sum; GridViewSummaryItem summaryPassItem = new GridViewSummaryItem(); summaryPassItem.Name = "Pass"; summaryPassItem.Aggregate = GridAggregateFunction.Sum; GridViewSummaryItem summaryTicketItem = new GridViewSummaryItem(); summaryTicketItem.Name = "Ticket"; summaryTicketItem.Aggregate = GridAggregateFunction.Sum; GridViewSummaryItem summaryFreeItem = new GridViewSummaryItem(); summaryFreeItem.Name = "Free"; summaryFreeItem.Aggregate = GridAggregateFunction.Sum; GridViewSummaryRowItem summaryRowItem = new GridViewSummaryRowItem(); summaryRowItem.Add(summaryPointsItem); summaryRowItem.Add(summaryTotalMilesItem); summaryRowItem.Add(summaryAdultItem); summaryRowItem.Add(summaryElderlyItem); summaryRowItem.Add(summaryChildItem); summaryRowItem.Add(summaryDisabledItem); summaryRowItem.Add(summaryNonAmbItem); summaryRowItem.Add(summaryStudentItem); summaryRowItem.Add(summaryTotalPassengersItem); summaryRowItem.Add(summaryCashItem); summaryRowItem.Add(summaryPassItem); summaryRowItem.Add(summaryTicketItem); summaryRowItem.Add(summaryFreeItem); gridMain.SummaryRowsTop.Add(summaryRowItem); }
public void FillData() { for (int i = 0; i < columdNames.Length; i++) { dt.Columns.Add(columdNames[i], typeColums[i]); } dt.Columns.Add("DepartmentUser"); List <ReportProject> reportProjects = ReportRequests.CreateReportProjects(); DataTable dt2 = new DataTable(); foreach (var item in reportProjects) { dt2 = new DataTable(); dt.Rows.Add(item.Project.ProjectName, item.Project.CustomerName, item.Project.DateBegin, item.Project.DateEnd, item.Project.IsFinish, item.manager, item.Project.numHourForProject, item.DaysStay, item.NumWorkers, item.sumHourWork, item.presentDoing, item.NumHourDoDaysWorker, item.DepartmentUser); } this.radGridView1.DataSource = dt; this.radGridView1.EnableFiltering = true; this.radGridView1.MasterTemplate.DataView.BypassFilter = true; this.radGridView1.FilterChanged += radGridView1_FilterChanged; //master template GridViewSummaryRowItem item1 = new GridViewSummaryRowItem(); item1.Add(new GridViewSummaryItem("ProjectName", "Count: {0}", GridAggregateFunction.Count)); this.radGridView1.MasterTemplate.SummaryRowsBottom.Add(item1); radGridView1.MasterTemplate.ShowTotals = true; //child template //GridViewSummaryRowItem item3 = new GridViewSummaryRowItem(); //GridViewSummaryRowItem item4 = new GridViewSummaryRowItem(); //item3.Add(new GridViewSummaryItem("UnitPrice", "Avg: {0:c}", GridAggregateFunction.Avg)); //item4.Add(new GridViewSummaryItem("Quantity", "Sum: {0}", GridAggregateFunction.Sum)); //this.radGridView1.MasterTemplate.Templates[0].SummaryRowsTop.Add(item3); //this.radGridView1.MasterTemplate.Templates[0].SummaryRowsBottom.Add(item4); //radGridView1.Columns["Image"].ImageLayout = ImageLayout.Zoom; //GridViewTemplate childTemplate2 = new GridViewTemplate(); //childTemplate2.DataSource = songsBindingSource; //childTemplate2.Caption = "Songs"; //this.radGridView1.MasterTemplate.Templates.Add(childTemplate2); //GridViewRelation relation2 = new GridViewRelation(this.radGridView1.MasterTemplate); //relation2.RelationName = "productdescription_productModelDescription"; //relation2.ParentColumnNames.Add("AlbumID"); //relation2.ChildColumnNames.Add("AlbumID"); //relation2.ChildTemplate = childTemplate2; //this.radGridView1.Relations.Add(relation2); // GridViewTemplate childTemplate1 = new GridViewTemplate(); // dt2.Columns.Add("Department", typeof(string)); //GridViewTemplate childTemplate1 = new GridViewTemplate(); //childTemplate1.Columns.Add("DepartmentUser"); //childTemplate1.DataSource = reportProjects[0].DepartmentUser; //childTemplate1.Caption = "department"; //this.radGridView1.MasterTemplate.Templates.Add(childTemplate1); //GridViewRelation relation1 = new GridViewRelation(this.radGridView1.MasterTemplate); //relation1.RelationName = "productmodel_productModelDescription"; //relation1.ParentColumnNames.Add("ProjectName"); //relation1.ChildColumnNames.Add("Department"); //relation1.ChildTemplate = childTemplate1; //this.radGridView1.Relations.Add(relation1); // radGridView1.AutoGenerateHierarchy = true; }