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

RadGridView and checkbox IsSelect properties binding in xaml

5 Answers 233 Views
GridView
This is a migrated thread and some comments may be shown as answers.
devendra kumar
Top achievements
Rank 1
devendra kumar asked on 16 Feb 2010, 07:00 AM

Hi,
I am very biginer in Telerik controls. I am facing a problem related to properties binding ( automatic ) . i have a Gridview and inside grid view i have a checkbox , i need to implement functionality where i have to select checkbox on rowselection in xaml.

my code is following ...

 

<

ex:ExGridView Name="gvItemList" MultipleSelect="True" EnableColumnVirtualization="False" Grid.Column="0" Grid.ColumnSpan="5" Grid.Row="15"

 

 

AutoGenerateColumns="False" MaxHeight="200" IsReadOnly="True" RowLoaded="gvItemList_RowLoaded" >

 

 

<tcp:RadGridView.Columns>

 

 

 

 

 

<ex:ExGridViewDataColumn Width="20" IsResizable="False">

 

 

 

 

 

<tcp:GridViewDataColumn.CellStyle x:Uid="chkSelect">

 

 

 

 

 

<Style TargetType="tcp:GridViewCell">

 

 

 

 

 

<Setter Property="tcp:GridViewCell.Template">

 

 

 

 

 

<Setter.Value>

 

 

 

 

 

<ControlTemplate TargetType="tcp:GridViewCell">

 

 

 

 

 

<CheckBox CommandParameter="{Binding}"

 

 

HorizontalAlignment="Center" VerticalAlignment="Center"

 

 

IsChecked="{Binding Path=IsSelected, Mode=TwoWay,RelativeSource={RelativeSource FindAncestor,
AncestorType={x:Type tcp:GridViewDataColumn}}}" Checked="CheckBox_Checked" Unchecked="CheckBox_Checked"/>

 

 

 

 

 

</ControlTemplate>

 

 

 

 

 

</Setter.Value>

 

 

 

 

 

</Setter>

 

 

 

 

 

</Style>

 

 

 

 

 

</tcp:GridViewDataColumn.CellStyle>

 

 

 

 

 

</ex:ExGridViewDataColumn>

 

 

 

 

 

<ex:ExGridViewDataColumn PhraseID="2464" UniqueName="ItemCode" DataMemberBinding="{Binding Path=ItemCode, Converter={StaticResource stringToDisplayStringConverter}}" ></ex:ExGridViewDataColumn>

 

 

 

 

 

<ex:ExGridViewDataColumn PhraseID="1218" UniqueName="ItemName" DataMemberBinding="{Binding Path=ItemName, Converter={StaticResource stringToDisplayStringConverter}}" Width="130"></ex:ExGridViewDataColumn>

 

 

 

 

 

<ex:ExGridViewDataColumn PhraseID="1607" UniqueName="DepartmentName" DataMemberBinding="{Binding Path=DepartmentName, Converter={StaticResource stringToDisplayStringConverter}}" ></ex:ExGridViewDataColumn>

 

 

 

 

 

<ex:ExGridViewDataColumn PhraseID="1002" UniqueName="CategoryName" DataMemberBinding="{Binding Path=CategoryName, Converter={StaticResource stringToDisplayStringConverter}}" ></ex:ExGridViewDataColumn>

 

 

 

 

 

 

 

 

</tcp:RadGridView.Columns>

 

 

 

 

 

</ex:ExGridView>

we have extendened radgrid in customizable form. still i don't have idea to bind checkbox's checked property to gridview's IsSelect property , i don't want to link object properties , but i need to bind both controls(checkbox and gridrow ) properties . Please have a look and give me some assistance .

Thanks In advance
Regards

Devendra Kumar

 

5 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 16 Feb 2010, 07:12 AM
Hello,

You can use GridViewSelectColumn directly similar to this demo:
http://demos.telerik.com/wpf/?GridView/ColumnTypes

Kind regards,
Vlad
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
Usame Esendir
Top achievements
Rank 1
answered on 13 Apr 2010, 02:29 PM
Does it means we cannot bind boolean values to GridViewSelectColumn?
Or is there any way around?
0
Vlad
Telerik team
answered on 13 Apr 2010, 02:35 PM
Hello,

If you change the binding of GridViewSelectColumn than this will not be a column for selection of grid items. You can use regular GridViewColumn or GridViewDataColumn.

Regards,
Vlad
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
John Giblin
Top achievements
Rank 1
answered on 03 Feb 2011, 04:53 AM
I guess that is a no.  What I wanted to do is have the check box selected if some of the records were previously selected from another session.  any suggestions
0
Vlad
Telerik team
answered on 03 Feb 2011, 08:45 AM
Hello,

 You can add previously selected items in SelectedItems collection - the checkboxes will reflect this immediately. 

Best wishes,
Vlad
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
GridView
Asked by
devendra kumar
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Usame Esendir
Top achievements
Rank 1
John Giblin
Top achievements
Rank 1
Share this question
or