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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

CheckBox in sfdatagrid

Thread ID:

Created:

Updated:

Platform:

Replies:

150639 Jan 14,2020 11:30 AM UTC Jan 24,2020 05:56 AM UTC WPF 7
loading
Tags: SfDataGrid
Aboubaker
Asked On January 14, 2020 11:30 AM UTC

I was set selection in sfdatagrid for whole row, and wanted to style the checked boxes in column by they still grayed out, i tried style triggers with property "isEnable" but the application was broken, how can i style CheckBox is this situation?

Vijayarasan Sivanandham [Syncfusion]
Replied On January 15, 2020 10:10 AM UTC

Hi Aboubaker,  
Thank you for contacting Syncfusion support.  
Based on the provided information, your requirement of styling checkbox can be achieved using the CellStyle property. Please refer the following code example for the same, 
Code snippet:   
<syncfusion:GridCheckBoxColumn AllowEditing="True" HeaderText="Closed" MappingName="IsClosed" > 
   <syncfusion:GridCheckBoxColumn.CellStyle> 
      <Style TargetType="syncfusion:GridCell" > 
         <Style.Resources> 
            <Style TargetType="CheckBox"> 
               <Style.Triggers> 
                 <DataTrigger Binding="{Binding IsClosed}" Value="True"> 
                      <Setter Property="BorderBrush" Value="Red"/> 
                 </DataTrigger> 
               </Style.Triggers> 
            </Style> 
         </Style.Resources> 
      </Style> 
  </syncfusion:GridCheckBoxColumn.CellStyle> 
</syncfusion:GridCheckBoxColumn>
  
We have prepared sample based on your requirement, please find the sample by the following link. 
We hope this helps. Please let us know, if need any further assistance. 
Regards, 
Vijayarasan 


Aboubaker
Replied On January 15, 2020 02:19 PM UTC

Hi Vijayarasan , in your example you gave me an editable dataGrid so the checkBox already enabled by default,

in my project I set AllowEditing="False" so the user cannot edit in DataGrid directly, but in a new child window.

In this case the checkbox is always disabled even if it's selected or not, so how can I design the checkbox in this situation?

and thank you so much by the way for your immediate helping.

Farjana Parveen Ayubb [Syncfusion]
Replied On January 17, 2020 12:34 PM UTC

Hi Aboubaker, 
 
Thank you for your update. 
 
We have analyzed your query, and we can able to reproduce your reported scenario on our end. But that is the default behavior for CheckBox, we can’t able to apply the style for CheckBox in Disabled state. We have used the Framework CheckBox in GridCheckBoxColumn of SfDataGrid.  
 
Regards, 
Farjana Parveen A 


Aboubaker
Replied On January 17, 2020 04:23 PM UTC

Ok Farjana, thank you so much for your support

Farjana Parveen Ayubb [Syncfusion]
Replied On January 20, 2020 05:41 AM UTC

Hi Aboubaker, 
 
Thanks for the update. 
 
We are glad to know that the reported problem has been resolved at your end. Please let us know if you have any further queries on this. We are happy to help you. 
 
Regards, 
Farjana Parveen A 


Aboubaker
Replied On January 23, 2020 09:42 AM UTC

Hi Farjana  actually I didn't resolve it, but it's not a big problem.

Farjana Parveen Ayubb [Syncfusion]
Replied On January 24, 2020 05:56 AM UTC

Hi Aboubaker, 
 
Thank you for your update. Please let us know whether you require further other assistance from us. 
Regards, 
Farjana Parveen A 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon