#102185
YavorDashev
Member

Hi aconley,
With the definition of the Grid component is normal to have empty cells, because instead of ‘Field’ property you have to use the ‘DataField’ in order to bind the column with the corresponding data.
I have modified your code example in order to showcase you how to set up your Grid properly.


@using Smart.Blazor
<div>
    <Grid DataSource="data">
        <Columns>
            <Column DataField="RowId" Label="Row Id" />
            <Column DataField="RowType" Label="Row Type" />
        </Columns>
    </Grid>
</div>
@code {
    private  List<object> data;
    public class Thing
    {
        public int RowId { get; set; }
        public string RowType { get; set; }
    }
    protected override void OnInitialized()
    {
        base.OnInitialized();
        data=new List<object> ()
        {
            new Thing {RowId = 1, RowType = "Test 1"},
            new Thing {RowId = 2, RowType = "Test 2"}
        };
        Console.WriteLine(data.First());
    }
}

Also we are aware that the documentation can be a little hard to comprehend sometimes, but we try to improve it constantly!
Link to one of the demos:https://www.htmlelements.com/blazor/blazor-ui/demos/blazor-grid?id=basic
Let me know if that works for you!
Please, do not hesitate to contact us if you have any additional questions.
Best regards,
Yavor Dashev
Smart UI Team
https://www.htmlelements.com/