Adding the different itemsource for the Content inSfAccordion
Thank you for contacting Syncfusion Support.
We could not find the reported attachment. Please share us the mentioned attachment to analyze and proceed further in this.
Regards,
Vijayalakshmi V.R.
Thanks for your reply vijayalakshmi RoopKumar,
It is my SfAccordion document, Please check once and help me to solve this issue.
Thanks & Regards,
Sai Priya. C
Attachment: SfAccordion_d9846644.zip
Thank you for your patience.
We have checked the reported requirement, "SfDatagrid does not bind on using different itemsources in SfAccordion content" in the provided code example, and observed that you did not set the DataContext to SfDataPager. That is the reason ItemSource in SfDatagrid did not correctly bind when it was placed as a SfAccordion content. We have modified the sample to meet your requirement.
|
<!—DataContext set in datapager-->
<datapager:SfDataPager x:Name="sfDataPager"
Grid.Row="1"
MinHeight="20"
PageSize="10"
AccentBackground="DarkCyan"
AccentForeground="White"
FontSize="12"
UseOnDemandPaging="False"
VerticalAlignment="Bottom"
HorizontalAlignment="Right"
NumericButtonCount="5"
Source="{Binding Orders}" >
<datapager:SfDataPager.DataContext>
<local:ViewModel/>
</datapager:SfDataPager.DataContext>
</datapager:SfDataPager>
<!--Binding the data grid source in SfDataGrid-->
<syncfusiongrid:SfDataGrid x:Name="sfCompanyGrid"
Grid.Row="0"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Stretch"
ItemsSource="{Binding ElementName=sfDataPager,Path=PagedSource}"
AlternationCount="2"
AutoGenerateColumns="True"
SelectionMode="Single" BorderThickness="0"
AllowRowHoverHighlighting="True"
RowHoverHighlightingBrush="Azure"
SelectionUnit="Row" Visibility="Visible"
RowHeight="45" FontSize="12"
Padding="8,0,8,0">
|
Screenshot:
Please try this solution and let us know if this solves the issue or if we have misunderstood your requirement.
Regards,
Vijayalakshmi V.R.
Thanks for your Reply, Actually i tried your solution its working, But in my scenario if i clicked the accordion at that time i'm binding the child item (users) to the company for example i have one class in that i'm having company name and in that class i have users class firstly i'm binding the company collection and then i'm binding the users collection, it shows the company list but if we click the company i have users in my collection but it was not showing users. Please check the attached document for reference. I'm getting the companies list in UI and i'm also getting the users list in cs file but there was something went wrong users are not displayed, Hope u understand my scenario.
Thanks in advance.
Attachment: Accordian_Sample_5ccc829.zip
Thank you for the update.
We have checked the provided code example and observed that you have get the details of CompanyList collection by using UserManagementService class, but we could not found the UserManagementService class in code example. So please share the sample which you have tried. It would be helpful for us to provide you the solution at the earliest.
Regards,
Vijayalakshmi V.R.
Thanks for your reply,
Why u need that, in that i'm calling the api and get the data as observable collection.
Thank you for the update.
We have prepared the sample using the provided code example and found that the Users List collection has not been displayed in the UI.
Screenshot:
The screenshot shows the item not displayed in UI
If this is the reported scenario, we suspect the item does not generate due to enabling the property “UseOnDemandPaging” in your code example. By disabling this, the UserList collection displayed in the UI. We have prepared the sample for the same. Please download it from following location :
Sample: http://www.syncfusion.com/downloads/support/forum/131486/ze/Accordionapp_(2)-1066690364
Expected output:
Regards,
Vijayalakshmi V.R.
Thanks for your reply,
In my scenario after clicking the company by using that company id i'm getting the users list dynamically, In your reply you are getting the users list dynamically, i have two different item sources to bind one is for accordion and another is for SFDataGrid(it is the content in Accordion). Please do useful sample.
Thanks & Regards,
Sai Priya. C
Thank you for the update.
We are regret that we are unable to understand your actual requirement. In our last update, we have maintaining two observable collection and binded it for SfAccordion and another for SfDataGrid which is the content for SfAccordion. Could you please check the below video which shows the user information on clicking the company ?
Video: accordionitems
Regards,
Vijayalakshmi V.R.
- 11 Replies
- 3 Participants
-
SA SaiPriya
- Jul 12, 2017 11:25 AM UTC
- Aug 31, 2017 01:48 AM UTC