Telerik Forums
UI for Blazor Forum
2 answers
476 views

Hi,

Is it possible to sort rows in a grid dragging and dropping a row?

I see there is support for the jquery version of telerik, but I can't find anything for the blazor version

Marin Bratanov
Telerik team
 answered on 06 Oct 2020
7 answers
1.7K+ views

Hi, 

i want to bind a DateTimeOffset typed property to TelerikDatePicker 
is there any way to convert type in bind event ?
i just want to pick date if i bind it to TelerikDateTimePicker it would work but i dont want to select time

Marin Bratanov
Telerik team
 answered on 06 Oct 2020
5 answers
711 views
Hello,
this is my code 

`
    <TelerikDateTimePicker Format="dd MMM yyyy HH:mm:ss" @bind-Value="DatePickerValue"></TelerikDateTimePicker>

        DateTimeOffset DatePickerValue { get; set; } = DateTimeOffset.Now;

`
and the odd thing is its just giving me the time without offset like it's giving me 14:50 while it's 19:20
Marin Bratanov
Telerik team
 answered on 06 Oct 2020
3 answers
135 views

     When attempting to implement a Footer Template on a Grid Column, I am getting the following runtime errors: "Unhandled exception rendering component: Value cannot be null" and "Unhandled exception rendering component: Object reference not set to an instance of an object". I have tried something as simple as 

<FooterTemplate>

Test

</FooterTemplate>

And I still get that error, otherwise I get no errors on rendering the page without the FooterTemplate tags within the Grid Column.

Marin Bratanov
Telerik team
 answered on 02 Oct 2020
2 answers
589 views

I am following the example for the ValueChanged event with setting an initial value and it does not work.

I get the error that ValueExpression is required.  I try putting that in, but now when I click on the numeric textbox, 

Below is the code in your documentation for the example

from the handler: @result
<br />
from model: @theTbValue
<br />
 
<TelerikNumericTextBox Value="@theTbValue" ValueChanged="@( (decimal v) => MyValueChangeHandler(v) )"></TelerikNumericTextBox>
 
@code {
    string result;
 
    decimal theTbValue { get; set; } = 1.2345m;
 
    private void MyValueChangeHandler(decimal theUserInput)
    {
        result = string.Format("The user entered: {0}", theUserInput);
 
        //you have to update the model manually because handling the ValueChanged event does not let you use @bind-Value
        theTbValue = theUserInput;
    }
}
Bob
Top achievements
Rank 1
Iron
Veteran
Iron
 answered on 01 Oct 2020
2 answers
456 views

I am following the example for Validation in ListView Editing but I am having a problem.

The problem is that after I Save and Update to the ListView, it is calling CleanUpValidation but then is getting back into the code in EditTemplate and is therefore setting the currEditItem and currEditContext again to the Model that I just updated.

This is causing problems if I try to add a new item after the update it thinks the new item is valid when it isn't because the currEditContext's model still has the item I just updated.  

I can not figure out why it is getting back into the EditTemplate after Updating?

<EditTemplate>
    @{
        currEditItem = context;
        if (currEditItem.Id == Guid.Empty)
        {
            currEditItem.Id = Guid.NewGuid();
            currEditItem.UserId = userId;
            currEditItem.FullName = GetUserName();
            currEditItem.DateWorked = DateTime.Today;
            currEditItem.TicketId = Ticket.Id;
        }
 
        if (currEditContext == null)
        {
            currEditContext = new EditContext(currEditItem);
        }
        <EditForm EditContext="@currEditContext" Context="formContext">
            <DataAnnotationsValidator />
            <ValidationSummary />
            <div class="container-fluid editTimeEntry">
                <div class="row">
                    <div class="col">
                        <ListViewCommandButton Command="Save" Class="float-right mr-1" Icon="@IconName.Save" Title="Save"></ListViewCommandButton>
                        <ListViewCommandButton Command="Cancel" Class="float-right" Icon="@IconName.Cancel" Title="Cancel"></ListViewCommandButton>
                    </div>
                </div>
                <div class="row">
                    <label for="Staff" class="font-weight-bold col-1">Staff</label>
                    <div class="col">
                        @if (isAdmin)
                        {
                            <TelerikDropDownList @bind-Value="@currEditItem.UserId" Data="@staff" Id="Staff"
                                                 ValueField="Id" TextField="FullName">
                            </TelerikDropDownList>
                        }
                        else
                        {
                            <span>@currEditItem.FullName</span>
                        }
                    </div>
                </div>
                <div class="row">
                    <label for="DateWorked" class="font-weight-bold col-1">Work Date</label>
                    <div class="col">
                        <TelerikDatePicker Id="DateWorked" @bind-Value="currEditItem.DateWorked" Format="M/d/yyyy" Max="DateTime.Today"></TelerikDatePicker>
                    </div>
                </div>
                <div class="row">
                    <label class="font-weight-bold col-1">Time spent</label>
                    <div class="col-2">
                        <label for="TimeWorked" class="mr-1">Time Worked</label>
                        <span @ref="timeWorked" @onfocusin="(() => SelectOnFocus(timeWorked))">
                            <TelerikNumericTextBox Id="TimeWorked" Value="@currEditItem.TimeWorked"
                                                   Format="#0.00 hr" Decimals="2" Step=".25"
                                                   ValueChanged="@( (double v) => TimeWorkedChangeHandler(v) )"
                                                   ValueExpression="@( () => currEditItem.TimeWorked )">
                            </TelerikNumericTextBox>
                        </span>
                    </div>
                    <div class="col-2">
                        <label for="BillabeTime" class="mr-1">Billable Time</label>
                        <span @ref="billableTime" @onfocusin="(() => SelectOnFocus(billableTime))">
                            <TelerikNumericTextBox Id="BillabeTime" Value="@currEditItem.BillableTimeWorked"
                                                   Format="#0.00 hr" Decimals="2" Step=".25"
                                                   ValueChanged="@( (double v) => BillableTimeWorkedChangeHandler(v) )"
                                                   ValueExpression="@( () => currEditItem.BillableTimeWorked )">
                            </TelerikNumericTextBox>
                        </span>
                    </div>
                    <div class="col"></div>
                </div>
                <div class="row">
                    <label for="Comments" class="font-weight-bold col-1">Comments</label>
                    <div class="col">
                        <InputTextArea @bind-Value="currEditItem.Comments" />
                    </div>
                </div>
            </div>
        </EditForm>
    }
</EditTemplate>
 
private async Task UpdateTimeEntryHandler(ListViewCommandEventArgs args)
{
    var timeEntry = (TimeEntryViewModel)args.Item;
 
    if (!currEditContext.Validate())
    {
        args.IsCancelled = true;
        return;
    }
 
    var dbTimeEntry = mapper.Map<TimeEntryViewModel, TimeEntry>(timeEntry);
 
    var result = await ticketRepository.SaveTimeEntry(dbTimeEntry);
 
    if (result)
    {
        int index = Ticket.TimeEntries.FindIndex(te => te.Id == timeEntry.Id);
 
        if (index > -1)
        {
            Ticket.TimeEntries[index] = mapper.Map<TimeEntry, TimeEntryViewModel>(dbTimeEntry);
        }
 
        UpdateTotals();
    }
 
    CleanUpValidation();
}
 
private void CleanUpValidation()
{
    currEditContext = null;
    currEditItem = null;
}
Bob
Top achievements
Rank 1
Iron
Veteran
Iron
 answered on 01 Oct 2020
5 answers
524 views

This is not working when getting styles from libman.json.  It would appear that even though it says to use the "latest" it is not getting the latest.  When using latest, it does not get the styles for the loader.  I finally had to switch to using the files in _content 

{
  "library": "@progress/kendo-theme-default@latest",
  "destination": "wwwroot/css/kendo-themes/default",
  "files": [
    "dist/all.css"
  ],
  "provider": "unpkg"
},
{
  "library": "@progress/kendo-theme-bootstrap@latest",
  "destination": "wwwroot/css/kendo-themes/bootstrap",
  "files": [
    "dist/all.css"
  ],
  "provider": "unpkg"
},
{
  "library": "@progress/kendo-theme-material@latest",
  "destination": "wwwroot/css/kendo-themes/material",
  "files": [
    "dist/all.css"
  ],
  "provider": "unpkg"
},
Marin Bratanov
Telerik team
 answered on 01 Oct 2020
1 answer
390 views

Hello,

I'm using the EditorTemplate where I have TelerikNumericTextBox. When I press TAB key the NumercTextBox does not disappear, but there it would be something else that I would like to achieve, when I press TAB key the value of that input should be saved and the user should go to the next input. If the row ends then the user should go to the first editable input from the next row.

Is this possible to achieve somehow?

Thank you,

Cipri

Marin Bratanov
Telerik team
 answered on 29 Sep 2020
1 answer
963 views

I am using the Sass Themebuilder and trying to change the color of the TileLayout header text. It doesn't seem to be affected by the "Header text" property but instead by the "Component text".

Is that by design? It seems wrong.

Svetoslav Dimitrov
Telerik team
 answered on 29 Sep 2020
1 answer
482 views

Hello,

Is there any way to access the context in the HeaderTemplate as I want to set some dynamic content based on some values from the model?

 

Thank you.

Best regards,

Cipri

 

Marin Bratanov
Telerik team
 answered on 29 Sep 2020
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?