Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Actual value and Displayed value to be different at DataGrid Mudblazor

$
0
0

I am trying to implement a generic data grid that will work with whatever data I will send to the component. I am writing code in blazor and specifically using MudBlazor framework.

So I have an issue when I want to send a variable with DateTime I want to be displayed with the following format : 22 Nov 2012 and I dont want to send it as text since in a later stage I want to be able to sort the values based on Date.

How can I can different displayed and actual value here ?

<PropertyColumn Property="@column.PropertyExpression" Title="@column.Title" Filterable="@column.Filterable" Sortable="@column.Sortable" />

I am sending it like this :

new ColumnDefinition<TransferDetails>("Creation Date", x => x.IssueDate, typeof(DateTime), filterable: false),

and those are the ColumnDefinitions:

    public string Title { get; set; }    public Expression<Func<TItem, object>> PropertyExpression { get; set; }    public Type PropertyType { get; set; }    public bool Filterable { get; set; }    public bool Sortable { get; set; }    public RenderFragment<MudBlazor.CellContext<TItem>> CellTemplate { get; set; }    public bool IsTemplateColumn => CellTemplate != null;

Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>