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

Hi,

I was wondering what is the best approach to strip out the HTML of a text field that is displayed in a Blazor Datagrid.

I tried using the Template feature along with MarkupString as shown below but it just returns the name of the field rather than the contents of it.

<TelerikGrid Data="Model.CurrentPageData" TotalCount="Model.TotalItemCount" OnRead="ReadItems" Pageable="true" PageSize="10" Groupable="true" Sortable="false">
    <GridColumns>
        <GridColumn Field="@(nameof(Escalation.EscalationId))" Title="Escalation ID" Width="120px" />
        <GridColumn Field="@(nameof(Escalation.CaseType))" Title="Type" Width="120px" />
        <GridColumn Field="@(nameof(Escalation.SummaryOfRequest))" Title="Request Summary" Width="120px" />
            <Template>
                    @((MarkupString)(nameof(Escalation.SummaryOfRequest)))               
            </Template>
        </GridColumn>
        <GridColumn Field="@(nameof(Escalation.PrimaryBu))" Title="Primary BU" Width="120px" />
        <GridColumn Field="@(nameof(Escalation.CreatedDate))" Title="Created" DisplayFormat="{0:dddd, dd MMM yyyy}" Width="120px" />
    </GridColumns>
</TelerikGrid>


Matthias
Top achievements
Rank 5
Bronze
Bronze
Iron
 answered on 28 Sep 2021
2 answers
1.2K+ views

 

Currently, I am using Listview for binding, Whereas I couldn't able to bind the selected Value in the list.

Hence, I need Dual ListBox for moving data from one listbox to another one.

Could you please on this.

 

 

Thanks

Vishnu

Nadezhda Tacheva
Telerik team
 answered on 27 Sep 2021
1 answer
1.6K+ views

Hello, 

I have the following data model which I want to display in TelerikGrid.

The columns should be Name, Price (which is easy), but I also want to display the topping columns, where each caption is the key of the dicionary entry and the displayed value should be the value from the dictionary entry:

Expected result:

Name     |    Price      |      Tomato       |    Cheese       |     Bacon

Cheese  |   8.99         |     low               |   very much   |   no

Tomato  |   5.99        |     very much   |  not so much  |   no

Bacon     |   10.99      |     low               |  not so much  |   three pieces

 

Is that possible by using the TelerikGrid and how should the data binding look like ?

I took the sample code from the expando sample to create the columns based on the dictionary entries

but I didn't get the values from the dictionary to display each value in the rows.

 

public class Pizza
    {
        public string Name { get; set; }

        public decimal Price { get; set; }

        public IDictionary<string, string> Toppings { get; set; }


        public static IList<Pizza> PizzaRecipies()
        {
            return new List<Pizza>()
            {
                new Pizza()
                {
                    Name = "Cheese",
                    Price = 8.99M,
                    Toppings = new Dictionary<string, string>()
                    {
                        {"Tomato","low"},
                        {"Cheese", "very much"},
                        {"Bacon", "no"}
                    }
                },
                new Pizza()
                {
                    Name = "Tomato",
                    Price = 5.99M,
                    Toppings = new Dictionary<string, string>()
                    {
                        {"Tomato","very much"},
                        {"Cheese", "not so much"},
                        {"Bacon", "no"}
                    }
                },
                new Pizza()
                {
                    Name = "Bacon",
                    Price = 10.99M,
                    Toppings = new Dictionary<string, string>()
                    {
                        {"Tomato","low"},
                        {"Cheese", "not so much"},
                        {"Bacon", "three pieces"}
                    }
                }

            };
        }
    }


Radko
Telerik team
 answered on 27 Sep 2021
1 answer
320 views

Great to see the new Gantt feature in update 2.26.  We immediately starting implementation for tracking our publishing stages at Microsoft for shipping software updates to show the parallelism of the processes and easily identify the relative time each stage takes.  This is a great improvement over a list in a table.   

Sadly, the current implementation of Gantt only supports days whilst our publishing stages take only a few minutes or hours.

I'm hoping additional support for a minutes view is coming soon as we had to shelve implementation of a Gantt view of publishing stages using your Gantt chart for the time being.  If it's not coming, an announcement of it's in the road map plan or not coming would be greatly appreciated by your marketing team.

Nadezhda Tacheva
Telerik team
 answered on 27 Sep 2021
1 answer
261 views

Where a DropDownList is populated dynamically, and mandatory, it makes sense for there to be an option to automatically default to the first item in the list.  Especially as there may only be one item in the list, or the first item may account for 99% of cases.

It would be great if this could be done via a simple property:  DefaultToFirst="true".

Svetoslav Dimitrov
Telerik team
 answered on 27 Sep 2021
1 answer
340 views
I have a project with a grid and a context menu.  When I right click on a grid cell, I create a contextual menu based on the name in the grid row.  Then when I run the await ContextMenuRef.ShowAsync(mouseEventArgs.ClientX, mouseEventArgs.ClientY); command, the menu is from the previous right click and previous row.  The actions performed based on the menu choice happen for the right row but the menu itself, it shows previous values.  I have included my mock project for your perusal.  Click on Invoices to get to the page with the problem.
Radko
Telerik team
 answered on 24 Sep 2021
1 answer
246 views

Hi everybody,

What I would like to achieve is to split a container in 2 halfs, then after selecting one of the two halfs to have the posibility to split the selected half agin in other two halfs, and so on.

I was thinking to use the Splitter component for this kind of things having two buttons: one for splitting vertically, and one for splitting horizontally which when one is pressed do the split of the selected container, but I can't understand how can I do this because in all your examples the splitters are already defined. How can this be done dynamically?

Can anyone help me?

Best regards.
Cipri

Nadezhda Tacheva
Telerik team
 answered on 24 Sep 2021
1 answer
598 views

How to know while viewing styles in Chrome Dev tools which .k style classes to need to be overridden for margins using CSS isolation.

Also if using properties of the TelerikNotification HorizontalPosition set to center and VerticalPosition set to top what is needed to override the top position when using CSS isolation

Eric R | Senior Technical Support Engineer
Telerik team
 answered on 23 Sep 2021
0 answers
698 views

I am struggling with getting the dropdown part of Dropdownlist to match.

The dropdown part is to small. If I remove bootstrap then it's to far to the right.

Have also tried to put the DropDownList outside the grid. Same result.

Setting the width doesn't help

See the pictures.

I have measured the computed values of the animation container and the values are correct. So something else is overwriting the css.

I removed all stylesheets except _content/Telerik.UI.for.Blazor/css/kendo-theme-default/all.css


Code

@page "/DepartmentAccess"
<h3>DepartmentAccess</h3>

<TelerikGridLayout>
    <GridLayoutColumns>
        <GridLayoutColumn Width="300px"></GridLayoutColumn>
        <GridLayoutColumn Width="200px"></GridLayoutColumn>
        <GridLayoutColumn Width="300px"></GridLayoutColumn>
    </GridLayoutColumns>
    <GridLayoutRows>
        <GridLayoutRow></GridLayoutRow>
        <GridLayoutRow></GridLayoutRow>
        <GridLayoutRow></GridLayoutRow>
    </GridLayoutRows>
    <GridLayoutItems>
        <GridLayoutItem Column="1" Row="1">Department</GridLayoutItem>
        <GridLayoutItem Column="1" Row="2">
            <div>
                <TelerikDropDownList
                    TValue="int"
                    TItem="CboItem"
                    Data="UserDepartments"
                    TextField="Name"
                    ValueField="Id"
                    Filterable="true"
                    FilterOperator="StringFilterOperator.Contains"
                    DefaultText="Select Department"
                    ValueChanged="@(UserDepartmentSelected)"
                    PopupHeight="400px"
                    />
            </div>
        </GridLayoutItem>
        <GridLayoutItem Column="1" Row="3">Listbox with selected funds for selected department</GridLayoutItem>
        <GridLayoutItem Column="2" RowSpan="3">add / remove buttons</GridLayoutItem>
        <GridLayoutItem Column="3" Row="1">Avaiable funds</GridLayoutItem>
        <GridLayoutItem Column="3" Row="2">Listbox wit avaiable funds</GridLayoutItem>
    </GridLayoutItems>
</TelerikGridLayout>

Martin Herløv
Top achievements
Rank 2
Bronze
Iron
Iron
 updated question on 23 Sep 2021
3 answers
979 views

No matter what method signature I come up with, I always get a compile error like 

[CS1503] Argument 3: cannot convert from 'method group' to 'bool'

I tried void SomeMethod(), void SomeMethod(object _), Task SomeMethod(), Task SomeMethod(object _), async Task ...

I also tried <TelerikEditor OnChange="@(_ => SomeMethod())"> and variations thereof.

Trying to use <TelerikEditor T="string" > does not work either.

Any idea what I should be doing?

Nadezhda Tacheva
Telerik team
 answered on 23 Sep 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?