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

GridViewCheckBoxColumn always initially unchecked - what am I doing wrong?

3 Answers 29 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Anders
Top achievements
Rank 1
Anders asked on 27 Mar 2012, 08:56 AM
Hi telerik,

I have the following rather simple use of the GridViewCheckBoxColumn -- and the grid shows up with no checkmarks what-so-ever.

Can you see what I'm doing wrong?

I can see (by breakpoint) that the row data model is queried for relevant value (so binding should be correct) and that the value in all cases is True (so the underlying value is as I expect).

Any clues?

Thanks,

Anders, Denmark

Grid

        <Controls:RadGridView x:Name="grid"
                              AutoGenerateColumns="False"
                              ItemsSource="{Binding Items}"
                              Height="329"
                              ScrollViewer.HorizontalScrollBarVisibility="Auto"
                              ScrollViewer.VerticalScrollBarVisibility="Auto"
                              ShowGroupPanel="False"
                              VerticalAlignment="Top"
                              IsFilteringAllowed="False"
                              >
            <Controls:RadGridView.Columns>
                <Controls:GridViewCheckBoxColumn DataMemberBinding="{Binding IsChecked}" IsThreeState="False" Initialized="GridViewCheckBoxColumn_Initialized" />
            </Controls:RadGridView.Columns>
        </Controls:RadGridView>


"Items"

ObservableCollection<ICheckableViewModel> Items { get; set; }

Row data item


    public class CheckableStringViewModel : ICheckableViewModel
    {
        public CheckableStringViewModel(bool isChecked, string displayName, string identity, bool isReadOnly)
        {
            IsChecked = isChecked;
            DisplayName = displayName;
            Identity = identity;
            IsReadOnly = isReadOnly;
        }

        public bool IsReadOnly { get; private set; }
        public string DisplayName { get; private set; }
        public string Identity { get; private set; }
        private bool _isChecked;
        public bool IsChecked
        {
            get { return _isChecked; }
            set { _isChecked = value; }
        }
    }

3 Answers, 1 is accepted

Sort by
0
Accepted
Maya
Telerik team
answered on 27 Mar 2012, 09:03 AM
Hi Anders,

We had such an issue with our previous official release Q1 2012. Could you try our latest internal build or Q1 2012 SP1 release to check whether you get the same behavior ?  

Regards,
Maya
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Anders
Top achievements
Rank 1
answered on 27 Mar 2012, 09:18 AM
Excellent!

I AM currently on Q1 2012 -- will try out the SP and either repeat my problem or mark your reply as The Answer.

So far - thanks!
0
Anders
Top achievements
Rank 1
answered on 27 Mar 2012, 10:16 AM
Yes!

Upgrading to RadControls_for_WPF_2012_1_0326_Dev solved my issue!

Thanks for speedy help! I'm back on track :D
Tags
GridView
Asked by
Anders
Top achievements
Rank 1
Answers by
Maya
Telerik team
Anders
Top achievements
Rank 1
Share this question
or