Eto - RadioButton column in GridView

I was trying to make a RadioButton column in a GridView similar to the one in the Rhino for Mac layers panel, but it seems that this is not (yet?) supported in Eto.

I was wondering if this could be done with a CustomCell or if there is a better way?

And how would I start with the CustomCell? Does anyone has a code sample?

So, after some digging, I believe that CustomCell isn’t in the current VisualStudio/Xamarin package. Therefore, I copied the current Eto dll from GitHub into my project.

I finally found a solution that works in the Windows WIP, however, on the Mac, Xamarin says: “Could not load type ‘Eto.Forms.CustomCell’ from assembly ‘Eto, Version=2.1.5787.24910, Culture=neutral, PublicKeyToken=null’.”

Any idea why this could be the case?

The code is the following:

            grid.Columns.Add(new GridColumn
            {
                DataCell = new CustomCell
                {
                    CreateCell = args =>
                    {
                        RadioButton rb = new RadioButton();
                        //List<RadioButton> rbl;
                        rbl.Add(rb);
                        BindableBinding<RadioButton, bool> binding = new BindableBinding<RadioButton, bool>(rb, c => c.Checked, (c, v) => c.Checked = v, (c, h) => c.CheckedChanged += h, (c, h) => c.CheckedChanged -= h);
                        binding.BindDataContext<MyClass>(a => a.IsActive, (a, val) => a.IsActive = val);
                        binding.DataValueChanged += (sender, e) =>
                        {
                                 //Update all items in List<RadioButton> rbl...
                        };
                        return rb;
                    }                    
                },
                HeaderText = "Active",
                Editable = true
            });

@curtisw, can you help?

This is because CustomCell is very new and hasn’t made it into the RhinoMac yet. It should be in the RhinoMac WIP build though.

I’m not sure how you’d get around this other than replacing the Eto.dll and Eto.Mac.dll included in RhinoMac with the ones from the WIP (or custom built).

Just to make sure I got you right: I would have to replace the dlls in the Rhino for Mac folder (~Applications/Rhinoceros/Contents/Resources/Eto.dll)? Replacing the ones in the plug-in’s working folder doesn’t work?

Please don’t replace anything inside the Rhino application bundle. I would recommend getting the WIP instead and develop against that if you need this class. All of the changes to Eto in the WIP will also show up in the next service release of Mac Rhino.

OK, thank you! That’s good to know.