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

Cancel PreparingCellForEdit

1 Answer 128 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Suna
Top achievements
Rank 1
Suna asked on 01 Sep 2016, 11:57 AM

Hi folks,

i tried to cancel the editation of a ComboBoxColumnCell. But when i set GridViewPreparingCellForEditEventArgs.Cancel to true, the cell gets in edit mode, too.

Is it a bug or do i have to set another property?

Thanks

 

David

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 05 Sep 2016, 12:20 PM
Hello David,

Depending on your exact requirement, you can choose one of the two following suggestions.

1. If you need the user to be able to view the items of GridViewComboBoxColumn, but to be unable to select them, you can benefit from the IsEnabled property of RadComboBoxItem. To achieve this, you can define a Style as follows.
<Style TargetType="telerik:RadComboBoxItem"
       x:Key="comboItemStyle">
    <Setter Property="IsEnabled"
            Value="{Binding IsEnabled}" />
</Style>

Then, you can apply this Style to a given column through its EditorStyle property.

2.   If your requirement is to disable editing of the whole column, you can set its IsReadOnly property to True.

I hope this helps.

All the best,
Stefan X1
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
GridView
Asked by
Suna
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or