Has anyone ever tried side-by-side grid views in the dynamic layout - nested within a collapsible view?
Gridview 1 contains:
Row 1: list box (100x400px)
Row 2: text
Gridview 2 contains:
Row 1: small image,
Rows 2,4,6,8: spacers
Rows 3,5,7,9: text with a textbox (Updates from event handler from option selected in list box)
A normal grid view doesn’t work - due to the length of the listbox. So I’ve built it with the list box then text & textboxes below this (within a collapsible view) - but ideally it would be perfect side by side - whether that is possible? Has somebody tried this before?
I’ve seen TableLayout and PixelLayout - but the later creates issues on Mac (from digging this forum) - whether they are better alternatives?
If I can’t it’ll be switching the listbox to a dropdown - but would prefer not too!
Make the contents of expander 2 a TableLayout. Then add a row that contains a GridView and another TableLayout. The second table layout will contain 5 rows with you image view, etc.
Do you have a python example of the TableLayout - specifically the add rows part? I’ve dug around but only seem to find the C# code via the google/Rhino guides: TableLayout · picoe/Eto Wiki · GitHub
I’ve got the GridView working, just I can’t get it into the TableLayout!
So I’ve taken your code and messed around with it - to get into the format I’m after. And switched the treeview for a listbox, and the database for a collection.
But the event handler on the ok button click, doesn’t seem to work now? Since switching from a gridview to tablelayout…I’ve played around with the ‘return’ but still doesn’t seem to like it! Just trying to return the selected index, (which eventually recalls from a csv file).
Any ideas?
#Imports
import System
from System.Collections.ObjectModel import ObservableCollection
import Rhino
import Rhino.UI
import Eto.Drawing as drawing
from Eto.Drawing import Size, Font, FontStyle
import Eto.Forms as forms
import scriptcontext as sc
################################################################################
def SectionDialogTest():
# Create and initialize collection
collection = ObservableCollectionElementfuture ref: Revise collection for each new section shape
collection.Add(Element(‘Row1’))
collection.Add(Element(‘Row2’))
collection.Add(Element(‘Row3’))
collection.Add(Element(‘Row4’))
collection.Add(Element(‘Row5’))
collection.Add(Element(‘Row6’))
# Create and display dialog - then generate geometry, layers etc for element
dialog = ElementSelector(collection)
rc = dialog.ShowModal(Rhino.UI.RhinoEtoApp.MainWindow)
if (rc):
# Print results
Elementindex = (dialog.SelectedIndex) #Use +1 to get correct row in CSV file
print Elementindex