We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Weird event occurs with check boxes

I have two checkboxes in the grid, I check one of the two then hit save and they both get checked?  Anything ideas what is going on?



9 Replies

VN Vignesh Natarajan Syncfusion Team March 8, 2019 10:13 AM UTC

Hi Sybil, 
 
Thanks for using Syncfusion products. 
 
Query: “, I check one of the two then hit save and they both get checked?” 
 
From your query, we understand that you are facing issue while updating the checkbox value in ejGrid. We have analyzed the reported issue and reported issue will occur when both the check box has same id. So kindly share the following details.  
 
  1. Share the Grid rendering code. (client side and server )
  2. Share the code example where you have rendered the checkbox.
  3. Share the screenshot / video demonstration of the reported issue.
 
Regards, 
Vignesh Natarajan. 
 



SC Sybil Charles March 8, 2019 12:34 PM UTC

I have figured out it works on update but not on add.

Attachment: ClientPlatformIntegrations.aspx.designer_6048760e.zip


VN Vignesh Natarajan Syncfusion Team March 11, 2019 07:03 AM UTC

Hi Sybil, 
 
Thanks for the update. 
 
Query: “I have figured out it works on update but not on add.” 
 
Before proceeding with your, kindly share the following details 
 
  1. Share the Grid rendering code.
  2. Share the details how you have rendered the checkbox inside the Grid (columnType or template).
  3. Ensure both the checkbox has unique columns ,ids and fields.
  4. Share the video demonstration of the reported issue.
 
Note: Attachment you have is not properly attached. So kindly reattach the requested details. 
 
Regards, 
Vignesh Natarajan. 



SC Sybil Charles March 11, 2019 12:13 PM UTC



VN Vignesh Natarajan Syncfusion Team March 12, 2019 12:50 PM UTC

Hi Sybil, 
 
Thanks for the update. 
 
Query: “I have figured out it works on update but not on add. 
 
From your query, we understand that you are facing issue while adding a record with checkbox filed value. We have checked your reported problem by using your code example and from your code example found that  while on adding we have get “True” value KeyVal2["EXTRACT"].ToString() instead of on. So everytime while adding, this value will the false. This will leads to the reported problem.  Please ensure that which value you have get on the serverside whether true or on while adding. 
 
Please refer to the screenshot:- 
 
 
We need some additional information to find the cause of the issue. Please share us the following details. 
 
  1. Share the screenshot  whether you get the value “on” or “True” KeyVal2[“Extract”].ToString() while on Adding.
  2. Screenshot/Video Demo to replicate the issue and what value you have get after updating the values on serverside.
 
Regards, 
Vignesh Natarajan. 



SC Sybil Charles March 14, 2019 12:19 PM UTC

Actually, No that is not the reported problem.  The reported problem and yes I tried both true and on for them both, that was just were I left it because it doesn't matter fro the issue. When Just ONE check box is checked on the UI (there are two).  TWO are checked before it gets to the code on the Server side.  You can see it on the UI after the add button is clicked.  If you would like to see this happen I would be happy to show you.


VN Vignesh Natarajan Syncfusion Team March 15, 2019 12:28 PM UTC

Hi Sybil, 

Sorry for the inconvenience caused. 

We have checked your reported problem by preparing the sample but we are unable to reproduce your reported problem at our end.  We need some additional information to find the cause of the issue . Please share us the following details. 
     
  1. How you have bind the dataSource for checkbox column from sql (in the form of  binary values or else Boolean values). Share us the screenshot or Video Demo like how the data has been passed from sql.
  2. You have mentioned that you have resolve the issue while updating a records. Kindly share the video demonstration how the value is updating for check box column.
  3. If possible share us the issue reproducing sample or hosted Link.
  4. Also confirm whether values for the checkbox column is updated properly based on dataSource on initial Render.

Regards, 
Vignesh Natarajan 
 



SC Sybil Charles March 19, 2019 12:39 PM UTC

I don't have a recorder but tried to show you in the screen shots.

Attachment: SynchIssue_5dc72ac7.zip


VN Vignesh Natarajan Syncfusion Team March 20, 2019 06:07 AM UTC

Hi Sybil, 
Query:  I check one of the two then hit save and they both get checked 
We are able to reproduce the reported issue at our end while adding a record with empty dataSource. By default, the column type is defined based on the first record since initial grid is empty so, the type is not defined by default. Due to this, both the checkbox get checked while saving the data.  
In order to avoid the reported issue, we suggest you to set the type as “boolean” in the column definition. Refer the below code example, 
<ej:Grid ID="grdData" runat="server"  ………………> 
       ………………….. 
        <Columns> 
            <ej:Column Field="CLIENTID" HeaderText="Id" IsPrimaryKey="true" Width="20" TextAlign="Left" HeaderTextAlign="center" AllowEditing="false"  /> 
            <ej:Column Field="CLIENTKEY" HeaderText="Key" IsPrimaryKey="true" Width="70" Visible="false" HeaderTextAlign="center" TextAlign="Left"/>             
            <ej:Column Field="INTEGRATIONKEY" HeaderText="IntKey" IsPrimaryKey="true" EditType="DropdownEdit" Width="70"  HeaderTextAlign="center" TextAlign="Left"/> 
            <ej:Column Field="INTEGRATIONNAME" HeaderText="Name" Width="125" IsPrimaryKey="true"  EditType="DropdownEdit" HeaderTextAlign="center" TextAlign="Left" /> 
            <ej:Column Field="EXTRACT" HeaderText="IsExtract" Width="70" EditType="BooleanEdit" Type="boolean" HeaderTextAlign="center" TextAlign="Left"/> 
            <ej:Column Field="UI" HeaderText="Avail on UI" Width="60" EditType="BooleanEdit" Type="boolean" HeaderTextAlign="center" TextAlign="center" /> 
             
             </Columns> 
………………. 
     </ej:Grid> 
 
Refer our API documentation for your reference 
 
 
Note: From your code example, we could see that you have defined the clientside event two times. In this case only last defined event will trigger. So, we suggest you to define the clientside events only one time. Refer the below code, 
<ej:Grid ID="grdData" runat="server"  ……………..> 
       <ClientSideEvents Databound="dataBound"  ActionComplete="oncomplete"/> 
…………………. 
         <Columns> 
………………………………. 
             </Columns> 
        <TextWrapSettings WrapMode="Header" /> 
     </ej:Grid> 
 
Please get back to us if you have further queries. 
Regards, 
Vignesh Natarajan. 
 


Loader.
Live Chat Icon For mobile
Up arrow icon