Gridview changes... c#

Posted on 2014-07-17
Last Modified: 2014-07-20
Please see the attached image to see if these changes is possible to do:

1. Add a caption to the gridview for the Data Title.
2. Update 2013 and 2014 based on [YYYY] field in included in the gridview stored proc.

Thank you.
Question by:Mike Eghtebas
    LVL 17

    Accepted Solution

    The GridView control that comes as part of WPF does not have a caption property.  The only way you could do what you wish to do is to use a border and StackPanel - not quite what you wanted.

    On the Header sections can't you just Bind the column header to the value - see my example

            <Border Grid.Row="1"  >
                <Grid  Grid.Row="1"  HorizontalAlignment="Stretch">
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto" />
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="10" />
                    <StackPanel Grid.Row="0" Grid.ColumnSpan="2" >
                        <TextBlock  Text="Awaiting Validation" />
                        <Rectangle />
                    <DataGrid Grid.Row="1" ItemsSource="{Binding Customers}">
                            <DataGridTextColumn Header="{Binding FirstName}" Binding="{Binding FirstName}" />
                                <!--enter row binding here-->

    Open in new window

    LVL 33

    Author Closing Comment

    by:Mike Eghtebas
    Thank you

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now