This question is locked. New answers and comments are not allowed.
How do I access via code behind (VB) the controls in a RowDetails DataTemplate?
Example XAML:
In my code behind I have:
Code behind will not recognize the WaiveFeeButton as being directly accessible. How can I set the visibility of this button in code behind?
Rob
Example XAML:
<DataTemplate x:Key="TransactionDetailDataTemplate"> <Grid MinHeight="28" Style="{StaticResource RowDetailBackground}"> <Grid.ColumnDefinitions> <ColumnDefinition Width="680"/> <ColumnDefinition Width="100"/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="*"/> </Grid.RowDefinitions> <ListBox x:Name="TransactionDetailListBox" Margin="100,0,0,0" Background="{x:Null}" DataContext="{Binding Source={StaticResource TransactionDetailData}}" BorderBrush="{x:Null}" FontSize="10.667"> <ListBoxItem Content="{Binding Collection[0].Description1}" /> </ListBox> <Button x:Name="WaiveFeeButton" Content="Wavie Fee" Grid.Column="1" Style="{StaticResource AcceptButton}" Visibility="Collapsed" /> </Grid></DataTemplate>In my code behind I have:
Private Sub TransactionGridView_RowDetailsVisibilityChanged(sender As Object, e As Telerik.Windows.Controls.GridView.GridViewRowDetailsEventArgs) Handles TransactionGridView.RowDetailsVisibilityChanged ' DEMO - for demo only If Not TransactionGridView.CurrentItem Is Nothing Then Dim RowObject As Object = TransactionGridView.CurrentItem If RowObject.TxDescription = "Charge" Then ' Make the Waive Fee Button Visible End If End IfEnd SubCode behind will not recognize the WaiveFeeButton as being directly accessible. How can I set the visibility of this button in code behind?
Rob
