Skip to content

Commit 337a48a

Browse files
committed
use GridItems
1 parent 304a938 commit 337a48a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/compas_rui/forms/meshinfo.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,6 @@ def __init__(self, cols, rows):
206206

207207
self.widget = Eto.Forms.GridView()
208208
self.widget.ShowHeader = True
209-
self.widget.DataStore = rows
210209

211210
for i, col in enumerate(cols):
212211
column = Eto.Forms.GridColumn()
@@ -218,6 +217,15 @@ def __init__(self, cols, rows):
218217
column.DataCell = cell
219218
self.widget.Columns.Add(column)
220219

220+
collection = []
221+
for row in rows:
222+
item = Eto.Forms.GridItem()
223+
values = tuple(str(val) if val is not None else "" for val in row)
224+
item.Values = values
225+
collection.append(item)
226+
227+
self.widget.DataStore = collection
228+
221229
# self.widget.CellFormatting += on_cell_formatting
222230

223231
self.cols = cols

0 commit comments

Comments
 (0)