Comments (9)
Template collumn has a property called SortBy. This should work.
look at the unit tests:
https://github.com/MudBlazor/MudBlazor/blob/dev/src/MudBlazor.UnitTests.Viewer/TestComponents/DataGrid/DataGridSortableTemplateColumnTest.razor
from mudblazor.
ok but the sortBy will only give me in the ServerReload the identifier of the column, but the way i added the column doesn't allow me to recognise the column because the identifier given to the column is a random GUID
from mudblazor.
doesnt it work if you do:
<TemplateColumn Title="@(columnName)" Class="multiline-text" SortBy="x => (string)prop.GetValue(x)">
from mudblazor.
or
<TemplateColumn Title="@(columnName)" Class="multiline-text" SortBy="@(_ => columnName)">
from mudblazor.
I need to do the order by on server side because on client side i only have part of the data due to pagination. so i need to understand on the method ServerReload what column the user selected and pass that information to the server that will do the OrderBy
from mudblazor.
you should be able to use the DataGrid MudDataGrid<TItem>
object to get the SortDefinitions.
in these objects you should be able to get all the information to build a request to your server and repopulate the itmes collection
for refferences: https://mudblazor.com/api/datagrid#properties
from mudblazor.
Normally yes, but because i've created the columns using projection in foreach cycle there seems to be no way to know programmatically wich column the user want to order
from mudblazor.
Hi,
It would be nice if you attached a TryMudBlazor example to play with.
As a workaround, you can set the Title
for the TemplateColumn
, then get a ref
of your MudDataGrid
, iterate through RenderedColumns
, find the TemplateColumn
by that GUID, and extract the title.
from mudblazor.
Another option is to create your own TemplateColumn
by inheriting Column<T>
and override how the PropertyName
behaves and use own logic instead of the random guid. I think all the needed tools are available.
from mudblazor.
Related Issues (20)
- MudDataGrid: Indicating when QuickFilter is working
- MudTextField - Submitting with enter key press HOT 2
- Expose the new ```RegisterParameter``` apis as protected internal rather than internal HOT 4
- MudList's SelectedItem changes when MudListItem sort order changes HOT 3
- MudFileUpload not working in safari browser. HOT 17
- MudDataGrid not refreshing grouping with ServerData
- MudSwitch on click interceptor? HOT 11
- DatePicker shows extra text with PersianCalendar (AP) HOT 1
- Add property Disabled to MudTabs
- ColorPicker resets to white values on Firefox HOT 2
- MudDataGrid add documentation and CancellationToken HOT 4
- MudTabs: Incorrect rendering of selected tab slider HOT 3
- MudTreeView: System.NullReferenceException occurs when use a MudTreeView inside a MudPopover HOT 3
- [MudSelect] MudSelectItem - null/default values no longer displays as selected item. HOT 5
- MudSelect When FullWidth is false, component still takes up entire container width
- MudThemeProvider needs to have interactivity mode
- MudDataGrid: Index out of bounds error when using TemplateColumn in a for loop HOT 2
- Drag element only with header
- Autocomplete with ItemTemplate won't register touch scroll events HOT 3
- NumericField: Hold spin buttons to keep increasing/decreasing HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mudblazor.