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

Three state GridViewCheckBoxColumn GUI behaviour question.

2 Answers 364 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Andrea
Top achievements
Rank 1
Andrea asked on 11 Apr 2011, 10:49 AM
Hello, I have a problem to understand how the GridViewCheckBoxColumn three state works on a end-user perspective.

What happens: I have a grid having a checkbox column with IsThreeState = true, I launche the form: if i click the checkbox the first time it shows me an horizontal line (undetermined state??), if i click it again it shows no check sign (unchecked state), if I click it again it shows a check sign (checked state). The next click set the check box state to unchecked, the following click to checked state .. and so on, no way to set undetermined state again.

What I need: I need to know how the user can set the state to undetermined state again.

Sample code attached (just in case I'm missing something)

note: The data source is a CollectionListView whose source is a EntityFramework Table bound to an sql 2008 table that have a nullable bit column, mapped to a Nullable<bool> CLR property.

<Window.Resources>
        <CollectionViewSource x:Key="tQTZ_NoliVociViewSource" d:DesignSource="{d:DesignInstance my:TQTZ_NoliVoci, CreateList=True}" />
    </Window.Resources>
    <Grid DataContext="{StaticResource tQTZ_NoliVociViewSource}">
        <telerik:RadGridView  Name="tQTZ_NoliVociRadGridView" ItemsSource="{Binding}" AutoGenerateColumns="False">
            <telerik:RadGridView.Columns>
 <!-- other columns -->
                <telerik:GridViewCheckBoxColumn IsTreeState="True"
                    DataMemberBinding="{Binding colonnaLordo}" UniqueName="colonnaLordo" Name="colonnaLordo" Header="Lordo" Width="70">                   
                </telerik:GridViewCheckBoxColumn>

            </telerik:RadGridView.Columns>
        </telerik:RadGridView>       
    </Grid>

2 Answers, 1 is accepted

Sort by
0
Ivan Ivanov
Telerik team
answered on 11 Apr 2011, 12:02 PM
Hello Andrea,

If you are not satisfied with the default approach, you may customize your own column that meets your requirements. For example you may try using a GridViewDataColumn with predefined CellEditTemplate, utilizing the state CheckBox:
<telerik:GridViewDataColumn DataMemberBinding="{Binding Prop1}">
                    <telerik:GridViewDataColumn.CellEditTemplate>
                        <DataTemplate>
                            <CheckBox IsThreeState="True" IsChecked="{Binding Prop1, Mode=TwoWay}" Margin="5"/>
                        </DataTemplate>
                    </telerik:GridViewDataColumn.CellEditTemplate>
                </telerik:GridViewDataColumn>


Best wishes,
Ivan Ivanov
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
Andrea
Top achievements
Rank 1
answered on 11 Apr 2011, 01:16 PM
That works.

Thanks a lot.

Bye.
Tags
GridView
Asked by
Andrea
Top achievements
Rank 1
Answers by
Ivan Ivanov
Telerik team
Andrea
Top achievements
Rank 1
Share this question
or