Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
230
Summary Contents Access
posted

Hi ,

I am using xamdatagrid in my project.

Here I wanted to get the tabular like appearance.

Grid should physically display lines between rows and columns.

Also i want sum of each column, but i dont want "sum=" i.e., I only want sum value not the text "sum="..

how to have it.

Please help me.

Bcz i wanted to get the Excel appearance.

Thank You!!!

 

  • 69686
    Suggested Answer
    posted

    Hello,

    To get the Excel look regarding the borders, you should create a style for the CellValuePresenter and set BorderBrush and BordeThickness properties.

    Regarding the Summaries, you should create a style for the Summary presenter and retemplate it.

    Here is a sample style that will not show the label of the Calculator used in the summary:

    <Style TargetType="{x:Type igDP:SummaryResultPresenter}">

                <Setter Property="Padding" Value="1,1"/>

                <Setter Property="Template">

                    <Setter.Value>

                        <ControlTemplate TargetType="{x:Type igDP:SummaryResultPresenter}">

                            <Border

    Background="{TemplateBinding Background}"

    BorderBrush="{TemplateBinding BorderBrush}"

    BorderThickness="1"

    Padding="{TemplateBinding Padding}"

    ToolTip="{Binding Path=SummaryResult.ToolTipResolved, RelativeSource={RelativeSource TemplatedParent}}">

                                <Grid Margin="2">

                                    <Grid.ColumnDefinitions>

                                        <ColumnDefinition Width="Auto"/>

                                        <ColumnDefinition Width="5*"/>

                                    </Grid.ColumnDefinitions>

                                    <TextBlock  Grid.Column="1" Foreground="BurlyWood" Text="{Binding Path=SummaryResult.Value, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" HorizontalAlignment="Right"/>

                                </Grid>

                            </Border>

                        </ControlTemplate>

                    </Setter.Value>

                </Setter>

                <Setter Property="Margin" Value="0,0,0,0"/>

            </Style>

    Hope this helps,

    Alex.