This is a migrated thread and some comments may be shown as answers.
In Kendo Grid The textbox and switch selection values are lost when page changed
3 Answers 17 Views
This is a migrated thread and some comments may be shown as answers.
Mohammed
Top achievements
Rank 1
Mohammed asked on 13 Jun 2020, 04:54 AM

Hi,

I have a kendogrid in MVC , in that i am loading switch and textbox and dropdown control using client template, below is the example, but when i change the value in textbox  and dropdownlist and switch and then i go to the next page in the grid  the entered and selected value is lost and back to original.for example below you can check, Is there any way to maintain the selected and entered value in the grid when i go to the next page in grid, please help on this.

 

 

http://dojo.telerik.com/@Iliana/eYUCi

 

Thanks

Mohammed

3 Answers, 1 is accepted

Sort by
0
Tsvetomir
Telerik team
answered on 16 Jun 2020, 10:01 AM

Hi Mohammed,

I have investigated the provided sample and I have noticed that the switch is by no means bound to the underlying data item in the data source. The only thing that is added is that the switch uses a property to determine whether the switch should be set to true or false. 

However, if you would like to retain any changes, you should change the underlying data item whenever the switch has been changed. Here is an updated version of your example:

https://dojo.telerik.com/OJirOviJ

I hope you find this helpful.

 

Kind regards,
Tsvetomir
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Mohammed
Top achievements
Rank 1
answered on 18 Jun 2020, 01:16 PM

Hi Tsvetomir,

Thank you its working, Also i need the same  for textbox and dropdownlist also can you please help on this too..Below is code i have in Grid, Both should maintain the data

Textbox Code in grid

.ClientTemplate("<textArea class='k-textbox caaInput' name='#=Id#'    >columnname </textArea>")

DropdownList Code in Grid

.ClientTemplate(HTML.Kendo().DropdownList().Name("#=Id#")

.DataValueField("Value")

.DataTextField("Text")

.BindTo

).Width(200)

 

Thank you

Mohammed

 

 

0
Tsvetomir
Telerik team
answered on 19 Jun 2020, 03:19 PM

Hi Mohammed,

In general, for the TextArea element, you should attach the change event and execute a similar logic that I provided in my previous response.

As per the DropDownList, you can attach its change event directly:

.Events(ev=>ev.Change("onChange"))

 

Regards,
Tsvetomir
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
Grid
Asked by
Mohammed
Top achievements
Rank 1
Answers by
Tsvetomir
Telerik team
Mohammed
Top achievements
Rank 1
Share this question
or