Window immediately closes and then parent form OnValidSubmit() function is called

2 Answers 27 Views
Grid Window
John
Top achievements
Rank 1
Iron
John asked on 04 Jun 2021, 01:56 PM | edited on 04 Jun 2021, 01:57 PM

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

2 Answers, 1 is accepted

Sort by
0
John
Top achievements
Rank 1
Iron
answered on 04 Jun 2021, 02:45 PM
So the solution was to move the event handler from a telerik button rendered in its own grid column to a gridcommandbutton rendered in the command column. 

Would still be interested to know why they work so differently. 
0
Svetoslav Dimitrov
Telerik team
answered on 09 Jun 2021, 10:26 AM

Hello John,

Could you provide some more information on the setup of the Grid and the Models that you are using? From what I can see the Form is bound to a complex model. I am asking for more information so that we are able to properly investigate because the scenario you are facing seems like an odd one. The TelerikButton in a standard column should behave similarly to the GridCommandButton when we reference the OnClick event. The major difference is that the GridCommandButton provides an object of type GridCommandEventArgs, whereas the Button in a standard templated column would have access to the context. 

That being said, a runnable reproducible demo application would really help us to better determine and assist you in the situation you are facing. We genuinely love to help our fellow developers achieve beautiful and fully functional applications and this is our major priority.

Regards,
Svetoslav Dimitrov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Grid Window
Asked by
John
Top achievements
Rank 1
Iron
Answers by
John
Top achievements
Rank 1
Iron
Svetoslav Dimitrov
Telerik team
Share this question
or