Telerik Forums
UI for Blazor Forum
1 answer
1.8K+ views

I have a grid that does CRUD and it works correctly. Editing mode is Inline. The required value validation rules (defined on the data model) are working, but all that happens visually in the grid is a red border on the required fields. The validation messages I expect as tooltips never display.

The column in question are Activity and ActivityDate.

(All latest versions of Telerik products as of 5/23/22)

This is the entity definition:


public class BoxActivity
{
    public BoxActivity()
    {
        // Provide these default values so these required columns that will be auto-set do not cause validation to fail.
        ActivityDate = DateTime.Now;
        LastUpdatedDate = DateTime.Now;
        LastUpdatedBy = "default";
    }

    [Required]
    [Dapper.Contrib.Extensions.Key]
    public int BoxActivityId { get; set; }

    [Required]
    public int BoxId { get; set; }

    [Required(ErrorMessage = "Enter an activity")]
    [StringLength(30)]
    public string Activity { get; set; }

    [Required(ErrorMessage = "Enter an activity date")]
    public DateTime ActivityDate { get; set; }

    [StringLength(50)]
    public string RequestedBy { get; set; }

    public int? FacilityId { get; set; }

    [StringLength(4000)]
    public string Notes { get; set; }

    [Required]
    public DateTime LastUpdatedDate { get; set; }

    [Required]
    [StringLength(50)]
    public string LastUpdatedBy { get; set; }
}

 

This is the grid definition:
        <TelerikGrid Data="@boxActivity" EditMode="@GridEditMode.Inline" Height="auto"
                Pageable="false" Sortable="false" Groupable="false"
                FilterMode="Telerik.Blazor.GridFilterMode.None"
                Resizable="false" Reorderable="false" ConfirmDelete="true"
                OnUpdate="@BoxActivityUpdateHandler" OnEdit="@BoxActivityEditHandler" 
                OnDelete="@BoxActivityDeleteHandler" OnCreate="@BoxActivityCreateHandler" OnCancel="@BoxActivityCancelHandler">
            <GridToolBar>
                <GridCommandButton Command="Add" Icon="add">Add Activity</GridCommandButton>
            </GridToolBar>
            <GridSettings>
                <GridValidationSettings Enabled="true" />
            </GridSettings>
            <GridColumns>
                <GridColumn Field="@(nameof(BoxActivity.ActivityDate))" Title="Activity Date" Editable="true">
                    <HeaderTemplate>
                        <label class="efc-grid-col-hdr">Activity Date</label>
                    </HeaderTemplate>
                    <Template>
                        <div style="text-align: center;">
                            @((context as BoxActivity).ActivityDate.ToString("MM/dd/yyyy"))
                        </div>
                    </Template>
                    <EditorTemplate>
                        <TelerikDatePicker @bind-Value="@((context as BoxActivity).ActivityDate)" Id="ActivityDate" Width="120px"></TelerikDatePicker>
                    </EditorTemplate>
                </GridColumn>
                <GridColumn Field="@(nameof(BoxActivity.Activity))" Title="Activity" >
                    <HeaderTemplate>
                        <label class="efc-grid-col-hdr">Activity</label>
                    </HeaderTemplate>
                    <Template>
                        <div style="text-align: center;">
                            @((context as BoxActivity).Activity)
                        </div>
                    </Template>
                    <EditorTemplate>
                        <TelerikDropDownList @bind-Value="@((context as BoxActivity).Activity)"
                                                DefaultText="Choose an Activity"
                                                Data="@activities"
                                                Id="Activity" >
                        </TelerikDropDownList>
                    </EditorTemplate>
                </GridColumn>
                <GridColumn Field="@(nameof(BoxActivity.RequestedBy))" Title="Requested By" >
                    <HeaderTemplate>
                        <label class="efc-grid-col-hdr">Requested By</label>
                    </HeaderTemplate>
                    <Template>
                        <div style="text-align: center;">
                            @((context as BoxActivity).RequestedBy)
                        </div>
                    </Template>
                    <EditorTemplate>
                        <TelerikDropDownList @bind-Value="@((context as BoxActivity).RequestedBy)"
                                                DefaultText="Choose a Requestor"
                                                Data="@requestors"
                                                Width="180px"
                                                Id="RequestedBy" >
                        </TelerikDropDownList>
                    </EditorTemplate>
                </GridColumn>
                <GridColumn Field="@(nameof(BoxActivity.FacilityId))" Title="Facility" >
                    <HeaderTemplate>
                        <label class="efc-grid-col-hdr">Facility</label>
                    </HeaderTemplate>
                    <Template>
                        <TelerikDropDownList @bind-Value="@((context as BoxActivity).FacilityId)"
                                                Data="@facilities"
                                                Enabled="false"
                                                TextField="FacilityName" 
                                                ValueField="FacilityId" 
                                                Width="180px"
                                                Id="FacilityId" >
                        </TelerikDropDownList>
                    </Template>
                    <EditorTemplate>
                        <TelerikDropDownList @bind-Value="@((context as BoxActivity).FacilityId)"
                                                DefaultText="Choose a Facility"
                                                Data="@facilities"
                                                TextField="FacilityName" 
                                                ValueField="FacilityId" 
                                                Width="180px"
                                                Id="FacilityId" >
                        </TelerikDropDownList>
                    </EditorTemplate>
                </GridColumn>
                <GridColumn Field="@(nameof(BoxActivity.Notes))" Title="Notes">
                    <HeaderTemplate>
                        <label class="efc-grid-col-hdr">Notes</label>
                    </HeaderTemplate>
                    <EditorTemplate>
                        <TelerikTextArea @bind-Value="@((context as BoxActivity).Notes)" AutoSize="true" Id="Contents" ></TelerikTextArea>
                    </EditorTemplate>
                </GridColumn>
                <GridCommandColumn Context="NewNameToNotCollideBoxActivityContext">
                    <GridCommandButton Command="Save" Icon="save" ShowInEdit="true">Update</GridCommandButton>
                    <GridCommandButton Command="Edit" Icon="edit">Edit</GridCommandButton>
                    <GridCommandButton Command="Delete" Icon="delete">Delete</GridCommandButton>
                    <GridCommandButton Command="Cancel" Icon="cancel" ShowInEdit="true">Cancel</GridCommandButton>
                </GridCommandColumn>
            </GridColumns>
        </TelerikGrid>

Nadezhda Tacheva
Telerik team
 answered on 26 May 2022
1 answer
201 views

I have a numeric Text box in a grid column headerTemplate.  At zoom of 100% in Google chrome or Edge, it looks fine.  But at other zooms, there is a white line that shows up at one of the borders.  Sometimes it's the top, bottom, left, right.  Not consistent.  

Is there a way to get rid of that line?

Code on my shared page:

        <GridColumn Title="">
            <HeaderTemplate>

                <TelerikNumericTextBox @bind-Value="@ProjectMaster.WeekTotalHours" Enabled="false" Width="100%" Arrows="false" Min="0" Max="24"
                                       Format="F2" Class="classHeaderTextBox"></TelerikNumericTextBox>
            </HeaderTemplate>
            <Columns>

 

The style "classHeaderTextBox" on my myAppStyles.css page:

div.classHeaderTextBox > span > input.k-input {
    text-align: right !important;
    background-color: var(--mdc-theme-primary, #6200ee);
    border-style: none !important;
    color: white;
    border: 0 !important;
    border-color: var(--mdc-theme-primary, #6200ee) !important;
Nadezhda Tacheva
Telerik team
 answered on 26 May 2022
1 answer
180 views

Hello,

I cannot get plotbands to work, could you please help me figure out what I'm doing wrong?

<ChartCategoryAxisPlotBands>
       <ChartCategoryAxisPlotBand From="0" To="100000000" Color="red" Opacity="0.4" />
       <ChartCategoryAxisPlotBand From="200000000" To="300000000" Color="red" Opacity="0.4" />
       <ChartCategoryAxisPlotBand From="400000000" To="500000000" Color="red" Opacity="0.4" />
</ChartCategoryAxisPlotBands>

 

Is there a oneliner for just alternating colors?

Each even row number should be red and odd row number white. It makes it harder to make each plotband range, when the numbers are dynamic and change every single day. I do not control the min to max range, beacuse they are created automatically when the graph is rendered.

 

Regards,
Nikolas

Tsvetomir
Telerik team
 answered on 26 May 2022
3 answers
448 views

In the TelerikForm Blazor control is it possible to have all the fields auto-generate except for a couple of specific ones?

I have a form that has ~20 fields on it. It autogenerates properly. I would like to add an additional field for notes but want that to be a multiline text area and I want it to span all the columns of the form.  

Is there a way to combine an autogenerated form with a few templated forms?

Svetoslav Dimitrov
Telerik team
 answered on 26 May 2022
1 answer
205 views

Hi

I saw this demo: https://github.com/telerik/blazor-ui/tree/master/tilelayout/add-remove-tiles

It looks great but its added code.

So it would be nice to have this behavior build into the component:

1. Have a property with a list of available components

2. have the component let the user pick from a list (The list could be a dropdown value list)

3. With saving state also save the connected component

4. have an event on which we instantiate the component when the layout is shown

 

Eric

 

 

Svetoslav Dimitrov
Telerik team
 answered on 25 May 2022
1 answer
220 views

The copy paste functionality is not working when I use the menu filter for a numeric value.

This does also not work for the demo on https://demos.telerik.com/blazor-ui/grid/filter-menu

Tsvetomir
Telerik team
 answered on 25 May 2022
0 answers
353 views

Hi,

I am experiencing some problem when using TelerikEditor on Modal. The editor seems a bit slow and if you press enter, it doubles the next line and when you edit a text it creates a new line on it. See example below:

Adrian
Top achievements
Rank 1
 asked on 25 May 2022
1 answer
288 views

Hello,

Is there any way to load the data in the FileManager control virtually. I would prefer to not have to traverse the entire file system to provide the folder/file structure. Can the OnRead method be used to provide just the data needed for the current view?

Thank You,

-Andy

Stamo Gochev
Telerik team
 answered on 25 May 2022
1 answer
186 views

Dear All,

The attached document contains a couple of Grid component document that I got from DevExpress and SyncFusion. I am interested in the one that is similar to the image attached, which I got from DevExpress. Does Telerik have something similar to this? I would also like to see one like that image on page 1 that is in 1-to-many relationship, where the form part represents the parent, and the grid part represents the child.

I am trying to develop a Blazor application that could mimic what I stated above, especially Form/Grid, where the Form represents the main form (parent), and the Grid, represents the child in a 1-to-many relationship respectively.

I got the image from this link: 

https://community.devexpress.com/blogs/aspnet/archive/2021/11/12/grid-for-blazor-standard-and-popup-edit-forms-now-available-in-v21-2.aspx

Your quick response to this request is greatly appreciated.

Sincerely,

Isaiah A.

Tsvetomir
Telerik team
 answered on 23 May 2022
1 answer
252 views

Dear All,

I am currently trying to create a Blazor Application.  If I had a list of records in a Grid, I would like to click a button to open a Form. Let us say that this form is a Customer Address (parent). Once this form is opened, I would like to see a Grid that contains the Orders (child). I can create class models for both Address/Orders. I will migrate them to an RDBMS like SQL Server. Does anyone know if Telerik has sample application like this or if you know any link that you can point me to? 

I have recently purchased a license for Telerik, and so far, I like what I see.

Your response to the above request is greatly appreciated.

Sincerely,

Isaiah A

 

Tsvetomir
Telerik team
 answered on 23 May 2022
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?