Home Forums WPF controls Xceed DataGrid for WPF DataGridControl inside a ViewBox

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #22596 |

    I am having a problem with a data grid control which is inside a ViewBox. The problem is that it is not stretching and scaling properly (or rendering properly). Here is the code (I am assigning the ItemsSource in code):-

    <Page
    xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation&#8221;
    xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml&#8221;
    xmlns:xcdg=”http://schemas.xceed.com/wpf/xaml/datagrid&#8221;
    x:Class=”Registrations.ViewModifyQuestCustomersPage”
    x:Name=”Page”
    WindowTitle=”View/Modify Quest Customers”
    FlowDirection=”LeftToRight”
    Width=”Auto” Height=”Auto”
    WindowWidth=”640″ WindowHeight=”480″ >

    <Page.Resources>

    <!– Hide the Group By Control for the Xceed data grid –>
    <Style TargetType=”{x:Type xcdg:GroupByControl}”>
    <Setter Property=”Visibility” Value=”Collapsed” />
    </Style>

    </Page.Resources>

    <Viewbox Width=”Auto” Height=”Auto” >
    <Grid MinHeight=”480″ MinWidth=”640″ x:Name=”mainGrid” Width=”Auto” Height=”Auto”>
    <Grid.ColumnDefinitions>
    <ColumnDefinition Width=”*”/>
    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
    <RowDefinition Height=”70.218″/>
    <RowDefinition Height=”*”/>
    <RowDefinition Height=”56.96″/>
    </Grid.RowDefinitions>

    <StackPanel HorizontalAlignment=”Stretch” Margin=”0,0,0,0″ x:Name=”topPanel” Width=”Auto” Orientation=”Horizontal”>
    <TextBlock Margin=”10,0,0,0″ VerticalAlignment=”Center” Padding=”0,0,0,0″ Text=”Selected Reseller:”/>
    <ComboBox Margin=”10,0,0,0″ MinWidth=”150″ x:Name=”resellerComboBox” VerticalAlignment=”Center” Width=”Auto” IsSynchronizedWithCurrentItem=”True” ItemsSource=”{Binding Mode=OneWay}” DisplayMemberPath=”ResellerName” SelectionChanged=”OnResellerComboBoxSelectedChanged”/>
    </StackPanel>

    <TabControl TabStripPlacement=”Top” Grid.Row=”1″ Margin=”10,0,10,0″>
    <TabItem Name=”customerListingTabItem” Header=”Customers”>
    <xcdg:DataGridControl x:Name=”QuestCustomerDataGrid”
    ItemsSource=”{Binding}”
    CellEditorDisplayConditions=”CellIsCurrent”
    View=”TableView”
    EditTriggers=”None”>

    <xcdg:DataGridControl.Columns>
    <xcdg:Column FieldName=”TradingName”
    Title=”Trading Name”
    IsMainColumn=”True”
    MinWidth=”200″
    MaxWidth=”250″/>
    <xcdg:Column FieldName=”CompanyName”
    Title=”Company Name”
    MinWidth=”180″
    MaxWidth=”250″/>
    <xcdg:Column FieldName=”Address1″
    MinWidth=”180″
    MaxWidth=”250″/>
    <xcdg:Column FieldName=”Address2″
    MinWidth=”180″
    MaxWidth=”250″/>
    <xcdg:Column FieldName=”Address3″
    MinWidth=”80″
    MaxWidth=”180″/>

    <!– Hide the following columns –>
    <xcdg:Column FieldName=”PostingDate”
    Visible=”False”/>
    <xcdg:Column FieldName=”CustomerID”
    Visible=”False”/>
    <xcdg:Column FieldName=”DateLastUpdated”
    Visible=”False”/>
    <xcdg:Column FieldName=”ResellerID”
    Visible=”False”/>
    <xcdg:Column FieldName=”Notes”
    Visible=”False”/>
    <xcdg:Column FieldName=”Discontinued”
    Visible=”False”/>
    <xcdg:Column FieldName=”EmailAddress”
    Visible=”False”/>
    <xcdg:Column FieldName=”FaxNumber”
    Visible=”False”/>
    <xcdg:Column FieldName=”PhoneNumber”
    Visible=”False”/>
    <xcdg:Column FieldName=”ContactPerson”
    Visible=”False”/>
    <xcdg:Column FieldName=”QuestID”
    Visible=”False”/>
    <xcdg:Column FieldName=”ResellerName”
    Visible=”False” />
    </xcdg:DataGridControl.Columns>
    </xcdg:DataGridControl>
    </TabItem>

    <TabItem Name=”selectedCustomerTabItem” Header=”Modify Customer” >
    <Grid Name=”selectedCustomerDetailsGrid” Margin=”0,10,0,0″>
    <Grid.Resources>
    <Style TargetType=”{x:Type TextBlock}”>
    <Setter Property=”MinWidth” Value=”120″ />
    </Style>
    <Style TargetType=”{x:Type StackPanel}”>
    <Setter Property=”Margin” Value=”0,10,0,0″ />
    </Style>
    <Style TargetType=”{x:Type TextBox}”>
    <Setter Property=”MinWidth” Value=”300″/>
    </Style>
    </Grid.Resources>
    <Grid.RowDefinitions>
    <RowDefinition Height=”Auto” />
    <RowDefinition Height=”Auto” />
    <RowDefinition Height=”Auto” />
    <RowDefinition Height=”Auto” />
    <RowDefinition Height=”Auto” />
    <RowDefinition Height=”Auto” />
    <RowDefinition Height=”Auto” />
    <RowDefinition Height=”Auto” />
    <RowDefinition Height=”Auto” />
    <RowDefinition Height=”Auto” />
    <RowDefinition Height=”Auto” />
    <RowDefinition Height=”Auto” />
    <RowDefinition Height=”Auto” />
    </Grid.RowDefinitions>

    <StackPanel Grid.Row=”0″ Orientation=”Horizontal”>
    <TextBlock Margin=”10,5,0,5″ Text=”Customer ID:” />
    <TextBox Margin=”10,0,0,0″ x:Name=”txtCustomerID” Text=”{Binding Path=SelectedItem.CustomerID, ElementName=QuestCustomerDataGrid, Mode=OneWay}” IsReadOnly=”True” MaxLines=”1″/>
    </StackPanel>

    <StackPanel Grid.Row=”1″ Orientation=”Horizontal”>
    <TextBlock Margin=”10,5,0,5″ Text=”Trading Name:” />
    <TextBox Margin=”10,0,0,0″ x:Name=”txtTradingName” Text=”{Binding Path=SelectedItem.TradingName, ElementName=QuestCustomerDataGrid, Mode=TwoWay}” MaxLines=”1″/>
    </StackPanel>

    <StackPanel Grid.Row=”2″ Orientation=”Horizontal”>
    <TextBlock Margin=”10,5,0,5″ Text=”Company Name:” />
    <TextBox Margin=”10,0,0,0″ x:Name=”txtCompanyName” Text=”{Binding Path=SelectedItem.CompanyName, ElementName=QuestCustomerDataGrid, Mod

    Imported from legacy forums. Posted by Shingi (had 2051 views)

    Xceed Support
    Member
    Post count: 5658

    Hi,

    Could you provide a complete reproduction ( with a provided ItemsSource) so I can investigate the problem (without a data source, I have no idea what it’s supposed to look like)…

    Thanks

    Imported from legacy forums. Posted by Marcus [Xceed] (had 2930 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.