I have a performance problem with RadExpder. Accordion menu works faster (or it may be same because I still have not tested how I want)
I have an ObservableCollection list as my source and want to create AccordionItem for each collection item. But somehow I cannot bind what I want. I am adding my code for radaccordion and radexpander. It works with radaccordion but radaccordion seems does not have ItemSource property.
<
telerikPrimitives:RadAccordion
x:Name
=
"accordion"
BindingContext
=
"{Binding Source}"
Grid.Row
=
"1"
VerticalOptions
=
"FillAndExpand"
HorizontalOptions
=
"FillAndExpand"
>
<
telerikPrimitives:AccordionItem
HeaderText
=
"{Binding GroupName}"
IsExpanded
=
"False"
>
<
telerikPrimitives:AccordionItem.Content
>
<
ScrollView
>
<
customCellItem:CustomParamMeterListItem
ItemsSource
=
"{Binding MeterValues2}"
/>
</
ScrollView
>
</
telerikPrimitives:AccordionItem.Content
>
</
telerikPrimitives:AccordionItem
>
</
telerikPrimitives:RadAccordion
>
So First of all HeaderText="{Binding GroupName}" this part gave null exception... If I delete it and write something it works but I cannot see content..
Here is the radexpander
<
datacontrols:RadListView
x:Name
=
"listView"
Grid.Row
=
"1"
ItemsSource
=
"{Binding Source}"
SelectionMode
=
"None"
VerticalOptions
=
"FillAndExpand"
HorizontalOptions
=
"FillAndExpand"
>
<
datacontrols:RadListView.ItemTemplate
>
<
DataTemplate
>
<
telerikListView:ListViewTemplateCell
>
<
telerikListView:ListViewTemplateCell.View
>
<
ScrollView
VerticalOptions
=
"FillAndExpand"
Margin
=
"0,20,0,0"
>
<
telerikPrimitives:RadExpander
x:Name
=
"expander"
Style
=
"{StaticResource ExpanderStyle}"
>
<
telerikPrimitives:RadExpander.Header
>
<
telerikPrimitives:ExpanderHeader
>
<
Label
Text
=
"{Binding GroupName}"
Style
=
"{StaticResource GrouppingTitle}"
/>
</
telerikPrimitives:ExpanderHeader
>
</
telerikPrimitives:RadExpander.Header
>
<
telerikPrimitives:RadExpander.Content
>
<
ScrollView
Style
=
"{StaticResource ExpanderContent}"
>
<
customCellItem:CustomParamMeterListItem
ItemsSource
=
"{Binding MeterValues2}"
/>
</
ScrollView
>
</
telerikPrimitives:RadExpander.Content
>
</
telerikPrimitives:RadExpander
>
</
ScrollView
>
</
telerikListView:ListViewTemplateCell.View
>
</
telerikListView:ListViewTemplateCell
>
</
DataTemplate
>
</
datacontrols:RadListView.ItemTemplate
>
</
datacontrols:RadListView
>
So the radexpander is independ on the other radexpander so I created a radlistview and with binding, many expander. I did the same thing with radaccordion but the radaccordion's items always expand, it does not behave same as radexpander. Thats why I need to create one radaccordion and many items depend on my source.
I cheched your sample source but not saw any thing what I want. Is there a way to do that?
If not:then how I can collapse the radaccordion ITEM in radaccordion when there is only one AccordionItem. The code below works but I just want I can collapse the AccordionItem. (because radaccordion does not allow to collapse the item when there is only one in the radaccordion)
<
datacontrols:RadListView
x:Name
=
"listView"
Grid.Row
=
"1"
ItemsSource
=
"{Binding Source}"
SelectionMode
=
"None"
VerticalOptions
=
"FillAndExpand"
HorizontalOptions
=
"FillAndExpand"
>
<
datacontrols:RadListView.ItemTemplate
>
<
DataTemplate
>
<
telerikListView:ListViewTemplateCell
>
<
telerikListView:ListViewTemplateCell.View
>
<
ScrollView
VerticalOptions
=
"FillAndExpand"
Margin
=
"0,20,0,0"
>
<
telerikPrimitives:RadAccordion
x:Name
=
"accordion"
>
<
telerikPrimitives:AccordionItem
HeaderText
=
"Hebele"
IsExpanded
=
"False"
>
<
telerikPrimitives:AccordionItem.Content
>
<
ScrollView
>
<
customCellItem:CustomParamMeterListItem
ItemsSource
=
"{Binding MeterValues2}"
/>
</
ScrollView
>
</
telerikPrimitives:AccordionItem.Content
>
</
telerikPrimitives:AccordionItem
>
</
telerikPrimitives:RadAccordion
>
</
ScrollView
>
</
telerikListView:ListViewTemplateCell.View
>
</
telerikListView:ListViewTemplateCell
>
</
DataTemplate
>
</
datacontrols:RadListView.ItemTemplate
>
</
datacontrols:RadListView
>
By the way, I still cannot bind HeaderText like HeaderText="{Binding GroupName}" Thats why in the code, I gave a hard-coded name.
If you can help me, it would be really great. I tried to create a custom expander but the performance was same as the radexpander. Thats why I want to use radaccordion and bind my source.
Thank you