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

[Solved] Expanding and collapsing button for groups in RadGridView. in

0 Answers 107 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Kiti
Top achievements
Rank 1
Kiti asked on 28 Jul 2011, 01:48 PM
Hi,

I have to use a  +/- button for expanding and collapsing the rows instead of > under a particular group. But if there is no row or no data under that group, there should be no +/- button.

Below is my code snippet :

<telerik:RadGridView x:Name="dgSelectedStudent" Grid.Row="1" Margin="5,0,10,5" 
             ItemsSource="{Binding Path=CountryStudentList, Mode=TwoWay}" Height="220" Width="400"
            AutoGenerateColumns="False" IsReadOnly="True" AutoExpandGroups="True" 
    CanUserFreezeColumns="False" ShowGroupPanel="False" 
    CanUserResizeColumns="False">
                   <telerik:RadGridView.Columns>                
                          <telerik:GridViewDataColumn DataMemberBinding="{Binding StudentName}" x:Name="txtbStudent" />
                   </telerik:RadGridView.Columns>
        </telerik:RadGridView>

xaml.cs------
public IEnumerable CountryStudentList
        {
            get { return _countryStudentList; }
            set
            {
                PagedCollectionView pcv = new PagedCollectionView(value);
                pcv.GroupDescriptions.Add(new PropertyGroupDescription("CountryName"));
                _countryStudentList= pcv;                
            }
        }

It may be possible that for some countries, there will be no student.
Now if there is no student in that country, then there will be CountryName without any expand/collapse(+/-) button.

Need your help ASAP.
Tags
GridView
Asked by
Kiti
Top achievements
Rank 1
Share this question
or