Telerik Forums
UI for Blazor Forum
1 answer
186 views

Hi

I have a huge project

I've tried to upgrade to 3.0 but stopped to work

InvalidOperationException: Object of type 'Telerik.Blazor.Components.TreeViewBinding' does not have a property matching the name 'ExpandedItems'

And similare because in textbox label not exist anymore

But: in the documentation I've not read that this property are obsolete

Or other property similar to substite

What is the problem ?? How can I convert the proj to 3.0 ??

Tnx

 

Dimo
Telerik team
 answered on 31 Jan 2022
2 answers
503 views

Hi, 

I use ListView with attached OnRead event handler to page and filter data at database level.

When the filter changed, I only called the read data event handler with the previously saved DataSourceRequest again which assigned the data to the bound list. Now I must use the eventargs properties, which is ok for paging but not for any other data-changing use case.

There is no Grid State like feature in ListView and binding the Data property is forbidden when using OnRead (at least it has no effect).

So, how to manually trigger OnRead in v3.0 ListView?

Hristian Stefanov
Telerik team
 answered on 31 Jan 2022
1 answer
387 views

Hello,

My team would like to create E2E tests in Cypress for the grids we use and we are wondering whether it's possible to set unique ID values on the filter row. Currently, these IDs are just GUID values and we couldn't find a way to modify them.

 

Kind regards,

Greg

Marin Bratanov
Telerik team
 answered on 30 Jan 2022
1 answer
127 views
I am using telerikcombobox inside telerikgridn as column. I need to show a value from db in the empty combobox on pageload. Can anyone please help me. Thank you
Marin Bratanov
Telerik team
 answered on 30 Jan 2022
1 answer
234 views

Hi,

 

I'm quite new with telerik and I'm facing a probleme.

A use the grid to follow the status of a property. These status is defined by an enum (it could have been a dictonary, anyway)

When I bind my Grid datasource, in there is an int field representing the enum status.

IE: 0=open, 1=Closed,...

So I've bound the enum to the comboox, TextField and ValueField displays the correct data but on load for example, i'm not able to use the @bind-Value to the correct row. even more, on runtime, if I change one combobox, every comboboxes changes their value

 

I don't see the solution

 


<TelerikGrid Data="@WorkingData" 
             Height="auto"
             Pageable="true" 
             Sortable="true" 
             PageSize=30
             Resizable="true" 
             EditMode="GridEditMode.Popup">
    <GridColumns>
        <GridColumn Field="@(nameof(Work.Status))" Title="Status" Editable=true >
            <Template>
                <TelerikComboBox Width="100%" Data="@comboData" TextField="Value" ValueField="Key" @bind-Value="@cbValue" ></TelerikComboBox>
            </Template>
        </GridColumn>
        
        <GridColumn Field="@(nameof(Work.Comment))"  Title="Comment" />
    </GridColumns>
</TelerikGrid>

@code
{
    enum TicketStatus
    {
        Open = 0,
        Close = 1,
        Planned = 2,    
        Canceled = 3
    }
    public class Work
    {
        public int Status { get; set; }
        public string Comment { get; set; }
    }

    private List<Work> WorkingData;
    private Dictionary<int, string> comboData;
    private int cbValue;

    protected override void OnInitialized()
    {
        base.OnInitialized();

        comboData = Enum.GetValues(typeof(TicketStatus)).Cast<Enum>().ToDictionary(t => (int)(object)t, t => t.ToString());

        WorkingData = new List<Work>
        {
            new Work{Status=1,Comment="My First property"},
            new Work{Status=3,Comment="My second property"},
            new Work{Status=2,Comment="My Third property"},
        };

        cbValue = 0;

    }
}

Does anyonce could help me

 

Regards;

Marin Bratanov
Telerik team
 answered on 30 Jan 2022
1 answer
804 views

Hello,

In the Telerik multiselect, when I select some options in my multiselect, the multiselect div expands and the display doesn't look good. So I now just want to show the number of options selected instead of the options selected. I looked for it but could not find some solutions regarding it.

For ex, lets say there are the following options in the multiselect: One, Two, Three, Four, Five, Six, Seven, Eight, Nine, Ten.

Now when I select One, Five and Seven from the multiselect dropdown, I want the text inside the multiselect component to be "3 selected".

Is there any workaround for it?

 

Thanks,

Susan

Marin Bratanov
Telerik team
 answered on 30 Jan 2022
1 answer
155 views

I have a grid setup, and would like to double click to open the pop up to edit the row.  I set the Grid and add the OnRowDoubleClickHandler to my code.  I tested that this works, from the debugger when I double click a row the Handler gets called correctly.

I then add code to get the current state from the grid, I setup the EditItem and the OriginalEditItem then I Set the State.

My problem is I need todo Three clicks to get this to work.  I have to double click the row, then wait and click once more in the same row, then the pop up editor comes up.  I can do fast three clicks and it works as well.  If I double click on the row to edit, then even click once time on any other row, the original row comes up for edit.

From the examples I am setting the state like this:

 var currState = GridRef.GetState();
        // reset any current insertion and any old edited items. Not mandatory.
        currState.InsertedItem = null;

        // add item you want to edit to the state, then set it to the grid
        SampleData originalItem = MyData.Where(itm => itm.ID == 4).FirstOrDefault();
        SampleData itemToEdit = SampleData.GetClonedInstance(originalItem);

        // you can alter values here as well (not mandatory)
        //itemToEdit.Name = "Changed from code";
        currState.EditItem = itemToEdit;
        currState.OriginalEditItem = originalItem;

        // for InCell editing, you can use the EditField property instead
        await GridRef.SetState(currState);
Russ
Top achievements
Rank 1
Iron
 answered on 28 Jan 2022
1 answer
286 views

What happened to it? Don't know if it affected the code below. In either case the code is not working. Seems like it should

 

I am trying to write code to expand/collapse nodes when they are clicked on regardless if I click on  the expand arrow or text.

Getting nowhere.


    private void OnTvItemClick(object e, TreeItem tvItem)
    {
        if(tvItem.HasChildren)
        {
            tvItem.Expanded = !tvItem.Expanded;
        }
    }

Can  you help?

Thanks ... Ed

 

Apostolos
Telerik team
 answered on 28 Jan 2022
2 answers
358 views

I am wanting to display a static line on a line chart to show a target the is hoping to be reached.

the screenshot is an example of the current graph and what we need is a solid line to be shown at a set value for example 2250 that goes all the way across so that you can see which points are hitting the target needed.

Peter
Top achievements
Rank 2
Iron
Iron
Veteran
 answered on 28 Jan 2022
1 answer
240 views

Hello, right now, I am getting the "Object reference not set to an instance of an object." error for rendering the Gantt Timeline. I'm not sure how to send the data from the Gantt Tree to the timeline or setting the timeline to the correct model. The tree renders just fine. Help with understanding Data Binding with the parameters (IdField, ParentIdField, ItemsField, HasChildrenField) will be great as well.


Razor Page:


<TelerikGantt Data="@SchedulesList"
                  @bind-View="@SelectedView"
                  IdField="Id"
                  ParentIdField=""
                  Width="100%"
                  Height="600px"
                  Sortable="true"
                  SortMode="@SortMode.Multiple"
                  FilterMode="@GanttFilterMode.FilterMenu"
                  FilterMenuType="@FilterMenuType.Menu">
               
        <GanttViews>
            <GanttDayView></GanttDayView>
            <GanttWeekView></GanttWeekView>
            <GanttMonthView></GanttMonthView>
            <GanttYearView></GanttYearView>
        </GanttViews>
        <GanttColumns>
            <GanttColumn Field="Sequence"
                         
                         Title="Sequence">
            </GanttColumn>
            <GanttColumn Field="ScheduledStart"
                        
                         Title="Scheduled Start"
                         >
            </GanttColumn>
            <GanttColumn Field="ScheduledEnd"
                        
                         Title="Scheduled End">
            </GanttColumn>
            <GanttColumn Field="ScheduledDuration"
                         
                         Title="Scheduled Duration">
            </GanttColumn>
            <GanttColumn Field="Activity.Name"
                        
                        Title="Activity Name">
            </GanttColumn>
            <GanttColumn Field="Resource.Name"
                         
                         Title="Resource Name">
            </GanttColumn>
        </GanttColumns>
    </TelerikGantt>



@code {
    private List<VentureBlazor.Models.ActivityResource> SchedulesList { get; set; }
    private List<VentureBlazor.Models.Activity> ActivitiesList { get; set; }
    private List<VentureBlazor.Models.Resource> ResourcesList { get; set; }
    private ActivityScheduleRepository repo;
    public GanttView SelectedView { get; set; } = GanttView.Year;

    protected override async Task OnInitializedAsync()
    {
        repo = new ActivityScheduleRepository(ContextFactory.CreateDbContext());
        await LoadSchedules();
         
        base.OnInitialized();
       
    }

     public async Task LoadSchedules()
    {
        ActivitiesList = await repo.GetAllActivitiesAsync();
        ResourcesList = await repo.GetAllResourcesAsync();
        SchedulesList = await repo.GetAllActivityResourceSchedulesAsync();

    }

      public void Dispose()
        {
            repo.Dispose();
        }
}
Model:

 public class ActivityResource
    {
        [Key]
        public int Id { get; set; }
        public int ActivityId { get; set; }

        public int ResourceId { get; set; }

        public double Sequence { get; set; }

        public DateTime ScheduledStart { get; set; }

        public DateTime ScheduledEnd { get; set; }

        public double ScheduledDuration { get; set; }

        public Activity Activity { get; set; }

        public Resource Resource { get; set; }
    }

    public class Resource
    {
        public int Id { get; set; }
        public string Name { get; set; } = "New Resource";
        public string Description { get; set; }

        public int ResourceTypeId { get; set; }
        public virtual ResourceType ResourceType { get; set; }



        public ICollection<Activity> Activities { get; set; }
        public ICollection<Project> Projects { get; set; }


        public List<ActivityResource> ActivityResources { get; set; }
        public List<ProjectActivity> ProjectActivities { get; set; }


    }


Nadezhda Tacheva
Telerik team
 answered on 28 Jan 2022
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?