Click here to Skip to main content
15,914,500 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello
I would like make footer in datagrid consisting of text fields. I thought about something like that but at the moment when if I set FrozenColumnCount = "5" frozen remain only the rows but footer and headers not Where I'm doing mistake

What I have tried:

<ControlTemplate TargetType="{x:Type DataGrid}">
                            <Border >
                                <ScrollViewer>
                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition/>
                                            <RowDefinition/>
                                            <RowDefinition/>
                                        </Grid.RowDefinitions>
                                        <DataGridColumnHeadersPresenter Grid.Row="0"/>
                                        <ItemsPresenter Grid.Row="1"/>
                                        <WrapPanel Grid.Row="2">
                                            <TextBox Text="Tekst1"/>
                                            <TextBox Text="Tekst2"/>
                                            <TextBox Text="Tekst3"/>
                                            <TextBox Text="Tekst4"/>
                                            <TextBox Text="Tekst5"/>
                                            <TextBox Text="Tekst6"/>
                                        </WrapPanel>
                                    </Grid>
                                </ScrollViewer>
                            </Border>
                        </ControlTemplate>
Posted
Updated 21-Feb-17 12:06pm

Google Search is your Friend. There are plenty of answers for you to choose from: wpf datagrid frozen columns[^]
 
Share this answer
 
Comments
Rakon22 21-Feb-17 17:20pm    
Reading comprehension is your friend :) I want change template because i want have a footer in datagrid and still have functionality frozen columns
Graeme_Grant 21-Feb-17 17:50pm    
don't poke at the help, they might not respond. You are the one asking for help, and it is out of our generosity that we do. We don't have to.
Okay, so you are using a hack to add a footer, not inherent in the control.

The solution is to bind the footer ScrollViewer to the DataGrid's ScrollViewer and the two will move in sync. The frozen cells mirrored in the footer need to be outside the footer's ScrollViewer.
 
Share this answer
 
An alternative, and a much better solution for you is to ditch the standard DataGrid and use syncfusion[^] DataGrid[^]. They have Community Licences that won't cost you a cent.

You can read more about this in their documentation[^]

I am not affiliated with syncfusion nor do I use their products.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900