private void KrijoStilGride() { this.dgArka.TableStyles.Clear(); DataGridTableStyle style = new DataGridTableStyle(); style.MappingName = "Table1"; style.AlternatingBackColor = System.Drawing.Color.Bisque; style.HeaderFont = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); style.SelectionBackColor = System.Drawing.SystemColors.InactiveCaption; style.RowHeadersVisible = false; dgArka.ReadOnly = true; DataGridTextBoxColumn colEmri = new DataGridTextBoxColumn(); colEmri.HeaderText = "Emri"; colEmri.MappingName = "EMRI"; colEmri.Width = 128; colEmri.NullText = ""; DataGridTextBoxColumn colShuma = new DataGridTextBoxColumn(); colShuma.HeaderText = "Vlera e hedhur"; colShuma.MappingName = "SHUMA"; colShuma.Width = 110; colShuma.NullText = ""; DataGridTextBoxColumn colPerqindja = new DataGridTextBoxColumn(); colPerqindja.HeaderText = "Perqindja"; colPerqindja.MappingName = "PERQINDJA"; colPerqindja.Width = 80; colPerqindja.NullText = ""; DataGridTextBoxColumn colPerfundimtare = new DataGridTextBoxColumn(); colPerfundimtare.HeaderText = "Vlera me komision"; colPerfundimtare.MappingName = "MEKOMISION"; colPerfundimtare.Width = 110; colPerfundimtare.NullText = ""; style.GridColumnStyles.AddRange(new DataGridColumnStyle[] { colEmri, colShuma, colPerqindja, colPerfundimtare }); dgArka.TableStyles.Add(style); dgArka.FlatMode = false; dgArka.Expand(-1); }
private void KrijoStilHeader(int neVazhdim) { hGrid.TableStyles.Clear(); DataGridTableStyle style = new DataGridTableStyle(); style.MappingName = "Table2"; style.HeaderFont = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.hGrid.ReadOnly = true; style.PreferredRowHeight = 26; style.RowHeadersVisible = true; style.HeaderBackColor = SystemColors.InactiveCaptionText; DateTime data_sot = System.DateTime.Today; DateTime data_pare; if (neVazhdim == 1) { data_pare = Convert.ToDateTime(ds.Tables[0].Columns[3].ColumnName); } else { data_pare = data_sot; } DateTime data; string str_data; for (int i = 0; i < numer_datash; i++) { DataGridColoredTextBoxColumn colData = new DataGridColoredTextBoxColumn(); //data = data_sot.AddDays(i); data = data_pare.AddDays(i); str_data = data.ToShortDateString(); colData.MappingName = this.ConvertDate(str_data); colData.HeaderText = ConDate(str_data); colData.Width = 40; colData.NullText = ""; style.GridColumnStyles.Add(colData); } style.RowHeaderWidth = 80; hGrid.TableStyles.Add(style); hGrid.FlatMode = false; hGrid.Expand(-1); }
private void KrijoStilGrid1() { this.grid1.TableStyles.Clear(); DataGridTableStyle style = new DataGridTableStyle(); style.MappingName = "Table1"; style.AlternatingBackColor = System.Drawing.Color.Bisque; style.HeaderFont = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); style.SelectionBackColor = System.Drawing.SystemColors.InactiveCaption; style.RowHeadersVisible = false; this.grid1.ReadOnly = true; DataGridTextBoxColumn colNr = new DataGridTextBoxColumn(); colNr.HeaderText = "Nr."; colNr.MappingName = "NR"; colNr.Width = 50; DataGridTextBoxColumn colData = new DataGridTextBoxColumn(); colData.HeaderText = "Data"; colData.MappingName = "DATA_STR"; colData.Width = 90; colData.NullText = ""; DataGridTextBoxColumn colBilanci = new DataGridTextBoxColumn(); colBilanci.HeaderText = "Bilanci ditor"; colBilanci.MappingName = "SASIA"; colBilanci.Width = 93; DataGridTextBoxColumn colD = new DataGridTextBoxColumn(); colD.HeaderText = "Data"; colD.MappingName = "DATA"; colD.Width = 0; colD.NullText = ""; style.GridColumnStyles.AddRange(new DataGridColumnStyle[] { colNr, colData, colBilanci, colD }); grid1.TableStyles.Add(style); grid1.FlatMode = false; grid1.Expand(-1); }
private void KrijoStilGrid2() { DataGridTableStyle style = new DataGridTableStyle(); style.MappingName = "Table1"; style.AlternatingBackColor = System.Drawing.Color.NavajoWhite; style.SelectionBackColor = System.Drawing.SystemColors.InactiveCaption; style.RowHeadersVisible = false; style.HeaderBackColor = SystemColors.InactiveCaptionText; this.grid2.ReadOnly = true; this.grid2.TableStyles.Clear(); DataGridTextBoxColumn colEmri = new DataGridTextBoxColumn(); colEmri.HeaderText = "Dhoma"; colEmri.MappingName = "DHOMA_EMRI"; colEmri.Width = 80; //colVlera.TextBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); DataGridTextBoxColumn colDataFillimi = new DataGridTextBoxColumn(); colDataFillimi.HeaderText = "Date/Ore hyrje"; colDataFillimi.MappingName = "DATA_HYRJE_STR"; colDataFillimi.Width = 150; DataGridTextBoxColumn colDataMbarimi = new DataGridTextBoxColumn(); colDataMbarimi.HeaderText = "Date/Ore dalje"; colDataMbarimi.MappingName = "DATA_DALJE_STR"; colDataMbarimi.Width = 150; style.GridColumnStyles.AddRange(new DataGridColumnStyle[] { colEmri, colDataFillimi, colDataMbarimi }); grid2.TableStyles.Add(style); grid2.FlatMode = false; grid2.Expand(-1); }
private void KrijoStilGride() { DataGridTableStyle style = new DataGridTableStyle(); style.MappingName = "Table1"; style.AlternatingBackColor = System.Drawing.Color.NavajoWhite; style.HeaderFont = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); style.SelectionBackColor = System.Drawing.SystemColors.InactiveCaption; this.grid.ReadOnly = true; DataGridTextBoxColumn colEmri = new DataGridTextBoxColumn(); colEmri.HeaderText = "Emri"; colEmri.MappingName = "EMRI"; colEmri.NullText = "-"; colEmri.Width = 53; DataGridTextBoxColumn colMbiemri = new DataGridTextBoxColumn(); colMbiemri.HeaderText = "Mbiemri"; colMbiemri.MappingName = "MBIEMRI"; colMbiemri.NullText = "-"; colMbiemri.Width = 55; DataGridTextBoxColumn colEmerGrupi = new DataGridTextBoxColumn(); colEmerGrupi.HeaderText = "Emri i Grupit"; colEmerGrupi.MappingName = "GRUPI"; colEmerGrupi.NullText = "-"; colEmerGrupi.Width = 74; DataGridTextBoxColumn colAgjensia = new DataGridTextBoxColumn(); colAgjensia.HeaderText = "Agjensia"; colAgjensia.MappingName = "AGJENSIA"; colAgjensia.NullText = "-"; colAgjensia.Width = 55; DataGridTextBoxColumn colMjetIdentifikimi = new DataGridTextBoxColumn(); colMjetIdentifikimi.HeaderText = "Mjet Identifikimi"; colMjetIdentifikimi.MappingName = "EMER_LLOJI"; colMjetIdentifikimi.NullText = "-"; colMjetIdentifikimi.Width = 92; DataGridTextBoxColumn colNrIdentifikimi = new DataGridTextBoxColumn(); colNrIdentifikimi.HeaderText = "Nr Identifikimi"; colNrIdentifikimi.MappingName = "NR_IDENTIFIKIMI"; colNrIdentifikimi.NullText = "-"; colNrIdentifikimi.Width = 85; DataGridTextBoxColumn colDatelindja = new DataGridTextBoxColumn(); colDatelindja.HeaderText = "Datelindja"; colDatelindja.MappingName = "DATELINDJA_STR"; colDatelindja.NullText = "-"; colDatelindja.Width = 77; DataGridTextBoxColumn colDatelindja1 = new DataGridTextBoxColumn(); colDatelindja1.HeaderText = "Datelindja"; colDatelindja1.MappingName = "DATELINDJA"; colDatelindja1.NullText = "-"; colDatelindja1.Width = 0; DataGridTextBoxColumn colAdresa = new DataGridTextBoxColumn(); colAdresa.HeaderText = "Adresa"; colAdresa.MappingName = "ADRESA"; colAdresa.NullText = "-"; colAdresa.Width = 45; DataGridTextBoxColumn colNrTel = new DataGridTextBoxColumn(); colNrTel.HeaderText = "Nr Tel"; colNrTel.MappingName = "TELEFONI"; colNrTel.NullText = "-"; colNrTel.Width = 45; DataGridTextBoxColumn colTarga = new DataGridTextBoxColumn(); colTarga.HeaderText = "Targa"; colTarga.MappingName = "TARGA"; colTarga.NullText = "-"; colTarga.Width = 0; DataGridTextBoxColumn colEmail = new DataGridTextBoxColumn(); colEmail.HeaderText = "Email"; colEmail.MappingName = "EMAIL"; colEmail.NullText = "-"; colEmail.Width = 45; DataGridTextBoxColumn colDateFillimi = new DataGridTextBoxColumn(); colDateFillimi.HeaderText = "Date Hyrje"; colDateFillimi.MappingName = "DATA_HYRJE"; colDateFillimi.Width = 0; colDateFillimi.NullText = ""; DataGridTextBoxColumn colDateMbarimi = new DataGridTextBoxColumn(); colDateMbarimi.HeaderText = "Date Dalje"; colDateMbarimi.MappingName = "DATA_DALJE"; colDateMbarimi.Width = 0; colDateMbarimi.NullText = ""; DataGridTextBoxColumn colDateFillimi1 = new DataGridTextBoxColumn(); colDateFillimi1.HeaderText = "Date Hyrje"; colDateFillimi1.MappingName = "DATA_HYRJE_STR"; colDateFillimi1.Width = 77; colDateFillimi1.NullText = ""; DataGridTextBoxColumn colDateMbarimi1 = new DataGridTextBoxColumn(); colDateMbarimi1.HeaderText = "Date Dalje"; colDateMbarimi1.MappingName = "DATA_DALJE_STR"; colDateMbarimi1.Width = 77; colDateMbarimi1.NullText = ""; DataGridTextBoxColumn colKategoria = new DataGridTextBoxColumn(); colKategoria.HeaderText = "Kategoria"; colKategoria.MappingName = "KAT_EMRI"; colKategoria.Width = 0; DataGridTextBoxColumn colDhoma = new DataGridTextBoxColumn(); colDhoma.HeaderText = "Dhoma"; colDhoma.MappingName = "DHOMA_EMRI"; colDhoma.Width = 46; DataGridTextBoxColumn colKapari = new DataGridTextBoxColumn(); colKapari.HeaderText = "Kapari"; colKapari.MappingName = "KAPARI"; colKapari.Width = 45; DataGridTextBoxColumn colCmimi = new DataGridTextBoxColumn(); colCmimi.HeaderText = "Cmimi"; colCmimi.MappingName = "CMIMI"; colCmimi.Width = 0; DataGridTextBoxColumn colIdIden = new DataGridTextBoxColumn(); colIdIden.HeaderText = "Id Identifikimi"; colIdIden.MappingName = "ID_IDENTIFIKIMI"; colIdIden.Width = 0; DataGridTextBoxColumn colIdLloji = new DataGridTextBoxColumn(); colIdLloji.HeaderText = "Id Lloji"; colIdLloji.MappingName = "ID_LLOJI"; colIdLloji.Width = 0; DataGridTextBoxColumn colIdDhoma = new DataGridTextBoxColumn(); colIdDhoma.HeaderText = "IdDhoma"; colIdDhoma.MappingName = "ID_DHOMA"; colIdDhoma.Width = 0; DataGridTextBoxColumn colIdKlienti = new DataGridTextBoxColumn(); colIdKlienti.HeaderText = "IdKlienti"; colIdKlienti.MappingName = "ID_KLIENTI"; colIdKlienti.Width = 0; DataGridTextBoxColumn colIdGrupi = new DataGridTextBoxColumn(); colIdGrupi.HeaderText = "IdGrupi"; colIdGrupi.MappingName = "ID_GRUPI"; colIdGrupi.Width = 0; DataGridTextBoxColumn colSkonto = new DataGridTextBoxColumn(); colSkonto.HeaderText = "Skonto"; colSkonto.MappingName = "SKONTO"; colSkonto.Width = 45; DataGridTextBoxColumn colGjoba = new DataGridTextBoxColumn(); colGjoba.HeaderText = "Gjoba"; colGjoba.MappingName = "GJOBA"; colGjoba.Width = 45; colGjoba.NullText = "-"; DataGridTextBoxColumn colIdKategoria = new DataGridTextBoxColumn(); colIdKategoria.HeaderText = "IdKategoria"; colIdKategoria.MappingName = "ID_KATEGORIA"; colIdKategoria.Width = 0; colSkonto.NullText = "-"; style.GridColumnStyles.AddRange( new DataGridColumnStyle[] { colEmri, colMbiemri, colEmerGrupi, colAgjensia, colMjetIdentifikimi, colNrIdentifikimi, colDatelindja, colDatelindja1, colNrTel, colAdresa, colTarga, colEmail, colDateFillimi, colDateMbarimi, colDateFillimi1, colDateMbarimi1, colKategoria, colDhoma, colKapari, colCmimi, colIdIden, colIdLloji, colIdDhoma, colIdKlienti, colIdGrupi, colIdKategoria, colSkonto, colGjoba, }); grid.TableStyles.Add(style); grid.FlatMode = false; grid.Expand(-1); }