Telerik Forums
UI for Blazor Forum
1 answer
224 views
I am using OnRead to get remote data but sometimes I want to sort locally (all the data is loaded). Is there a way to do that?
Marin Bratanov
Telerik team
 answered on 20 May 2021
1 answer
906 views

What is the standard way to display error messages to the user?  

I have an ASP.NETCore, EFCore, Blazor-Server, Kendo-Blazor-UI application.  A user accomplishing a record change with TelerikGrid might trigger a  DbUpdateConcurrencyException in BankAccountService.Update().  I want to catch the exception, then give the user a useful action such as, "Another user, (*cough* Bob H. in Accounting), made insignificant changes to account (#45678) while you were making your very important modifications.  Please refresh your browser, review Bob's changes, then submit your modifications, again.  Be sure to thank Bob later."  

How is this communication back to the user best accomplished in a standard way?

Thanks!

Hristian Stefanov
Telerik team
 answered on 19 May 2021
2 answers
74 views
As long as there has been data binding in .Net, you have been able to bind to properties of inherited classes (and it gets resolved at runtime).
You have long had an issue that while databinding works on these properties, sorting does not. You're WPF datagrid has this problem (which we asked to get fixed years ago and got an acknowledgement of the problem along with vague promise to fix) and your Blazor datagrid suffered same issue (we are told it was because you were relying on LINQ to do the sorting). One should note that WPF's built in datagrid worked fine binding and sorting these properties.

Now, with the latest 2.24 release, you have gone the opposite direction and broke databinding very disappointing to see and makes your product currently unusable.
Svetoslav Dimitrov
Telerik team
 answered on 19 May 2021
1 answer
1.7K+ views

Hello,

 how to prevent calling "OnParametersSet " multiple times when  DialogFactory is used?

[CascadingParameter]
public DialogFactory Dialogs { get; set; }

 

its firing 2-6 times per page opening. Without DialogFactory,  its correct, only 1x.
Blazor server app. With PreRendering disabled.

Thanks

Nadezhda Tacheva
Telerik team
 answered on 19 May 2021
1 answer
281 views

Just updated to the latest release and gave the multi-column option on the grid a try.  It worked well for most cases, but on an initial transition from a non-multi-column to a multi-column, part of a grid line is missing.  Code is pretty standard stuff, but then, being new to Blazor (or any kind of web programming) I could easily be missing something obvious:

 

        <TelerikGrid Data="@lstOpsYields" Sortable="true" Pageable="true" PageSize="20" Width="100%">

            <GridColumns>

                <GridColumn Title="Field" Field="DisplayName" />

                <GridColumn>
                    <HeaderTemplate><div style="text-align:center">Expected Yield</div></HeaderTemplate>
                    <Columns>
                        <GridColumn Title=@oAppData.SimpleYear1Heading() Field="ExpectedYieldY1">
                            <Template>
                                <div style="text-align: right;"> @((context as CCropOperations).ExpectedYieldY1.ToString(cnYieldFormat))</div>
                            </Template>
                        </GridColumn>

                        <GridColumn Title=@oAppData.SimpleYear2Heading() Field="ExpectedYieldY2">
                            <Template>
                                <div style="text-align: right;">@((context as CCropOperations).ExpectedYieldY2.ToString(cnYieldFormat))</div>
                            </Template>
                        </GridColumn>

                        <GridColumn Title=@oAppData.SimpleYear3Heading() Field="ExpectedYieldY3">
                            <Template>
                                <div style="text-align: right;">@((context as CCropOperations).ExpectedYieldY3.ToString(cnYieldFormat))</div>
                            </Template>
                        </GridColumn>
                    </Columns>
                </GridColumn>

                <GridColumn>
                    <HeaderTemplate><div style="text-align:center">APH less TA</div></HeaderTemplate>
                    <Columns>
                        <GridColumn Title=@oAppData.SimpleYear1Heading() Field="AphTaLessAphY1">
                            <Template>
                                <div style="text-align: right;"> @((context as CCropOperations).AphTaLessAphY1.ToString(cnYieldFormat)) </div>
                            </Template>
                        </GridColumn>

                        <GridColumn Title=@oAppData.SimpleYear2Heading() Field="AphTaLessAphY2">
                            <Template>
                                <div style="text-align: right;">@((context as CCropOperations).AphTaLessAphY2.ToString(cnYieldFormat))</div>
                            </Template>
                        </GridColumn>

                        <GridColumn Title=@oAppData.SimpleYear3Heading() Field="AphTaLessAphY3">
                            <Template>
                                <div style="text-align: right;">@((context as CCropOperations).AphTaLessAphY3.ToString(cnYieldFormat)) </div>
                            </Template>
                        </GridColumn>
                    </Columns>
                </GridColumn>

                <GridCommandColumn Title="Edit" Width="5%">
                    <GridCommandButton OnClick="@((args) => SelectYield(args.Item as CCropOperations))" Icon="edit" />
                </GridCommandColumn>

            </GridColumns>

        </TelerikGrid>
Dimo
Telerik team
 answered on 18 May 2021
1 answer
497 views
I figured out a way to hide the expander icon during the onRowRender. I've tried different css routes using style which does no consistently hide the column .k-grid k-hierarchy-col (etc.). Is there a setting / way to onRowRender hide this column completely? I am using a context menu to expand and feel it is taking up space on screen.
Marin Bratanov
Telerik team
 answered on 18 May 2021
1 answer
230 views

Hi,

I'm just playing with the TelerikEditor control and I've noticed that if I type or paste some text into the editor and then delete it all, it's leaving behind some HTML.

If just typing text and deleting it, it seems to leave "<p><br></p>" in the bound value. 

When pasting in some code from stack overflow I've also seen it leave behind this: "<pre><code><br></code></pre>" - this happens when you paste part of a code block and then a combination of "delete" & "backspace" (I haven't quite figured the order of deleting to get this).

On a separate note, in an ideal world this control would be functionally similar to the other rich text editors in your suite - I'm trying to find one that behaves the same in Blazor (or the Web) and on WPF, as our application runs on different platforms.  Yours seem very different to each other.

No rush as for me as I probably won't use it anyway, but I thought I'd mention!

Kind Regards,
Nick.

 

 

Dimo
Telerik team
 answered on 18 May 2021
1 answer
809 views

I have a Telerik Blazor Grid which has selection tickboxes that allow multiple tickboxes to be selected at any one time.  I can store the selected tickbox state to hold a list of all the selected items.

If I navigate away from the grid say to another page and then return back to the grid I would like to be able to render the grid with the rows that were selected so they are shown as still ticked - is this possible?

Do you have any example code?

Thanks.

---

I have followed the pattern in here: https://github.com/telerik/blazor-ui/blob/master/grid/persist-selection/Pages/Index.razor

I am storing the SelectedItems in the SelectedItemsChanged event handler and storing them on a Cascading value component so they are available across pages.

When returning back to the page that has the grid the SelectedItems are not highlighted.

The grid's SelectedItems property points to the CascadingValue property of selected items.

I can successfully print out the SelectedItems count from the same CascadingValue property above the grid, so there is definitely data there, but the grid doesn't seem to want to show those items as selected.

I have also tried setting the SelectedItems property on SetState but that has same problem.

FYI
The grid uses OnRead where the data is filled into the grid on initialization of the page and when ever paging or filtering, sorting is applied.

---

I have taken the https://github.com/telerik/blazor-ui/blob/master/grid/persist-selection example and updated it to use a CascadingValue parameter to persist the state across pages.  This can be found here in this feature branch: https://github.com/adrianwright109/blazor-ui/tree/feature/persisted-state-not-updated-in-grid

The CascadingValue is working to persist state across pages as can be seen from the animated gif below, as the IDs 1 and 3 are shown under the grid after navigating pages.  What is not working is that those rows in the grid should also be highlighted and ticked as selected.

Animated Gif

---

I think the issue could be that the grid is not seeing the selected items that have been persisted as the same as the ones when returning back to the grid.

The data in the grid is re-populated from the database and the object references don't match. 

If I hard code the data then the persisted selection so correctly when returning back to the grid.  

Is this a bug or do I need to manually override/set Equals on the grid row objects?

If implementing manual overrides to the Equals method is required, examples of how to do this so its compatible with the grid would be appreciated.

---

Marin Bratanov
Telerik team
 answered on 17 May 2021
1 answer
371 views

I was using Ed Charbenaeau's BlazorSize, but wanted to remove the extra dependency now that similar functionality is built into UI for Blazor.

Is there an analogue to the IResizeListener/ResizeListener class? I have a base class component that's injecting IResizeListener, I didn't see a method to do that with Telerik.

Thanks!

Marin Bratanov
Telerik team
 answered on 17 May 2021
2 answers
1.2K+ views

Hi!

 

I have successfully used the editor control in my application. Now its priming time. I need guidance on sanitization as in the docs section, I only see this tip section:

The application must sanitize the content before passing it to the editor and, optionally, before saving it to its storage after obtaining it from the editor. It is up to the application to ensure there is no malicious content (such as input sanitization, XSS attack prevention and other security concerns).

 

Is there a best-practice or at least a minimum common rules to check for? Is there something you guys are using behind your online demo? I need to know because my site will be public facing and any malicious activity can get me in trouble.

Andy
Top achievements
Rank 1
Iron
 answered on 15 May 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?