This is a migrated thread and some comments may be shown as answers.

Data Formatting

3 Answers 57 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Sergey
Top achievements
Rank 1
Sergey asked on 26 Nov 2013, 11:48 AM
Hello!

According to demo WPF->GridView->Appearance->Data Formatting I can set DataTemplate as CellTemplate.

Everything works fine. But what should I do if I want my DataTemplate fill cell?

For example, this code will show me empty cell:

              <telerik:GridViewDataColumn.CellTemplate>
                    <DataTemplate>
                        <Grid Background="DarkMagenta"/>
                    </DataTemplate>
              </telerik:GridViewDataColumn.CellTemplate>

instead of filling all empty space.

3 Answers, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 26 Nov 2013, 12:18 PM
Hello Sergey,

Would it be possible to add some child element to your grid? You can try to set fixed width and height for it as well.

Generally, if you want to set a background for GridViewCell, then you can define a simple style like so:
<Style TargetType="telerik:GridViewCell">
            <Setter Property="Background" Value="DarkMagenta"/>
        </Style>

I hope this helps.

Regards,
Yoan
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Sergey
Top achievements
Rank 1
answered on 26 Nov 2013, 01:10 PM
I don't want to set background.

Grid was only example.
My target is to add path that will stretch the cell's size. 
When I change in runtime gridView row's height, size of Path doesn't change.
How should I archive this?


0
Yoan
Telerik team
answered on 29 Nov 2013, 06:21 PM
Hello Sergey,

Indeed, this would be an expected behaviour. For example it will be the same as using MS DataGrid. The way to go is to change the size of the Path, subscribing to RadGridView's RowResizing event.

I hope this helps.

Regards,
Yoan
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
GridView
Asked by
Sergey
Top achievements
Rank 1
Answers by
Yoan
Telerik team
Sergey
Top achievements
Rank 1
Share this question
or