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

GridViewCheckBoxColumn IValueConverter support seems flawed

6 Answers 189 Views
GridView
This is a migrated thread and some comments may be shown as answers.
M
Top achievements
Rank 1
M asked on 23 Jun 2010, 04:09 PM
Hello,

We are binding a RadGridView to a property (Observable Collection of Entities) in an MVVM scenario. Within this grid we have a GridViewCheckBoxColumn that has a DataMemberBinding to a string property within our entities. Since the string is always "0" or "1" we use a ValueConverter to convert to Boolean - True/False in order to tick the checkbox. We found that the converter always calls the "Convert" method instead of the "ConvertBack" upon setting the value....

For test purposes we were binding a standard GridViewDataColumn to the same converter to ensure it is working properly which it does....

Example:
    <Grid> 
        <Grid.RowDefinitions> 
            <RowDefinition Height="0.913*"/>  
        </Grid.RowDefinitions> 
        <Expander Grid.Row="1" 
            Header="Berthing Slots" 
            IsExpanded="True" 
            VerticalAlignment="Top" Margin="0,4.988,0,0">  
            <telerik:RadGridView x:Name="radBerthingSlots" 
                AutoGenerateColumns="False" 
                IsEnabled="True" 
                ItemsSource="{Binding BerthingSlots}" 
                SelectedItem="{Binding SelectedBerthingSlot, Mode=TwoWay}"   
                AddingNewDataItem="radBerthingSlots_AddingNewDataItem"   
                RowEditEnded="radBerthingSlots_RowEditEnded" Deleting="radBerthingSlots_Deleting">  
                  
                <telerik:RadGridView.Columns> 
                    <telerik:GridViewCheckBoxColumn Header="Available" DataMemberBinding="{Binding Path=HtDiff, Converter={StaticResource HtDiffNumberConverter}, Mode=TwoWay}" /> 
                    <telerik:GridViewDataColumn Header="HT Diff" DataMemberBinding="{Binding Path=HtDiff, Converter={StaticResource HtDiffNumberConverter}, Mode=TwoWay}" /> 
                </telerik:RadGridView.Columns> 
            </telerik:RadGridView> 
    </Grid> 
 

Now, when we change the value in the GridViewDataColumn the "ConvertBack" method is correctly (as expected) invoked....

When we do the same (ticking / unticking the checkbox on the GridViewCheckBoxColumn) it always calls the "Convert" method.....

Clearly that can't be right.... can you guys please help!

Many Thanks in advance.....

Regards

M.

6 Answers, 1 is accepted

Sort by
0
Tsvyatko
Telerik team
answered on 24 Jun 2010, 02:33 PM
Hello M,

 We have investigated this problem and it seems that this is issue of the Checkbox Column. We have fixed it and the fix will be available with the next internal build this Friday. Please excuse us for any inconvenience caused.

Thank you for reporting this issue. I have updated your telerik points accordingly.

Kind regards,
Tsvyatko
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
M
Top achievements
Rank 1
answered on 28 Jun 2010, 03:35 PM
Tsvyatko,

many thanks for that quick solution... we downloaded the internal build and it is working fine now....

Can you give me an update about when we will see it in an official release?!


Many Thanks again

Regards

M.
0
Accepted
Milan
Telerik team
answered on 28 Jun 2010, 05:18 PM
Hi M,

Our next official release is scheduled for early July which is just a couple of weeks away. 


Greetings,
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
Marco Barzaghi
Top achievements
Rank 1
answered on 04 Nov 2010, 01:07 PM
We have downloaded "RadControls_for_Silverlight_3_2010_2_0924_DEV_hotfix". It seems the problem has not be solved. May you help me?

TY in advance,
M.
0
Tsvyatko
Telerik team
answered on 05 Nov 2010, 10:11 AM
Hi Marco Barzaghi,

I have checked this and found that the problem has been resolved in version RadControls_for_Silverlight_4_2010_2_0924_DEV_hotfix but still exists RadControls_for_Silverlight_3_2010_2_0924_DEV_hotfix. If you are unable to use the fixed version I have prepared sample project demonstrating how to workaround this issue using custom column.

Let me know if this works for you.

All the best,
Tsvyatko
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
Marco Barzaghi
Top achievements
Rank 1
answered on 05 Nov 2010, 02:28 PM
at the moment I've solved using this code

                                <TelGrid:GridViewColumn IsReadOnly="False" Header="My header">
                                    <TelGrid:GridViewColumn.CellTemplate>
                                        <DataTemplate>
                                            <CheckBox IsChecked="{Binding MyYesNoProperty, Mode=TwoWay, Converter={StaticResource YesNoToBool}}"/>
                                        </DataTemplate>
                                    </TelGrid:GridViewColumn.CellTemplate>
                                </TelGrid:GridViewColumn>

I will take a peek to your solution,
TY
Tags
GridView
Asked by
M
Top achievements
Rank 1
Answers by
Tsvyatko
Telerik team
M
Top achievements
Rank 1
Milan
Telerik team
Marco Barzaghi
Top achievements
Rank 1
Share this question
or