Telerik Forums
UI for Blazor Forum
1 answer
135 views

Is there a way to support editing an object (key/value pair) where the value field is an object and can be of a different type for each record?

Current issue is error in editor saying:
Argument 1: cannot convert from object to string

public class KeyValue

{
public string Key { get; set; }
public object Value { get; set; }
}

<div>
<div>
<div>
<TelerikGrid Data="@KeyValues"
@ref="@Grid"
EditMode="GridEditMode.Incell"
OnStateInit="@((GridStateEventArgs<LabelEntry> args) => OnStateInitHandler(args))">
<GridColumns>
<GridColumn Field="Key"
Editable="false" />
<GridColumn Field="Value"
Editable="true">
<EditorTemplate>
@{
CurrentEntry = context as KeyValue;
if (CurrentEntry.Value.GetType().ToString().Equals("System.String", StringComparison.CurrentCultureIgnoreCase))
{
<TelerikTextBox @bind-Value="@CurrentEntry.Value" />
}
else if(CurrentEntry.Value.GetType().ToString().Equals("System.Int32", StringComparison.CurrentCultureIgnoreCase))
{
<TelerikNumericTextBox @bind-Value="@CurrentEntry.Value"/>
}
}
</EditorTemplate>
</GridColumn>
</GridColumns>
</TelerikGrid>
</div>
</div>
</div>
Marin Bratanov
Telerik team
 answered on 11 May 2022
2 answers
679 views

Hi, I am using grid programmatic  export  SaveAsExcelFileAsync();  but the event OnBeforeExport never fires.

Is there any problem when calling from programmatic export?  When using the default button export it fires normally.

I am using the latest version 3.2.0.

Thank you,

Thod

Thod
Top achievements
Rank 1
Iron
 answered on 10 May 2022
1 answer
443 views

I've been struggling with this behaviour for a while now:

- In my Blazor app 've set the culture to nl-NL (which at the moment is UTC+2)

- Converting a normal datetime to UTC gives me the result i expect.
  IE. var test =new DateTime(1978, 9, 4).ToUniversalTime();
  Results in test being '1978-9-3 22:00:00Z'

Now when i use the Grid component with a default filter row i handle the 'OnRead' event of the grid and use the ToODataString() to get the formatted filter:
var filter = args.Request.ToODataString();

No matter what i try, the filter returned always formats the dates i filter incorrect. Filtering on '1978-09-04' is formatted as '1978-09-04 00:00:00Z' while i expect it to be '1978-09-03 22:00:00Z'.

Am i missing something trivial here or is this a bug in the ToODataString method?

Regards,

Gerrit

Gerrit
Top achievements
Rank 1
Iron
 answered on 09 May 2022
0 answers
227 views

I am adding a context menu to the treelist. The issue is that I have not achieved a good integration between them. Especially for display issues I had to do a lot of workarounds.
I attach a code snipet as an example:

Examples

As you can see in the Example 1, inside the green area you can right click and it shows the context menu, but outside this (the largest area) it doesn't. If we replace the <span> with a <div> now the green area will be larger but the button to expand is not on the same line. So we have to apply styles (for example: display: flex;) to the element that wraps our template (Example 2).

Now the new issue is that the treelist loader (the one that is seen when we expand a parent node) looks stretched (Example 3).

I find it hard to believe that the integration is so complicated. I am doing something wrong?? 
Regards.

Ludwig.

Blazorist
Top achievements
Rank 2
Bronze
Iron
Iron
 updated question on 09 May 2022
1 answer
108 views
I want to change the color of the Tasks in the TreeList depending on what percentage it is complete.  So if it is 100% done then Green otherwise say Red.  Is this possible?  I have not found a way to do it in Blazor.  If it is not possible is it planning on being added soon?
Hristian Stefanov
Telerik team
 answered on 09 May 2022
1 answer
121 views

I would like to request some enhancements to the drag & drop support to provide feedback during the operation to support things like:

Displaying feedback in an icon (e.g. can't drop here, will copy, will move)

Displaying overlays for Copy/Move operations

Capturing the Ctrl & Alt keys for drag operations

Templating the drag hint

Thank you,

-Andy

Joana
Telerik team
 answered on 09 May 2022
1 answer
124 views

Is there an easy way to capitalize a control like a textbox? In CSS it's just text-transform: capitalize; Bootstrap has a class called: text-capitalize.

Marin Bratanov
Telerik team
 answered on 07 May 2022
1 answer
203 views

It would be glad to add a property in telerik blazor components allow to manage all component settings.

This because some components has many attributes and binding to single properties on class is a nightmare.

It was done in angular with k-options attribute, in blazor can be for example:


<TelerikGrid Data="" Pageable="" PageSize="" Sortable="" Resizable="" Reorderable="" SelectionMode="" EditMode="" OnRead="" OnCreate="" OnUpdate="" OnCancel=""> ... </TelerikGrid>

 

to


<TelerikGrid Options="Options"> ... </TelerikGrid>

 

@code

{

private TelerikGridOptions<Model> Options {get;set;}

 

protected override void OnInitialized()

{

Options = new TelerikGridOptions<Model>

{

...

};

}

}


Marin Bratanov
Telerik team
 answered on 07 May 2022
1 answer
288 views

Hi,

About to start modernizing an old desktop application and moving it to web.

Due to change management with operators we are not allowed to make significant changes to UI layout etc.

Therefore we must keep the MDI layout of the pages.

What components and layout would you suggest for this task?

A Menu in the top and TelerikWindow's? It should be possible to open many windows

BR

Ulrik

Marin Bratanov
Telerik team
 answered on 07 May 2022
2 answers
171 views

I have a Tabstrip with several open "documents" as tabs and I've provided the user the option to "reload" the document, or discard changes. I remove my model object from the list of open tabs and re-add a new instance of that object, however the tabstrip doesn't see this as a new instance and therefore remains with the older rendering. If on the other hand I remove my object, call StateHasChange, then re-add the object and call StateHasChanged again my object is re-rendered correctly. This behavior is not ideal though, is there a way to inform the tabstrip that the instance of the object that represents this tab has changed?

Thanks

-Andy

Joana
Telerik team
 answered on 06 May 2022
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?