Telerik Forums
UI for Blazor Forum
2 answers
758 views

Hi I would like to change the datasouce dynamic for a combobox.

I have two radiobuttons on top of the CB. The chosen radio button should change the datasource.

What are my options?

Two Comboboxes stacked? mange visibility base on the radio button value?

 

Marin Bratanov
Telerik team
 answered on 28 Aug 2021
1 answer
1.2K+ views

Hello,

First of all, please note i am doing tests with a Trial version of Telerik (2.25.0).
I plan to buy licence in a few days but i need to be sure Telerik is appropriated for my project.

I have an issue with websocket data volume on RadGrid.

Here is what i've done:

- I have create an empty Blazor Server project (.Net 5 dotnet framework)

- I have create an Entity with 2 properties: Id (Int32) and Name (String, 10 chars max)

- I have create a database with about 500 records of the previous Entity.

- I have put a RadGrid component with pagination (10 items per page). This Grid is displaying the 500 records. I have checked something on Entity Framework and SQL Server: RadGrid sends a new SQL request on each page change and only fetchs 10 items on each page.

- Telerik paging is very slow for me (my customers will run my application with a very poor connexion)

- I have sniffed packets on network and i have seen a very huge amount of data in websocket traffic when i click on another Radgrid page on my browser: 377ko per page (for only 10 items of { Int32, String[10] } !).

Here is what i've done: I have cleared my sniffer. Then i have changed page one time in my browser and i have stopped sniffer. Everything was done on a virtual machine. There were no other traffic (Internet or local)

In wireshark, i see a huge amount of data on the websocket stream.
Here is a very short extract:

!.......!.......!.......!...............................!.......!.......!.......!.......!.......!.......!.......!.......!.......!.......!.......!...............................!.......!.......!...... !......!!......"!......#!......$!......%!......&!......'!......(!..............................)!......*!......+!......,!......-!.......!....../!......0!......1!......2!......3!......4!..............................5!......6!......7!......8!......9!......:!......;!......<!......=!......>!......?!......@!..............................A!......B!......C!......D!......E!......F!......G!......H!......I!......J!......K!......L!..............................M!......N!......O!......P!......Q!......R!......S!......T!......U!......V!......W!......X!..............................Y!......Z!......[!......\!......]!......^!......_!......`!......a!......b!......c!......d!..............................e!......f!......g!......h!......i!......j!......k!......l!......m!......n!......o!......p!..............................q!......r!......s!......t!......u!......v!......w!......x!......y!......z!......

And on the bottom of the stream, i can see the datas displayed on my grid:

...

HelloWorld.gridcell.1.0.  .1.false.256.gridcell.1.1.  .2.false

...

This grid datas are packed and they are not heavy (about 2kbytes). But what are the 375k previous bytes ?
Is there a way to avoid them ?

Please not i am running this project in a Developpment environnement. Do you think the 375kbytes datas can be debug informations and if so, how can i remove them ? I can't run in Production mode, maybe due to trial version but i need to know before buying licence why websocket data is so heavy.

Thanks a lot.

Marin Bratanov
Telerik team
 answered on 28 Aug 2021
1 answer
597 views

Hello

According to the Telerik Blazor Combobox documentation, it is not possible to have e.g. decimal values when I want to use AllowCustom="true":

The ComboBox provides the following features:
  • AllowCustom - whether the user can enter custom values. If enabled, the ValueField must be a string.



In my application it would be great to have the option to allow custom values, but decimal only. I've seen this for e.g. NumericTextBox. There is a parameter "T" where one can define the type of the value. Here you can see an example code extracted from my application:

<TelerikComboBox Data="@Data"
                 @bind-Value="@SelectedValue"
                 TextField="Value"
                 ValueField="Value"
                 AllowCustom="true"
                 Placeholder="Select a value or set a custom value">
</TelerikComboBox>
public List<MyData> Data { get; set; }
public decimal SelectedValue { get; set; }

public class MyData
{
    public decimal Value { get; set; }
}
Is there already such a feature and I simply didn't see it or is this really not possible and never will be?

Best Regards,
Roman
Marin Bratanov
Telerik team
 answered on 28 Aug 2021
1 answer
497 views

Hi

 

Is Focus is available for Telerik Button? 

Could you please suggest on this?

 

Thanks,

Vishnu Vardhanan H

Hristian Stefanov
Telerik team
 answered on 27 Aug 2021
1 answer
168 views

Hi,

 

On Clicking Space from Keyboard need to perform Button click event.

<EditForm OnValidSubmit="@OnFormValidSubmit" Model="@Model">
            <TelerikButton Icon="save" ButtonType="@ButtonType.Submit" Primary="true">Upgrade</TelerikButton>
            <TelerikButton Icon="cancel" ButtonType="@ButtonType.Button" OnClick="@OnCancelClick">Cancel</TelerikButton>
   </EditForm>

Thanks,

Vishnu Vardhanan H

Nadezhda Tacheva
Telerik team
 answered on 27 Aug 2021
2 answers
584 views

HTML for textarea does not contain the data bound to it-- how is this being displayed in the browser and is there any way to see the contents of the textarea via the html?  When i inspect the html for a text area it doesn't contain the actual data-- it contains a data id reference (I'm assuming this).  I am trying to "export" an html page using JavaScript code like this:

document.getElementsByClassName('targetForExport')[0].outerHTML

I have also used innerHTML and it doesn't matter.

 

BUT there is no data in the textareas and the datepickers.  Ultimately i'm trying to export a page (set of html elements really) to a PDF format.  The only real catch i'm running into is the data simply isn't there.

 

Thanks.

Matthias
Top achievements
Rank 5
Bronze
Bronze
Iron
 answered on 26 Aug 2021
3 answers
501 views

Hi,

Within our Blazor application I use a Grid with custom row filters:

<TelerikGrid Data="@RecordList"
                         SelectionMode="GridSelectionMode.Multiple"
                         Width="100%"
                         Pageable="true"
                         PageSize="@PageSize"
                         FilterMode="@GridFilterMode.FilterRow"
                         Sortable="true"
                         Groupable="false"
                         Height="760px"
                         Resizable="true">
                <GridColumns>                    
                    <GridColumn Width="200px" Field="@nameof(Demo.Name)" Title="@L["Name"]">
                        <FilterCellTemplate>
                            <CustomListRowFilter Context="@context" ListValues="EmployeeFilterList" AddNoneItem="false" />
                        </FilterCellTemplate>
                    </GridColumn>                   
                    <GridColumn Width="200px" Field="@nameof(Demo.Datum)" Title="@L["Date"]">
                        <FilterCellTemplate>
                            <CustomDateSpanRowFilter Context="@context" InitialValueFrom="@InitialDateFromFilter" InitialValueTo="@InitialDateToFilter" />
                        </FilterCellTemplate>
                    </GridColumn>
                    <GridColumn Width="200px" Field="@nameof(Demo.Hours)" Title="@L["Hours"]">
                        <FilterCellTemplate>
                            <CustomNumberRowFilter Context="@context" />
                        </FilterCellTemplate>
                        <FooterTemplate>
                            <span>Total: @context.Sum?.ToString("0.00")</span>
                        </FooterTemplate>
                    </GridColumn>
                    <GridColumn Width="200px" Field="@nameof(Demo.Checked)" Title="@L["Checked"]">
                        <FilterCellTemplate>
                            <CustomBooleanRowFilter Context="@context" InitialValue="false" />
                        </FilterCellTemplate>
                        <Template>
                            <input type="checkbox" checked="@(((Demo) context).Checked)" @onchange="@(args => OnCheckChanged((Demo) context, args))" />
                        </Template>
                    </GridColumn>
                </GridColumns>
                <GridAggregates>
                    <GridAggregate Field=@nameof(Demo.Hours) Aggregate="@GridAggregateType.Sum" />
                </GridAggregates>
            </TelerikGrid>

 

For example, the custome date filter looks like:


<select value="@Value" @onchange="OnFilterChanged">
    <option value="@string.Empty">All</option>
    <option value="True">True</option>
    <option value="False">False</option>
</select>

@code {
        private string Field { get; set; }
        private string Value { get; set; }
        private bool? _boolValue;
        [Parameter]
        public FilterCellTemplateContext Context { get; set; }
        [Parameter]
        public bool? InitialValue { get; set; }

        protected override async Task OnInitializedAsync()
        {
            Field = ((FilterDescriptor) Context.FilterDescriptor.FilterDescriptors[0])?.Member;
            if (InitialValue != null)
            {
                SetValue(InitialValue.Value);
                await SetFilter();
            }
            else
            {
                SetValue(((FilterDescriptor)Context.FilterDescriptor.FilterDescriptors[0]).Value);
            }
        }

        private void SetValue(object value)
        {
            if (string.IsNullOrEmpty(value?.ToString()) || value.ToString() == "All")
            {
                _boolValue = null;
                Value = string.Empty;
            }
            else
            {
                bool.TryParse(value.ToString(), out var parseResult);
                _boolValue = parseResult;
                Value = _boolValue.ToString();
            }
        }
        
        protected async Task OnFilterChanged(ChangeEventArgs args)
        {
            var value = args.Value;
            SetValue(value);
            await SetFilter();
        }

        private async Task SetFilter()
        {
            if (_boolValue != null)
            {
                var filterDescriptors = Context.FilterDescriptor.FilterDescriptors.Where(descriptor =>
                    ((FilterDescriptor)descriptor).Member == Field).ToList();

                var filterDescriptor = (FilterDescriptor) filterDescriptors[0];
                filterDescriptor.Value = _boolValue;
                
                ((FilterDescriptor)filterDescriptors[0]).Operator = FilterOperator.IsEqualTo;
                await Context.FilterAsync();
            }
            else
            {
                await Context.ClearFilterAsync();
            }
        }
    }

In my example the filter for the column "Checked" gets an initial value when page is loaded. The grid filters correctly. But the sum of the hours column show the overall sum and not the filtered one.

Do I miss something? Maybe within the filter component?

 

Best regards,

Rayko

 

Hristian Stefanov
Telerik team
 answered on 26 Aug 2021
0 answers
332 views

Hi Team,

As i'm not able to copy the text when you select folder path and it is showing as exception.

Could not find 'clipboard' in 'window.navigator'. Error: Could not find 'clipboard' in 'window.navigator'. at

Please check below code snippet.

public class ClipBoardService
    {
        private readonly IJSRuntime _jsRuntime;

        public ClipBoardService(IJSRuntime jsRuntime)
        {
            _jsRuntime = jsRuntime;
        }

        public ValueTask WriteTextAsync(string text)
        {
            return _jsRuntime.InvokeVoidAsync("navigator.clipboard.writeText", text);
        }
    }

<GridCommandButton Command="View" OnClick="@CopySelectedItemClicked" Title="Click to view folder containing this file">View</GridCommandButton>

if(clipBoardService != null)
{
await clipBoardService.WriteTextAsync(selectedItem.IsolationFolderPath);

}


Lakshmipathi
Top achievements
Rank 1
Iron
 asked on 26 Aug 2021
1 answer
127 views
I have a project that is based on the standard "sever side blazor" project template in Visual Studio.
It's been working more or less fine over the past year and has had the Telerik package there from the beginning. The project makes extensive use of Telerik' blazor controls.
When I updated to 2.26, my nav bar suddenly disappeared. I can step through the code but nothing displays.
I am pretty sure there is some kind of CSS conflict going on, but I'm just not savvy enough here to diagnose the issue.
Svetoslav Dimitrov
Telerik team
 answered on 26 Aug 2021
1 answer
165 views
How can I change for format of dates in Gantt Timeline Views.  For instance, to change to dd/MMM/yyy format?  Seems to default US format.
Hristian Stefanov
Telerik team
 answered on 24 Aug 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?