How to add a search bar to Eto form grid view


I have an Eto form with a search bar that searches through a Eto.Forms.ListBox()

But the list box only lets me select 1 item at a time, so I’m trying to use the GridView() for multiple selection but I can’t work out how to make the search function work with the GridView.

In the attached script, I’m displaying all document layers by a GridView so it lets me make multiple selections. But the search bar throws an error when I type and I don’t know why. (5.5 KB)


My end goal is to be able to toggle layer visibilities in detail viewports for the selected layers. The HideLayersInDetail only works for one detail view and doesn’t have quick search so it’s a bit slow if I need to turn off multiple layers in multiple details across multiple layouts…


1 Like


fnmatch.filter needs a list of string not a list of list:

list(graft(fnmatch.filter(flatten(self.ScriptList), "*" + text + "*"), 1)) (5.6 KB)


Thank you!

My scripting skill is consist of: Google, Copy/Paste other ppl’s codes, pressing F5 and cross fingers

This is amazing, thanks for sharing!

I wish there was a way to copy selected items in the list to clipboard.

Thanks, and thanks for @Mahdiyar for the code.

To copy the selected items, you can try forms.Label to display a label box and then copy the data. I have one that helps me batch rename rhino layouts, i just copy the list of selected layout names to excel, edit them, then paste the new names back in.

1 Like

Cool, thanks. I will try that. That batch rename tool sounds really useful, have you published it anywhere by any chance?

No haven’t published it anywhere, maybe should post it on LinkedIn :upside_down_face:

looks like this


1 Like (5.0 KB)

1 Like

Fantastic, thank you very much :slight_smile: