Duplicated
Last Updated: 10 Mar 2021 08:23 by ADMIN
Jason Parrish
Created on: 09 Mar 2021 16:49
Category: UI for Blazor
Type: Feature Request
0
Improve OnRowRender functionality

I would like to suggest couple of helpful features on the OnRowRender event on the grid component.  I know these can be done with a custom row template.  But if a couple of additional properties would be tacked on to "GridRowRenderEventArgs args", it would be helpful.

 

  1. Columns and Cells collection
    Would like to override the display of a databound item, but not the underlying data.
  2. Selection
    Based on props of the databound item, it would be helpful to disable the ability to select the row.

 

Duplicated
This item is a duplicate of an already existing item. You can find the original item here:
3 comments
ADMIN
Marin Bratanov
Posted on: 10 Mar 2021 08:23

Hi Jason,

We use only the DataFormatString - something like {0:dd MMM yyyy} for dates, for example. Here is what its documentation says about this:

To set the desired format string, use the DisplayFormat parameter of the column.

If the model field has the DataFormatString set through the DisplayFormat DataAnnotation attribute, the grid will honor that without an explicit setting in the markup of the column.

You can use the standard C# formatting options, because the grid uses a string.Format call: MSDN: Format types in .NET.

At the moment, to handle nulls in a different manner than an empty cell, you should use the cell template.

That said, I logged a feature request on your behalf for the grid to use the NullDisplayText setting too: https://feedback.telerik.com/blazor/1510440-use-the-displayformatattribute-nulldisplaytext-property.

Regards,
Marin Bratanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Jason Parrish
Posted on: 09 Mar 2021 21:06
It appears the NullDisplayText on the DisplayFormat attribute is ignored.  
ADMIN
Marin Bratanov
Posted on: 09 Mar 2021 17:25

Hello Jason,

To each distinct question:

overriding the display of an item but not the data - this is done through the cell template and/or through the CellRender event. If a simple format can solve this, the DisplayFormat parameter of the column can also do this. If this is not sufficient for your needs, how would you propose this gets exposed through the row render event?

Preventing selection of the row - There is an open feature request for that here: Ability to enable/disable checkbox in checkbox column to allow/prevent selection of the row. Please Follow this enhancement there. Whether it will become available through the RowRender event or in another fashion is something that can be answered only when it gets reviewed and implemented. The thread also offers a few ideas you can consider with the easiest being handling the SelectedItemsChanged event to prevent the selection of those special rows. I've already added your Vote on it on your behalf to raise its priority.

With that in mind, I am marking this as a duplicate to this request to keep the portal tidy.

Regards,
Marin Bratanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.