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

3 posts, 0 answers
  1. Nagisa
    Nagisa avatar
    14 posts
    Member since:
    Nov 2011

    Posted 16 Mar 2012 Link to this post

    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. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 19 Mar 2012 Link to this post

    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 >>
  3. Nagisa
    Nagisa avatar
    14 posts
    Member since:
    Nov 2011

    Posted 19 Mar 2012 Link to this post

    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 

Back to Top