[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Gridview changes... c#

Posted on 2014-07-17
2
Medium Priority
?
351 Views
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.
gw1.png
0
Comment
Question by:Mike Eghtebas
2 Comments
 
LVL 17

Accepted Solution

by:
wobbled earned 2000 total points
ID: 40204345
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

    <Grid>
        <Border Grid.Row="1"  >

            <Grid  Grid.Row="1"  HorizontalAlignment="Stretch">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="10" />
                </Grid.ColumnDefinitions>

                <StackPanel Grid.Row="0" Grid.ColumnSpan="2" >
                    <TextBlock  Text="Awaiting Validation" />
                    <Rectangle />
                </StackPanel>

                <DataGrid Grid.Row="1" ItemsSource="{Binding Customers}">
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="{Binding FirstName}" Binding="{Binding FirstName}" />
                    </DataGrid.Columns>
                    <DataGrid.RowDetailsTemplate>
                        <DataTemplate>
                            <!--enter row binding here-->
                        </DataTemplate>
                    </DataGrid.RowDetailsTemplate>
                </DataGrid>

            </Grid>
        </Border>

    </Grid>

Open in new window

0
 
LVL 34

Author Closing Comment

by:Mike Eghtebas
ID: 40207763
Thank you
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

873 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