- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
if ((Owner as Form1).ZakazdataGrid.Columns.Count == 0)
{
(Owner as Form1).ZakazdataGrid.Columns.Add("KodTov", "");
(Owner as Form1).ZakazdataGrid.Columns.Add("NazvaTov", "Товар");
(Owner as Form1).ZakazdataGrid.Columns.Add("Kolvo", "Кол-во");
(Owner as Form1).ZakazdataGrid.Columns.Add("NazvaEd", "Ед.");
(Owner as Form1).ZakazdataGrid.Columns.Add("Suma", "Сумма");
(Owner as Form1).ZakazdataGrid.Columns.Add("KolEd", "");
(Owner as Form1).ZakazdataGrid.Columns.Add("Sostavnoy", "");
(Owner as Form1).ZakazdataGrid.Columns.Add("Sostav", "");
(Owner as Form1).ZakazdataGrid.Columns["Sostavnoy"].Visible = false;
(Owner as Form1).ZakazdataGrid.Columns["Sostav"].Visible = false;
(Owner as Form1).ZakazdataGrid.Columns["KodTov"].Visible = false;
(Owner as Form1).ZakazdataGrid.Columns["KolEd"].Visible = false;
(Owner as Form1).ZakazdataGrid.Columns["NazvaTov"].Width = (int)((Owner as Form1).ZakazdataGrid.Width * 0.5);
(Owner as Form1).ZakazdataGrid.Columns["NazvaTov"].SortMode = DataGridViewColumnSortMode.NotSortable;
(Owner as Form1).ZakazdataGrid.Columns["Kolvo"].Width = (int)((Owner as Form1).ZakazdataGrid.Width * 0.15);
(Owner as Form1).ZakazdataGrid.Columns["Kolvo"].SortMode = DataGridViewColumnSortMode.NotSortable;
(Owner as Form1).ZakazdataGrid.Columns["NazvaEd"].Width = (int)((Owner as Form1).ZakazdataGrid.Width * 0.15);
(Owner as Form1).ZakazdataGrid.Columns["NazvaEd"].SortMode = DataGridViewColumnSortMode.NotSortable;
(Owner as Form1).ZakazdataGrid.Columns["Suma"].Width = (int)((Owner as Form1).ZakazdataGrid.Width * 0.2);
(Owner as Form1).ZakazdataGrid.Columns["Suma"].SortMode = DataGridViewColumnSortMode.NotSortable;
(Owner as Form1).ZakazdataGrid.RowsDefaultCellStyle.Font = new Font("Times New Roman", FontSize - 5);
(Owner as Form1).ZakazdataGrid.ColumnHeadersDefaultCellStyle.Font = new Font("Times New Roman", FontSize - 5);
(Owner as Form1).ZakazdataGrid.AlternatingRowsDefaultCellStyle.BackColor = Color.PowderBlue;
(Owner as Form1).ZakazdataGrid.RowsDefaultCellStyle.BackColor = Color.LightSkyBlue;
}
Nagg 21.08.2009 10:50 # +2
labutinpa 24.08.2009 08:18 # 0
сумА понравилась :D
guest 23.08.2009 00:16 # 0
guest 24.08.2009 09:55 # 0
guest 23.08.2009 11:05 # 0
guest 25.08.2009 01:05 # 0
З.Ы. Сума тоже понравилась )
Gru 25.08.2009 08:18 # 0
guest 09.09.2009 23:53 # 0
var columns = (Owner as Form1).ZakazdataGrid.Columns;
И код волшебно сократится в два раза...
guest 16.10.2009 12:57 # 0