BoldDeskWe are launching BoldDesk on Product Hunt soon. Learn more & follow us.
Hi Om,
Thank you for using Syncfusion products.
We have analyzed your query. In our Grid, we perform the Selection
operation through GridCell events. We are unable to get any events if IsEnabled
property is set to false, so the issue has occurred. Could you please let us
know the detailed requirement for in what purpose you would like to use this behavior?
This would be more helpful for us to
serve you.
Please let us know if you need further assistance.
Thank you,
Jai Ganesh S
Hi Om,
Thank you
for your update.
We have
analysed your query. We are unable to get any events in the case “IsEnabled” property is set to false. However you
can achieve your requirement by
using CurrentCellBeginEdit. This Event is fired when the current cell begins to
enter into Edit Mode. In that if set the cancel property as true, the event
will be cancelled and the current cell will not enter edit mode. We have
prepared the sample based on this and please find the sample under the
following location,
Sample: SfDataGridEditingSample.zip
Note: In
this sample we have disabled the editing for the EmployeeName Nancy.
Please let us know if you need
further assistance.
Thank you,
Jai Ganesh
S
Hi
Om,
We
apologize for the delay caused.
You
can disable the edit mode for checkbox also based on the value of textbox by
using GridTemplateColumn and IDataErrorInfo interface.
Find
the code snippet below,
Code Snippet:
public string Error { get { return ""; } } public string this[string columnName] { get { if (columnName == "EmployeeName") { if (this.EmployeeName == "Nancy") { this.IsEnabled = false; } } return ""; } }
Xaml Code:
<syncfusion:GridTemplateColumn MappingName="Check"> <syncfusion:GridTemplateColumn.CellTemplate> <DataTemplate> <CheckBox IsEnabled="{Binding Path=IsEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"IsThreeState="False" /> </DataTemplate> </syncfusion:GridTemplateColumn.CellTemplate> </syncfusion:GridTemplateColumn> |
Please
Refer the below attached sample.
Kindly
let us know if this solution helps you.
Regards,
Jayapradha
Hi
Om,
Alternative
way to achieve your desired requirement by using Converter without using an any
additional property. Find the code snippet below,
Code
Snippet:
<syncfusion:GridTemplateColumn.CellTemplate> <DataTemplate> <Grid HorizontalAlignment="Center" VerticalAlignment="Center"> <CheckBox IsChecked="{Binding Path=Check, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
IsEnabled="{Binding Path=EmployeeName,
Converter={StaticResource
checkBoxEditBehaviorConverter}}"
IsThreeState="False" /> </Grid> </DataTemplate> </syncfusion:GridTemplateColumn.CellTemplate> |
Please
Refer the below attached sample.
Regards,
Jayapradha
Hi
Om,
Thanks
for your update.
Find
the required attached sample.
Please
let us know if you have any queries.
Regards,
Jayapradha