Declined
Last Updated: 09 Jun 2023 11:10 by ADMIN
Juan Angel
Created on: 04 Jun 2023 19:58
Category: UI for Blazor
Type: Feature Request
0
File settings for default values

Normally, when we develop we try to give a homogeneous behavior to our applications for the user.

This is a uncomfortable when the default behavior of our application does not match those of the Telerik controls because it becomes verbose and repetitive. I look at my code and constantly repeat configurations for the different controls.

For example, in 99% times I use:

<TelerikGrid EditMode="GridEditMode.Inline" /> 
or 
<GridColumn ShowFilterCellButtons="false" TextAlign="ColumnTextAlign.Center" />

{
  "TelerikGrid.EditMode": "GridEditMode.Inline",
  "GridColumn.ShowFilterCellButtons": false,
  "GridColumn.TextAlign": "ColumnTextAlign.Center"
}

<GridCommandColumn Width="90px">
	<div class="text-center">
		<GridCommandButton Command="Edit"   Icon="@SvgIcon.Pencil" />
		<GridCommandButton Command="Delete" Icon="@SvgIcon.Trash" />
		<GridCommandButton Command="Save"   Icon="@SvgIcon.Save" ShowInEdit="true" />
		<GridCommandButton Command="Cancel" Icon="@SvgIcon.Cancel" ShowInEdit="true" />
	</div>
</GridCommandColumn>

Changing "Delete" icon in the whole application seems trivial, but think that you could modify the default behavior homogeneously in the whole application or in part of it if the configuration file had a hierarchical behavior, changing one properpty in one place.

I think it would be a very useful functionality to give homogeneity to an application in a very effective way, without breaking changes and making a less verbose and repetitive code.

 

Thank you for reading me !

2 comments
ADMIN
Yanislav
Posted on: 09 Jun 2023 11:10

Hello Juan Angel,

The matter of setting default parameters has been discussed within this forum thread. The suggested approach to accomplish this is by wrapping the Telerik component within a custom component that exclusively accepts only the parameters that have to be dynamic.

This approach offers the advantage of creating multiple custom components, each with different default values for the Telerik components.

Since the requirement is currently achievable we decided to update the status of the request to "Declined". Nevertheless, if there are any specific scenarios that this approach does not address, we are willing to reassess the request accordingly.

Regards,
Yanislav
Progress Telerik

As of R2 2023, the default icon type will be SVG instead of Font. See this blogpost for more information.
Juan Angel
Posted on: 04 Jun 2023 20:08

I don't undertand, when I post disappear some text between code snippets:

Obviously each project has different needs, even in a big enough project, each module will have different preferences.

That is why I propose to implement a configuration file for default values. For example, in json format it could look like this (TelerikDefaultSettings.json):


It would be ideal if it had a hierarchical behavior like _Imports.razor and its values could be overwritten if another file of the same name is found in a deeper folder.

An interesting addition would be to be able to define default values based on object properties. For example, a GridCommandButton with Command="Edit" could be set to default to Icon="@SvgIcon.Pencil"

 

-----------------------

someone can insert it?. The post it's incomplete without the missing text. Thanks.