Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
445
XamWebGrid TemplateColumn control at runtime
posted

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...

Parents
No Data
Reply
  • 40030
    Offline posted

    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

Children