I bind the datagrid to a property in the page, that's a list of this simple class:
public class LTIParameter
{
public LTIParameter(string id, string value, bool include=false)
{
Id = id;
Value = value;
Include = include;
}
public string Id { get; set; }
public string Value { get; set; }
public bool Include { get; set; }
}
When the page displays the checkboxes appear but seem disabled, can't be clicked. What I want to do is have the "Include" property of the item set/unset as the user clicks the checkbox.
I'm pretty new to Blazor and not that familiar with its binding model, so any help is appreciated.
The Include property is boolean which doesn't support three state checkboxes. It needs to be nullable boolean or the checkbox should be normal (without TriState=true).
Yes, I added that while struggling to get some progress and just removed it, again no change. Checkboxes render and they get set as expected from the source data but when I click one nothing happens!
Not sure what's was happening exactly but I was exposing the data as a get property that returned an array. I changed it be simply a public field and it works.
It expects the data to be in a backing field, as soon as I return created data in the get (for all the parameters) it fails but if I return a backing field it works. I guess this is all expected. It was modifying the copied data rather than the modifying the data it was mapped to, this kind of makes sense...
@Holmes sorry how exactly did you get this working? As I'm having exactly the same problem, data is loading and the bool property for each row is set correctly and yet the binding isn't showing any checked values.