This is a migrated thread and some comments may be shown as answers.

Firing Update() Programmatically ?

2 Answers 104 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
K.Ramadan
Top achievements
Rank 2
Veteran
K.Ramadan asked on 12 Aug 2020, 11:46 AM

Hello,
I have a Button(s) in the Editor, when User clicks on that Button then a Telerik Window will be opened with a Terlerik Grid (in that Window)   (SEE attached Files)
So .. if i click on it, and choose a Row from the Grid .. and then save the selected option (SEE attached Files) and then try to save the Event (Without changing another Value) ..
So normally if i change the selected option from any DropDownList or any Item that directly Programmed in that way :

<div class="k-edit-label">
    <label for="Prioritaet">Priorität</label>
</div>
<div data-container-for="Prioritaet" class="k-edit-field">
 
    @(Html.Kendo().DropDownListFor(model => model.Prioritaet)
                         .DataTextField("Prioritaet")
                         .DataValueField("Prioritaet")
                         .OptionLabel("auswählen")
                         .Events(events => events.DataBound("onDataBound_DropDownListFor_Prioritaet_KOMM"))
                         .ValuePrimitive(true)
                         //.Value(ViewData["Prioritaet"].ToString())
                         .BindTo(new[]
                         {
                         new {Prioritaet = "1 = Niedrig", PrioritaetColor = "blue"},
                         new {Prioritaet = "2 = Normal",  PrioritaetColor = "green"},
                         new {Prioritaet = "3 = Hoch",    PrioritaetColor = "red"}
                         })
                    )
</div>

 

So this "data-container-for" will take care of it usually .... but not in my situation ! Because I'm selecting the Value from the Grid and Not From the Button, Exp. :

<div class="k-edit-label">
    <label for="Recid_person">Person</label>
</div>
<div data-container-for="Recid_person" class="k-edit-field">
    @(Html.Kendo().Button()
        .Name("PersonenSuche_BTN")
        .HtmlAttributes( new {type = "button"} )
        .Content("Personen Suchen"))
</div>

 

So i need that the Event Editor the Update() calls, so that i can Update only that Field (if Only one Field (Value) changed) ..

 

Steps To Follow :

1 - Editor_Buttons_Grid

2 - Editor_Buttons_Grid_Button

3 - Update_Speichern_X

 

 

Thank you in advance 

 

regards Karam

2 Answers, 1 is accepted

Sort by
0
K.Ramadan
Top achievements
Rank 2
Veteran
answered on 13 Aug 2020, 06:48 AM

Hello,

i got this .. I saved the selected Values in a global variable and use it to change the values that i wanted to edit, then i called the dataSource.sync()
i have to go through the whole dataSouce to find the Event that i want to Edit so if i have like thousands of Events .. it may work .. but it is surely not the best solution ..
So this is a Workaround and Not a standard Solution .. if you have a clearer or faster Solution please let me know.

Thanks anyway :-)

0
Aleksandar
Telerik team
answered on 14 Aug 2020, 09:08 AM

Hello Karam,

From the provided information it is not clear how the Grid is linked to the Scheduler model.

As you already have a custom template for editing Scheduler events what I can suggest is to try and add a hidden input field, for a property that would be part of the model for the Scheduler event. Then when the user selects an item from the Grid update the value of the hidden input. This way, when you save the event the Scheduler model will be sent back to the action method, including the selection made.

I hope this will help you implement the desired functionality.

Regards,
Aleksandar
Progress Telerik

Tags
Scheduler
Asked by
K.Ramadan
Top achievements
Rank 2
Veteran
Answers by
K.Ramadan
Top achievements
Rank 2
Veteran
Aleksandar
Telerik team
Share this question
or