Telerik Forums
UI for Blazor Forum
1 answer
478 views

I have a mutliselect contained with in a window control which is then hosted on the parent page as a component.

The window control also contains a button to click once you select from the multi select which in it's onclick code performs a call back to the mainpage like this: OnSelectedItems.InvokeAsync(selectedItems);

At this point the selected items are in the variable. But the parent page does not seem to receive them. I am sending the component code as well as how it's referenced in the parent page. I have tried everything.

This is the parent page razor code:

EditForm Model="@ps" OnValidSubmit="FilteredSearchAsync">
    <button type="submit">Search</button>
    <label id="lbldodId">
        DoD Id:
        <InputText id="DodIdSearch" @bind-Value="ps.DodId" />
        <img src="/Images/icon-magnifying-glass.jpg" @onclick="showPopup" alt="" style="width:25px;height:25px;" />
    </label>

    <SearchFilterPopupComponent IsVisible="@showFilterPopup"  InputData ="@dodIdList"  selectedItems="@selectedDodIds" OnSelectedItems="@UpdateThisComponent"></SearchFilterPopupComponent>

    <label id="lblFirstName">
        First Name:
        <InputText id="FirstNameSearch" @bind-Value="ps.FirstName" />
    </label>
    <label id="lblLastName">
        Last Name:
        <InputText id="LastNameSearch" @bind-Value="ps.LastName" />
    </label>
    <button @onclick="ClearSearch">Clear</button>
</EditForm>

 

        protected void UpdateThisComponent()
        {
            if (selectedDodIds.Count > 0) // at this point the count is zero
            {
                showFilterPopup = false;
                ps.DodId = selectedDodIds[0]; //just grabbing the first one for now

                StateHasChanged();
            }
        }

 

 

This is my component code:

<TelerikWindow @bind-Visible="@IsVisible">
    <WindowTitle>
        <strong>The Title</strong>
    </WindowTitle>
    <WindowActions>
        <WindowAction Name="Minimize" />
        <WindowAction Name="Maximize" />
        <WindowAction Name="Close" />
    </WindowActions>
    <WindowContent>
        <TelerikMultiSelect Data="@InputData"
                @bind-Value="@selectedItems"
                Placeholder="Enter Dod ID or click to see all."
                Width="350px" ClearButton="true" AutoClose="false">
        </TelerikMultiSelect>

        <TelerikButton OnClick="@ItemsSelected">Select</TelerikButton>

    </WindowContent>
</TelerikWindow>

 

    public partial class SearchFilterPopupComponent
    {
        [Parameter] public List<string> InputData { get; set; }
        [Parameter] public EventCallback<List<string>> OnSelectedItems { get; set; }
        [Parameter] public EventCallback<bool> OnVisibleChanged { get; set; }
        [Parameter] public bool IsVisible { get; set; }
        [Parameter] public List<string> selectedItems { get; set; }

        protected void OpenWin()
        {
            IsVisible = true;
        }

        protected void CloseWin()
        {
            IsVisible = false;           
            OnVisibleChanged.InvokeAsync(IsVisible);
        }

        protected void ItemsSelected()
        {
            IsVisible = false;
            OnSelectedItems.InvokeAsync(selectedItems); //AT this point all the items selected are in this variable.
        }
    }
}
Hristian Stefanov
Telerik team
 answered on 09 Jun 2021
2 answers
204 views

Hi there,

 

I have a form:

    <TelerikForm Model="Template" OnValidSubmit="SubmitTemplateAsync">
        <FormItems>
            <TelerikTextBox @bind-Value="Template.Title" PlaceHolder="Title"></TelerikTextBox>
            <br />
            @foreach (EvaluateQuestionGroup group in Template.QuestionGroups)
            {
                <TelerikTextBox @bind-Value="group.Title"></TelerikTextBox>
                <TemplateLibraryEvaluateQuestionGrid Template="Template" QuestionGroup="group"></TemplateLibraryEvaluateQuestionGrid>
                <br />
            }
        </FormItems>

    </TelerikForm>
The Grid in this form has a window component that allows a user to post comments about individual grid rows. To access this popup they click a telerikbutton rendered in a grid column which toggles the window and passes it the grid row as a Parameter.

However, when a user clicks the button the window pops up and then immediately after OnInitializeAsync ends it disappears, at which point the form pasted above calls its OnValidSubmit. 

Can you tell me why this is happening?

All the best,
John
Svetoslav Dimitrov
Telerik team
 answered on 09 Jun 2021
1 answer
233 views

Hello

A short video was recorded how and when the issue occurred.

Best

Hristian Stefanov
Telerik team
 answered on 09 Jun 2021
2 answers
180 views
I want to make a separate razor page to to hold the markup & code for the window component. Then display it modally on the man page. Can that be done?
David
Top achievements
Rank 1
Iron
Iron
Iron
 answered on 08 Jun 2021
1 answer
416 views
I understand how to make the range slider fill a horizontal space using Width but is there a way to make a Vertical Range Slider fill a vertical space?
Dimo
Telerik team
 updated answer on 08 Jun 2021
1 answer
673 views
Is there any way to do a textbox tag editor like the one below from this forum (see attached)?
Dimo
Telerik team
 answered on 08 Jun 2021
1 answer
1.0K+ views

Hi,

When I try to run the example on the following page I get an error:
Page: https://docs.telerik.com/blazor-ui/components/form/formitems/overview#customize-the-appearance-of-the-editors-in-the-form 
Error: Unhandled exception rendering component: Object of type 'Telerik.Blazor.Components.FormItem' does not have a property matching the name 'Enabled'.

Additionally, the example that uses the "[Editable(false)]" attribute on the model attached to the form does not render the control in a disabled state, as stated. (Example on this page: https://docs.telerik.com/blazor-ui/components/form/overview )

Any help would be appreciated. Thank you,
Jesse

 

Svetoslav Dimitrov
Telerik team
 answered on 08 Jun 2021
1 answer
2.7K+ views
Is there a way to lock (freeze) the header row?
Eric R | Senior Technical Support Engineer
Telerik team
 answered on 07 Jun 2021
1 answer
724 views

Is there a way to put an entire page and it's associated code-behind file as part of a tabstriptab content?  I'm having a problem styling the entire "page" since it has a component containing a tab strip and it always ends up on the left side of the page and the content ends up on the right side of the page.  The best thing would be to put the content in the tab content itself but i don't want to put all that html and code into one file that contains the tabstriptab.

 

Thanks,
Lawrence.

Eric R | Senior Technical Support Engineer
Telerik team
 answered on 07 Jun 2021
2 answers
1.3K+ views

Hi

The idea we have is to have a list of tileLayoutitems. The user starts with an empty TileLayout and starts a wizard, the wizard lets the user choose from a list which tilelayoutitems he or she wants to see.  We save this information in our database. So then, we need code to populate the tilelayout with the choosen tilelayout items.

Qeustion is this possible to do and how?

Eric

 

 

Nadezhda Tacheva
Telerik team
 answered on 07 Jun 2021
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?