My Grid Code is like below...
<igGrid:XamWebGrid InitializeRow="XamWebGrid_InitializeRow" CellEnteredEditMode="XamWebGrid_CellEnteredEditMode" ScrollViewer.VerticalScrollBarVisibility="Visible" MaxDepth="1" RowAdded="XamWebGrid_RowAdded" Height="400" Grid.Row="0" HorizontalAlignment="Left" Margin="5,5,5,5" Name="gridTransaction" VerticalAlignment="Top" AutoGenerateColumns="False"> <igGrid:XamWebGrid.Columns> <igGrid:TemplateColumn Key="StepObjectAction" HeaderText="HeaderCheckBox" HorizontalContentAlignment="Center"> <igGrid:TemplateColumn.HeaderTemplate> <DataTemplate> <CheckBox x:Name="chkAll" Checked="chkAll_Checked" Grid.Column="0" Margin="10,2,2,2" /> </DataTemplate> </igGrid:TemplateColumn.HeaderTemplate> <igGrid:TemplateColumn.ItemTemplate> <DataTemplate> <CheckBox x:Name="chkBoxID" IsChecked="False" IsEnabled="True" /> </DataTemplate> </igGrid:TemplateColumn.ItemTemplate>
</igGrid:TemplateColumn>
</igGrid:XamWebGrid.Columns>
I need to do the functionality of Select and Unselect all functionality for that
1) How to find the Datatemplate control "chkBoxID" in the code behind at runtime and on which event?
Please Suggest...
Thanks In Advance...
I am trying to check and uncheck all the checkbox in xamgrid on header checkbox check uncheck.So what I was planning that on rowinitialize event or any other I capture all the checkbox in one list and on Header checkbox checked event I make them check or uncheck.
So as you say 2 way binding would do the trick.So can you provide me the code how to do that?,beacause I have never used that and I am new to silverlight.
-Pankaj
Hi,
It isn't recommended that you actually interact with the controls in your DataTemplate directly. Silverlight was designed in such a way, that you can actually do most interactions without knowing anything about the controls in your View.
So what exactly are you trying to do?
Are you storing whether something is Selected/ Unselected in your own data model? If so, then a direct 2 way minding would do the trick. If its actually based off of another property in your data model, or a calculation, you can use a valueConverter.
If you can provide more information, i'm sure we can help you figure out the best approach.
-SteveZ