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

GridViewComboBoxColumn Update on Change

14 Answers 499 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 17 May 2010, 02:47 PM
Is there a way to make the GridViewComboBox column update its backing property on change instead of on lost focus?  This is the default property for the combo box but does not appear to be the default in the grid view and setting the UpdateSourceTrigger in the DataMemberBInding to PropertyChanged does not appear to work.

14 Answers, 1 is accepted

Sort by
0
Yavor Georgiev
Telerik team
answered on 17 May 2010, 04:33 PM
Hello Andrew,

 You can use a GridViewColumn with a RadComboBox in its CellTemplate to achieve the desired effect.

An example:

<telerik:GridViewColumn Header="Some Dropdown">
                    <telerik:GridViewColumn.CellTemplate>
                        <DataTemplate>
                            <telerik:RadComboBox ItemsSource="{Binding Items, Source={StaticResource DropdownValues}}" SelectedItem="{Binding SomeDropdownValue, Mode=TwoWay}" />
                        </DataTemplate>
                    </telerik:GridViewColumn.CellTemplate>
                </telerik:GridViewColumn>

Kind regards,
Yavor Georgiev
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
Robert
Top achievements
Rank 1
answered on 30 Mar 2011, 09:56 AM
Hello Yavor,
What about fixing bug in GridViewComboBox  when UpdateSourceTrigger =PropertyChanged ?
Best regards,
0
Yavor Georgiev
Telerik team
answered on 30 Mar 2011, 10:33 AM
Hello Robert,

 This is not a bug, but by design - RadGridView will update the bound property only when the edit operation for the specific cell is successfully completed, not when the editor element in the cell raises a DependencyPropertyChanged event notification.

Regards,
Yavor Georgiev
the Telerik team
0
Robert
Top achievements
Rank 1
answered on 30 Mar 2011, 03:48 PM
Hello Yavor ,
Ops, I didn't know that....  

Thanks for ultra fast replay.
Best regards
0
Robert
Top achievements
Rank 1
answered on 31 Mar 2011, 10:22 AM
Hello Yavor,
According to your example :
<telerik:GridViewColumn Header="Some Dropdown">
                    <telerik:GridViewColumn.CellTemplate>
                        <DataTemplate>
                            <telerik:RadComboBox ItemsSource="{Binding Items, Source={StaticResource DropdownValues}}" SelectedItem="{Binding SomeDropdownValue, Mode=TwoWay}" />
                        </DataTemplate>
                    </telerik:GridViewColumn.CellTemplate>
                </telerik:GridViewColumn>

I tried to using it but instead of CellTemplate  I need CellEditTemplate.
But this example is not working when I directly change it.
As CellTemplate I used TextBlock.
Any suggestions?
Best regards.
0
Yavor Georgiev
Telerik team
answered on 31 Mar 2011, 11:05 AM
Hi Andrew,

 Could you please elaborate a bit more on what's not working for you? Does the property not get updated again?

Best wishes,
Yavor Georgiev
the Telerik team
0
Robert
Top achievements
Rank 1
answered on 31 Mar 2011, 12:53 PM
Hi Yavor,
Thanks  for fast replay...
Did you asked Andrew  in your previous post?

So, this does not work ...

<telerik:GridViewColumn Header="Some Dropdown">
                    <telerik:GridViewColumn.CellEditTemplate>
                        <DataTemplate>
                            <telerik:RadComboBox ItemsSource="{Binding Items, Source={StaticResource DropdownValues}}" SelectedItem="{Binding SomeDropdownValue, Mode=TwoWay}" />
                        </DataTemplate>
                    </telerik:GridViewColumn.CellEditTemplate>
                </telerik:GridViewColumn>

but this works ... :)

<telerik:GridViewColumn Header="Some Dropdown" DataMemberBinding="{Binding}">
                    <telerik:GridViewDataColumn.CellEditTemplate>
                        <DataTemplate>
                            <telerik:RadComboBox ItemsSource="{Binding Items, Source={StaticResource DropdownValues}}" SelectedItem="{Binding SomeDropdownValue, Mode=TwoWay}" />
                        </DataTemplate>
    </telerik:GridViewDataColumn.CellEditTemplate>
                </telerik:GridViewColumn>


0
Yavor Georgiev
Telerik team
answered on 31 Mar 2011, 01:33 PM
Hello Andrew,

 GridViewColumn does not enter edit mode by default and that's why CellEditTemplate does not work for you. You need to use GridViewDataColumn instead.

Greetings,
Yavor Georgiev
the Telerik team
0
Robert
Top achievements
Rank 1
answered on 01 Apr 2011, 03:04 PM
Hello Yavor,
Ok.
So, I use GridViewDataColumn with CellEditTemplate and RadComboBox.
My RadGridView has also IsReadOnly = {Binding IsReadOnly}, and it works perfect on GridViewDataColumn.

A problem occurs when I use CellEditTemplate, than, column seems to ignore IsReadOnly = true.
Notice that IsReadOnlyBinding doesn't help.
Any suggestions?
Best regards.
0
Yavor Georgiev
Telerik team
answered on 02 Apr 2011, 01:36 AM
Hello Robert,

 I'm sorry, but I've been unable to replicate this behavior locally. Would it be possible for you to prepare a small sample application exhibiting this problem and attach it to a separate support ticket?

Kind regards,
Yavor Georgiev
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
Robert
Top achievements
Rank 1
answered on 02 Apr 2011, 09:38 AM
Hello Yavor,
So, I prepared sample application, both silverlight and wpf.

They are the same, but problem occours only in wpf ...

How to obtain support ticket with attachment?
Best regards
0
Yavor Georgiev
Telerik team
answered on 03 Apr 2011, 02:56 AM
Hello Robert,

 I apologize for misleading you - you will have to put your application on a service like SendSpace or Dropbox and post the link here.

Greetings,
Yavor Georgiev
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
Robert
Top achievements
Rank 1
answered on 04 Apr 2011, 11:35 AM
Hello Yavor,
I've uploaded the sample under http://www.sendspace.com/file/u86pgq
Best regards,
0
Yavor Georgiev
Telerik team
answered on 04 Apr 2011, 02:47 PM
Hello Robert,

 I managed to reproduce this error using our 2010 Q3 binaries. However, our 2011 Q1 release does not exhibit this problem. Could you please try using the newer assemblies?

Greetings,
Yavor Georgiev
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
Tags
GridView
Asked by
Andrew
Top achievements
Rank 1
Answers by
Yavor Georgiev
Telerik team
Robert
Top achievements
Rank 1
Share this question
or