GridView, colorization and read-only? #1853
-
Currently, I have a prototype that shoves labels into a TableLayout, to allow me to pick up the text and color from the class instance corresponding to the TableCell. ` tl = new TableLayout();
` This falls over with larger datasets as there is no way to background the UI build and so the main thread gets bogged down. All of my other processing is done off the main thread, but this set-up really hurts. I assume there's a better way using some form of Grid view component, but the documentation has me uncertain how to reproduce the above, coloring the cells and assigning the text. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I'm looking at the example code and wondered about using a DataTable, but don't see how to reference the color for the first DataCell; ideally I'd like to be able to define the color for each cell. `
` |
Beta Was this translation helpful? Give feedback.
-
@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 Hope this helps.
|
Beta Was this translation helpful? Give feedback.
@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.