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

How to let customize GridViewDataColumn do the same action as default GridViewDataColumn

2 Answers 47 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Nagisa
Top achievements
Rank 1
Nagisa asked on 16 Mar 2012, 07:29 AM
Hi,

I have a problem that the action is different between customize GridViewDataColumn and default GridViewDataColumn when I press Esc at editing cell.

for example:
If there are two columns like following source:
<telerik:GridViewDataColumn UniqueName="A" DataMemberBinding="{Binding A,Mode=OneWay}"  />
 
<telerik:GridViewDataColumn UniqueName="B" DataMemberBinding="{Binding B}" >
    <telerik:GridViewDataColumn.CellEditTemplate>
<DataTemplate>
         <AutoCompleteBox x:Name="BAutoCompleteBox" MinimumPrefixLength="1" FilterMode="Contains" ValueMemberPath="B" Text="{Binding Path=B, Mode=TwoWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}" ItemsSource="..." />
              </DataTemplate> 
</telerik:GridViewDataColumn.CellEditTemplate>
</telerik:GridViewDataColumn>

A and B both are string.
While I am editing A, I press Esc button once to rollback value of text to OldData.
But while I am editing B, I should press Esc button twice to rollback value of text to OldData.
I think the difference is that I set CellEditTemplate into Column B.

Is there any way to let control do the same action when I press Esc.


Best Regards,
Niwa


2 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 19 Mar 2012, 12:53 PM
Hi,

 You should specify the UpdateSourceTrigger property of the Binding to be "Explicit". For example, your changed code would look like so:

<DataTemplate>
          <AutoCompleteBox x:Name="BAutoCompleteBox" Text="{Binding Path=Name, Mode=TwoWay, ValidatesOnExceptions=true, NotifyOnValidationError=true, UpdateSourceTrigger=Explicit}" />
</DataTemplate>

Does this solve your problem?

Greetings,
Didie
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Nagisa
Top achievements
Rank 1
answered on 20 Mar 2012, 02:58 AM
Hi Didie,

Thank you very much for your reply.
I've used RadComboBox instead of AutoCompleteBox.
But the answer would be useful for another control.
I'll be try it when I have time later.

Best regards.
Niwa 

Tags
GridView
Asked by
Nagisa
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Nagisa
Top achievements
Rank 1
Share this question
or