Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 353991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:52:56+00:00 2026-05-12T11:52:56+00:00

I have an Accordion control to which I have added a datagrid. The problem

  • 0

I have an Accordion control to which I have added a datagrid.

The problem is that I cannot set the header of the accordian item that displays the Datagrid.

I can only set the header on the object of the class AccordionItem and not when the Datagrid is added to the Accordion.

I also tried to add the Datagrid to the Accordionitem object that was added to the Accordion but could not succeed. I can’t figure out how to add Datagrid to accordonitem object.

Appreciate your help.

Thanks,
I

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T11:52:56+00:00Added an answer on May 12, 2026 at 11:52 am

    An Accordion has only AccordionItem children. You should set the child explicitly to the Accordion like that (example of an Accordion with a StackPanel as a child and a template for the header):

    <layoutToolkit:Accordion 
            x:Name="accordion" 
            ExpandDirection="Down" 
            HorizontalAlignment="Stretch" 
            HorizontalContentAlignment="Stretch" 
            SelectionChanged="Accordion_SelectionChanged" 
            AccordionButtonStyle="{StaticResource DateAccordionButtonStyle}" 
            Background="White"
            Padding="2"
            >
        <layoutToolkit:AccordionItem x:Name="dayAI" Background="{StaticResource OutlookCalendarColor}" >
            <layoutToolkit:AccordionItem.HeaderTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal" Margin="0,0,0,2">
                        <Image VerticalAlignment="Center" Source="{Binding Day, Source={StaticResource ImagesPath}}" Stretch="Uniform" />
                        <TextBlock FontWeight="Bold" VerticalAlignment="Center" Text="{Binding Resource.Day, Source={StaticResource LocalizedStrings}}" Margin="5,0,0,0" />
                    </StackPanel>
                </DataTemplate>
            </layoutToolkit:AccordionItem.HeaderTemplate>
            <StackPanel >
                <RadioButton Margin="5,5,5,5" x:Name="todayRB" GroupName="RBGroup" Content="{Binding Resource.Today, Source={StaticResource LocalizedStrings}}" Checked="RB_Checked"/>
                <RadioButton Margin="5,5,5,5" x:Name="yesterdayRB" GroupName="RBGroup" Content="{Binding Resource.Yesterday, Source={StaticResource LocalizedStrings}}" Checked="RB_Checked"/>
                <RadioButton Margin="5,5,5,5" x:Name="dayPickerRB" GroupName="RBGroup"  Checked="RB_Checked">
                    <StackPanel Orientation="Horizontal" >
                        <TextBlock Text="{Binding Resource.Day, Source={StaticResource LocalizedStrings}}" Margin="0,0,5,0" VerticalAlignment="Center"/>
                        <Controls:DatePicker x:Name="dayPickerDP" />
                    </StackPanel>
                </RadioButton>
            </StackPanel>
        </layoutToolkit:AccordionItem>
    </layoutToolkit:Accordion>
    

    So in your case it would be something like:

    <Accordion>
       <AccordionItem Header="My header text">
         <DataGrid x:Name="MyDataGrid"/>
       </AccordionItem>
    </Accordion>
    

    Hope that makes sense to you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a masterpage with a sidebar that conatians an accordion control for site
I have a control which I wrote for capturing signatures on a web page,
I have to display different medical forms according to which state the user is
this time I have a page which will load different kinds of file formats,
I have following situation in a C# Windows Forms (.NET 4.0) application: I have
I have a simple goal: Map Ctrl-C, a command I don't think I've ever
We all know that App Engine limits you to 1 MB for most input/output
we were asked to develop an iphone app like the one in the figure.
I'm building a form with many panels and many controls (both inside and outside
I am trying to transfer file over explicit TLS/SSL. Looks like the FtpWebRequest in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.