DataGrid merge unit

xiaoxiao2021-03-06  41

IF (E.Item.ItemType == ListItemType.Header) {E.Item.cells [0] .ROWSPAN = 2; E.Item.cells [1] .Columnspan = 3; E.Item.cells [2] .visible = false; E.Item.cells [3] .visible = false;} this.newsgrid.Items [i] .cells [7] .ForeColor = ColorTranslator.From Html ("# ff0000"); cell0.Width = Unit.pixel (int); 'Merger Sub Spangrid () DIM I AS INTEGER DIM J AS INTEGER DIM INTSPAN AS I = 0 to DataGrid1.Items.count - 1 INTSPAN = 1

'Get the contents of the twenty-first column (color), the first line of cells. Strtemp = DataGrid1.items (i) .cells (21) .Text

'Cycle judgment. Judging the same content in the twenty-first column and the first line. Same as a mark, INTSPAN plus a for j = i 1 to DataGrid1.items.count - 1 if string.compare (strTemp, DataGrid1.Items (j) .Cells (21) .text) = 0 THEN INTSPAN = 1

'Use the DataGrid's ROWSPAN attribute. (Set the number of rows across the cells in the control) DataGrid1.Items (i) .Cells (21) .rowspan = IntSpan

'Hide DataGrid1.items (j) in the same cell as the content (j) .Cells (21) .visible = false else exit for end if next i = j - 1 Next End Sub

This function has not been measured, it feels too much, but sometimes it is so strange.

转载请注明原文地址:https://www.9cbs.com/read-67481.html

New Post(0)