Update source trigger in columns

4 posts, 0 answers
  1. Avi Avni
    Avi Avni avatar
    98 posts
    Member since:
    Feb 2010

    Posted 26 Apr 2011 Link to this post

    Hello

    We need to update the source when property changed,

    The source object update only when the cell edit ended.

    Is there way to do this?

    Best regards

    Ehud

  2. Milan
    Admin
    Milan avatar
    1989 posts

    Posted 26 Apr 2011 Link to this post

    Hi Ehud Pinchas,

    The default,  the gird does not allow you to do that but you can force it to use such kind of binding by providing a custom edit template. For example:

    <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}">
        <telerik:GridViewDataColumn.CellEditTemplate>
            <DataTemplate>
                <TextBox Text="{Binding Name, UpdateSourceTrigger=PropertyChanged}"/>
            </DataTemplate>
        </telerik:GridViewDataColumn.CellEditTemplate>
    </telerik:GridViewDataColumn>

    Keep in mind that this will bypass our built-in editing logic. 



    Kind regards,
    Milan
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Scott
    Scott avatar
    3 posts
    Member since:
    Sep 2012

    Posted 01 May 2014 in reply to Milan Link to this post

    Keep in mind that this will bypass our built-in editing logic. 


    What editing logic do I lose?  How can I get it back, but still update PropertyChanged?
  4. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 02 May 2014 Link to this post

    Hi,

    The editing should work fine with a predefined edit template. The case is that by default the editing and validation mechanism of RadGridView explicitly updates and validates values when the edit is over. In your case as you have set UpdateSourceTrigger=PropertyChanged, validation and updating the value would happen on every key stroke. This is the main difference.

    You can also check the source code of the GridViewDataColumn and GridViewBoundColumnBase to know everything we do to configure the default editor (i.e. TextBox for string values).

    Regards,
    Didie
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
Back to Top