Radzen DataGrid bound and unbound data?


With the Grid component you could have bound data and also have a column of unbound data mixed in. With the DataGrid you cannot do this?

The below is a bound data grid with an added column of type string to list an IPAddress. @IPAddress is just a string variable.

My guess is that this wasn't supposed to work with the grid either, but did. The TItem is wrong for the @IPAddress, but again worked with the Grid and now does not work with the DataGrid.


            <RadzenDataGrid @ref="evGrid" Data="@logdb.Logs" IsLoading="@isLoading" Count="@count" PageSize="50" TItem="Logs"
                            RowRender="@RowRender" CellRender="@CellRender" AllowVirtualization="true" AllowFiltering="true" SelectionMode="DataGridSelectionMode.Single"
                            FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive" LogicalFilterOperator="LogicalFilterOperator.And"
                            AllowPaging="false" AllowSorting="true" AllowColumnResize="true" Style="line-height: 12px; width:100%; height: 585px; margin-right:5px;">
                    @*Main Grid View*@
                    <RadzenDataGridColumn Width="150px" TItem="Logs" Property="Timestamp" Title="Time Stamp" TextAlign="TextAlign.Left" Type="typeof(DateTime)" />         
                    <RadzenDataGridColumn Width="90px" TItem="Logs" Property="@IPAddress" Title="IP Adress" TextAlign="TextAlign.Left" Type="typeof(String)" Visible="@ShowIPColumn" />
                    <RadzenDataGridColumn Width="225px" TItem="Logs" Property="SourceContext" Title="Source Context" TextAlign="TextAlign.Center" Type="typeof(string)" />
                    <RadzenDataGridColumn Width="90px" TItem="Logs" Property="Level" Title="Level" TextAlign="TextAlign.Center" Type="typeof(string)" />                    
                    <RadzenDataGridColumn TItem="Logs" Property="Message" Title="Message" TextAlign="TextAlign.Left" Type="typeof(string)">
                        <Template Context="logs">
                            <RadzenImage Path=@GetIconPath(logs) Style="width:12px; height:12px" />

This declaration didn't worked for me using both our legacy RadzenGrid and RadzenDataGrid component:

legacy RadzenGrid:


You might need to use Template to show variable value in the column cells.


Strange that this was working in the RadzenGrid product for me. But that was only temporarily needed so the template might work out better. Thank you, I didn't think of the template. I will try that.

Kind regards,