Skip to content

GridView, colorization and read-only? #1853

Answered by cwensley
philstopford asked this question in Q&A
Discussion options

You must be logged in to vote

@philstopford hm, your second example doesn't really match what you are explaining. From what I gather you want each cell to define the text and the color. I'm not sure why using a DataTable vs. using whatever other mechanism you are using to store the data matters in this case.

At any rate, try something like this. The key here is you need a way to get to the particular cell of each row, which I do via Binding.Property((List<MyCellData> r) => r[col]);, then chain off of that. I also use that as a property of a custom column so we can use it again in the CellFormatting event.

Hope this helps.

using System;
using Eto.Forms;
using Eto.Drawing;
using System.Collections.Generic;
using System.…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@philstopford
Comment options

Answer selected by philstopford
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants