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

Update source trigger in columns

3 Answers 164 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Avi Avni
Top achievements
Rank 1
Avi Avni asked on 26 Apr 2011, 07:27 AM

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

3 Answers, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 26 Apr 2011, 07:44 AM

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
0
Scott
Top achievements
Rank 1
answered on 02 May 2014, 12:51 AM
[quote]Keep in mind that this will bypass our built-in editing logic. 
[/quote]

What editing logic do I lose?  How can I get it back, but still update PropertyChanged?
0
Dimitrina
Telerik team
answered on 02 May 2014, 09:58 AM
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.
 
Tags
GridView
Asked by
Avi Avni
Top achievements
Rank 1
Answers by
Milan
Telerik team
Scott
Top achievements
Rank 1
Dimitrina
Telerik team
Share this question
or