Telerik Forums
UI for Blazor Forum
1 answer
202 views

I am trying to add something like

<a href="#" onclick="doSomething()">do something</a>

Svetoslav Dimitrov
Telerik team
 answered on 11 Mar 2022
1 answer
183 views

Hello,

I am currently working on grids with a server side pager system.
https://docs.telerik.com/blazor-ui/components/grid/manual-operations

Recently I wanted to add multiple line selection but with the server side pager I can't get a correct behavior.

My SelectedItems variable which contains the list of selected items keeps the selected items despite the change of page but on the other hand when I come back to a page with selected items, the checkboxes are not checked.
In addition I can reselect them which adds them several times in my list.

Do you have an example of a server-side paging system with multiple line selection?

 

Marin Bratanov
Telerik team
 answered on 10 Mar 2022
1 answer
266 views
I need the accept="images/*" attribute in the generated file upload by using TelerikUpload. How can I do this?
Marin Bratanov
Telerik team
 answered on 10 Mar 2022
1 answer
747 views

Hello everyone, I hope you are good.

In our application we use the Flux approach, with Fluxor library.

Before the 3.0.0 version release, we had no issue to use the Grid component with server side pagination while using Flux. To simplify, let's imagine that we use only one Store, with one simple state :

public record HouseState(List<HouseSimple> Houses, int TotalCount)

In grids components, we used to:

  • Bind "Data" parameter to the "Houses" field of the state
  • Bind the "TotalCount" parameter to the "TotalCount" field of the state
  • Bind this callback:
protected void ReadItems(GridReadEventArgs args) {
  var page = args.Request.Page;
  var filters = args.Request.Filters;
  var sorts = args.Request.Sorts;

  dispatcher.Dispatch(new LoadHouseAction(page, filters, sorts));
}

As you can see, we get all required information (page, skip etc.), then we dispatch the action. The action will perform an API call, and will create another state with new received data.

<TelerikGrid Data="@State.Houses"
             TotalCount="@State.TotalCount"
             OnRead="@ReadItems">

After migration of Telerik 3.0.0

We cannot use the "TotalCount" parameter anymore. So we need to use the OnRead event, in order to set the TotalCount in it. In the documentations, all examples are like :

protected async Task ReadItems(GridReadEventArgs args)
    {
        DataEnvelope DataResult = await FetchPagedData(args.Request.Page, args.Request.PageSize);

        args.Data = DataResult.CurrentPageData;
        args.Total = DataResult.TotalItemCount;
    }

This approach is made to be used with a classic approach to "ask and wait the data". It could work perfectly but in the approach that we use (flux pattern) it is more like "ask and save in state the data, and views use state". 

To be able to keep the same functionality of server side pagination, we had to subscribe in our view to the event "the data in the store has been refreshed" and then call the Rebind method of the grid. Something like that:

private void UpdateGridData(AgencesSetAgencesAction action) {
  if (GridRef is null) return;
  GridRef.Rebind();
}

protected void ReadItems(GridReadEventArgs args) {
  var total = this.HousesState.Value..TotaCountl;
  var data = this.HousesState.Value.Items;

  args.Total = total;
  args.Data = data ?? Enumerable.Empty<HouseItem>();
}

It works perfectly, but it seems that we break the Flux approach.

Is there any other way to perform that, while using flux approach or something like it?

Thanks a lot, do not hesitate to ask for some precision. 

// Dylan

Marin Bratanov
Telerik team
 answered on 10 Mar 2022
0 answers
149 views

I am using the radslider and have it oriented horizontally but it displays vertically.  I attached a screenshot below.

 

<div class="column is-half">
<small>Weeks ahead to buy</small><br />
<strong><TelerikSlider @bind-Value="@Value"
   Min="0"
   Max="6"
   SmallStep="1"
   LargeStep="2"
   Width="350px"
   Orientation="SliderOrientation.Horizontal">
</TelerikSlider></strong>
</div>

 

 

 

 

Eddie
Top achievements
Rank 1
 asked on 09 Mar 2022
1 answer
272 views

Is it possible to make the Stepper align left (when there are more then one Stepper) instead of center?

i.e. 

 

Dimo
Telerik team
 answered on 09 Mar 2022
0 answers
559 views

Hi,

 

I have a combobox loaded with databse values, and I want to set the selected value with the value of my selected record when I open my telerikwindow where my combobox is. Right now it doesn't work.

 

.razor

  <FormItem ColSpan="1">
                                        <Template>
                                            <label for="store-country" class="k-label k-form-label">Pays</label>
                                            <TelerikComboBox Data="@CountryList" TextField="DescFr" ValueField="Id" @bind-Value="@SelectedCountryId" Width="90%"></TelerikComboBox>
                                        </Template>
                                    </FormItem>

.cs

        public void StoreEdit(int storeSelected = 0)
        {
            SetDropDownList();

            if (storeSelected > 0)
            {
                store = storeService.ReadItem(storeSelected);
                SetSelectedValue(store);
            }
        }

        private void SetSelectedValue(RSS_BasicStoreNational store)
        {
            SelectedProvinceId = store.IDProvince;
            SelectedCountryId = store.IDCountry;
            SelectedRegionId = store.RegionID;
            SelectedDistChannelId = store.DistributionChannel;
            SelectedInStoreSystemCode = store.CodeInStoreSystem;
            SelectedStoreTypeId = store.StoreTypeID;
            SelectedLanguageCode = store.CodeLanguage;


            OpenDateTimePicker = store.OpeningDate != null ? store.OpeningDate.Value : DateTime.Today;
            if (store.ClosingDate != null)
                CloseDateTimePicker = store.ClosingDate;
        }

        private void SetDropDownList()
        {
            ProvinceList = storeService.GetProvinces();
            CountryList = storeService.GetCountries();
            RegionList = storeService.GetRegions();
            DistChannelList = storeService.GetDistChannels();
            InStoreSystemList = storeService.GetInStoreSystems();
            StoreTypeList = storeService.GetStoreTypes();
            LanguageList = storeService.GetLanguages();
        }

 

stephane
Top achievements
Rank 1
 asked on 09 Mar 2022
0 answers
207 views

Okay, this one is getting me frustrated.

One of the columns that I am retrieving from the database is formatted with HTML and looks like:

 

17 04 01<br />17 04 02<br />17 04 05<br />20 01 40

 

Now, when I use webForms, the items will display like this:

 

17 04 01

17 04 02

17 04 05

20 01 40

 

However, in blazor they display like:

 

17 04 01<br />17 04 02<br />17 04 05<br />20 01 40

 

How can I get them to display like they did in webforms?

 

I've even tried to split the string and then loop thru the results and I still cannot get them to display on separate lines.

 

 

aehlert
Top achievements
Rank 1
Veteran
 asked on 08 Mar 2022
1 answer
338 views

Hello,

I have a model to serve as data in a grid. Besides regular single field data, like strings and numbers etc, the model also contains a List of multiple subitems which need to be added to each row, in a cell. My grid would look like this:

FirstFieldName              SecondFieldName                 ListOfItemsField

------------------------------------------------------------------------------------------------

DataForItemOne          DataForItemOne                     SubItemOneOfItemOne

                                                                                         SubItemTwoOfItemOne

                                                                                         SubItemThreeOfItemOne

------------------------------------------------------------------------------------------------

DataForItemTwo          DataForItemTwo                     SubItemOneOfItemTwo

                                                                                         SubItemTwoOfItemTwo

                                                                                         SubItemThreeOfItemTwo

-----------------------------------------------------------------------------------------------

                              etc etc etc etc.

 

My question is: how am I able to add multiple values into a cell? As mentioned, the values belong to a List contained by the model. Each model in the table would have its own List of subitems.

Thank you very much.

Kind regards

Nadezhda Tacheva
Telerik team
 answered on 08 Mar 2022
1 answer
177 views

Hello. 
I'm wondering why the documentation examples in Form section: Automatic Generated Fields doesn't work.  I simply copy and paste the example in a clean Blazor project with Telerik for Blazor 3.0.0 and the compiler can't find the definition for FormEditorType.


I don't missing any reference even tried the full namespace that the API documentation indicate and I didn't find any comment that the property is deprecated.

Any ideas?


Regards.
Ludwig.

 

Nadezhda Tacheva
Telerik team
 answered on 08 Mar 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?