Re: [eto-forms] GridView not allowing to edit a cell. Can gridview used for entering data?

259 views
Skip to first unread message
Message has been deleted

Curtis Wensley

unread,
Feb 17, 2016, 11:13:06 AM2/17/16
to eto-...@googlegroups.com
Hi,

Try setting the GridColumn.Editable property to true

Hope this helps!
Curtis.

On Wed, Feb 17, 2016 at 12:28 AM, <aris...@gmail.com> wrote:
I tried the sample code from the wiki as below.  The grid shows up.  However, it does not let me edit a cell.
What do i have to do make a gridview cells editable?  Why is it so hard to get a working example?


        public myForm()
        {
            var table = new DataTable();
            table.Columns.Add("TextColumn");
            table.Columns.Add("CheckColumn", typeof(bool));

            table.Rows.Add("Row 1", true);
            table.Rows.Add("Row 2", false);

            var collection = table.Rows.Cast<DataRow>()
                .Select(x => new { Text = x[0], Check = x[1] })
                .ToList();

            var grid = new GridView { DataStore = collection };

            grid.CellClick += (sender, e) => grid_CellClick(sender, e);

            grid.Columns.Add(new GridColumn
            {
                DataCell = new TextBoxCell("Text"),
                HeaderText = "Text"
            });
            grid.Columns.Add(new GridColumn
            {
                DataCell = new CheckBoxCell("Check"),
                HeaderText = "Check"
            });

            Content = grid;
        }

--
You received this message because you are subscribed to the Google Groups "Eto.Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eto-forms+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/eto-forms/e1d1c57d-8dde-4916-8774-ea922b1509cb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

curtis

unread,
Feb 17, 2016, 11:16:45 AM2/17/16
to Eto.Forms, aris...@gmail.com
By the way, a more complete sample on how to use the GridView is here.

I would not typically recommend to use DataTable/DataRow, but instead use your own class to represent the row data.  The above sample does that.

Hope this helps!
Curtis.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages