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

How to bind item in RowDetailsTemplate?

1 Answer 104 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Doctor
Top achievements
Rank 1
Doctor asked on 03 Apr 2014, 11:27 AM
Hi,

I have this xaml code:

<telerik:RadGridView x:Name="DynTableGridView"
                   ItemsSource="{Binding DataTables">
  <telerik:RadGridView.RowDetailsTemplate>
    <DataTemplate>
       <telerik:RadBusyIndicator  IsBusy="{Binding ????? DoInput}">
              <Grid>
                ....................
                some code
                ....................
              </Grid>
           </telerik:RadBusyIndicator>
    </DataTemplate>
  </telerik:RadGridView.RowDetailsTemplate>
</telerik:RadGridView>
and  DynTablesViewModel class
     public class DynTablesViewModel:ViewModelBase
    {
        private ICollectionView _dataTables;
        private bool _doInput = true;
 
        public void InitData()
        {
             DataTables = new QueryableCollectionView(.........);
        }
        #region Property
 
        public bool DoInput
        {
            get { return _doInput; }
            set { _doInput = value; OnPropertyChanged("DoInput"); }
        }
        
        public ICollectionView DataTables
        {
            get { return _dataTables; }
            set { _dataTables = value; OnPropertyChanged("DataTables"); }
        }
         #endregion
    }
How to bind RadBusyIndicator in RowDetailsTemplate?  RadBusyIndicator  IsBusy="{Binding ????? DoInput}"

1 Answer, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 07 Apr 2014, 11:12 AM
Hello,


The DataContext of row details is their parent data item. You should bind IsBusy property of RadBusyIndicator to Boolean property value, as part of the parent item and this Binding will be evaluated correctly, as proposed below:

 
  <telerik:RadGridView RowDetailsVisibilityMode="VisibleWhenSelected" ItemsSource="{Binding Collection}">
          <telerik:RadGridView.RowDetailsTemplate>
  <DataTemplate>
     <telerik:RadBusyIndicator  IsBusy="{Binding DoInput}">
            <Grid Height="100">
             <Button Content="Helloo"/>
            </Grid>
         </telerik:RadBusyIndicator>
  </DataTemplate>
</telerik:RadGridView.RowDetailsTemplate>
          </telerik:RadGridView>


I'm also attaching you small sample demo, which illustrates this approach. 

Regards,
Vanya Pavlova
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
GridView
Asked by
Doctor
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Share this question
or