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

Boolean in Grid (.NET CORE) inline Edit not working

9 Answers 473 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rubesh
Top achievements
Rank 1
Rubesh asked on 15 Mar 2018, 08:39 AM

hi

i noticed the Checkbox is not working in the .net core Grid (inline edit) mode. i can see that in your demo itself https://demos.telerik.com/aspnet-core/grid/editing-inline

is this a known issue are there any work arounds

 

Regards,

Rubesh

 

 

9 Answers, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 16 Mar 2018, 11:58 AM
Hi Rubesh,

The behavior is a known issue and the developers have already fixed it. The fix will be included in the next official release that is scheduled for the beginning of May.

Until the new release is available I can suggest using a regular checkbox instead. I apologize for any inconvenience this may cause you.


Regards,
Viktor Tachev
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Justin
Top achievements
Rank 1
answered on 21 Mar 2019, 11:10 PM

We are having trouble with the Switch not setting false or undoing the true value.  We are using it in the Grid Popup Custom editor with UIHints.  Very straight forward, but after clicking ON, and seeing the value in the grid update, when we try to click Off the grid is not updated and after saving the previous value is still in the database.  Confirmed on grid refresh the value isn't false/off.

We check the values in the Update Action for concurrency but it doesn't recognize the values as different and no updates are done unless another value is updated, meaning it isn't passing the value when only click the switches.  When using the checkbox/boolean UIhint, it works as expected.  The Name("") is populated at runtime by the model value, in this case IsActive and IsDeleted.  We can see this in the View Source and we can see it set the True value onClick.

@model bool?
@(Html.Kendo().Switch()
  .Name("")
)

Is there an issue?  The boolean checkbox UIHint works just fine.  When you check the box, you see it in the grid, and when unchecked you see it remove int e grid, and the values update the database as expected.

@model bool?
@(Html.Kendo().CheckBoxFor(m => m))

 

0
Justin
Top achievements
Rank 1
answered on 21 Mar 2019, 11:12 PM
I also just noticed that when toggling, the aria value changes from true to false, and vice versa but the actual value always says true.  Attached in the screenshot you can see the values, they should both be false/off.
0
Viktor Tachev
Telerik team
answered on 26 Mar 2019, 01:44 PM
Hi Justin,

In order to bind the Switch widget to the respective field in the Model I would suggest using SwitchFor. The definition for it would be similar to this:

@model bool?
 
@(Html.Kendo().SwitchFor(m=>m)
)


Regards,
Viktor Tachev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Justin
Top achievements
Rank 1
answered on 26 Mar 2019, 05:48 PM

Thank you for responding.  Unfortunately, I had tried that and just confirmed again that the same bug remains.  When clicking active/on you see the grid update with a checkmark, but when clicking off nothing happens and it doesn't update the DB with 0/false.

Attached are some images to help show the values not being switched back to false.

0
Viktor Tachev
Telerik team
answered on 29 Mar 2019, 02:13 PM
Hello Justin,

I tried replicating the behavior, however, editing seems to work as expected on my end. Check out the attached project that I used for testing and let me know if I am missing something. 

It would be great if you can modify the sample in a way that the issue is replicated and send it back so we can examine it.


Regards,
Viktor Tachev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Justin
Top achievements
Rank 1
answered on 01 Apr 2019, 10:02 PM

Thank you for the reply, but that still did not work.  Your project is not .NET CORE.  Same issue it doesn't the False/Off after selecting True/On.

Couple of things:
1. We are using .NET Core 2.2 and Telerik Core tools.
2. After moving to True, we are unable to get False to trigger
3. You can see in the image the Active Checkmark is still showing Active even though it was moved to False/Off.
4. We were using the UIHint, but I tried your inline version
5. We are using popup_Template

0
Justin
Top achievements
Rank 1
answered on 01 Apr 2019, 10:09 PM
Here is the Checkbox which works.  If you notice the Hidden Field is being updated to False, but on the Switch this is not being "switched" or updated when selecting false.
0
Viktor Tachev
Telerik team
answered on 04 Apr 2019, 12:56 PM
Hi Justin,

I tried replicating the behavior in a .NET Core project using the same Grid configuration. However, the Switch seems to work as expected on my end. 

Give the attached sample a try and let me know what should be different in order to replicate the issue. It would be great if you can modify the sample in order to reproduce the issue and send it back.


Regards,
Viktor Tachev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Rubesh
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Justin
Top achievements
Rank 1
Share this question
or