Ticket T1279256
Visible to All Users

GridControl - why is my row getting larger?

created a day ago

I'm using a WPF grid control. I have a 'IsSelected' checkbox. This has nothing to do with grid selection, this is whether or not to include this row in a query.

It is the only editable cell in my grid. When I click the checkbox OR click inside the cell, but outside the checkbox, my row is getting a couple of pixels larger. When the grid loses focus, the row shrinks again.

I'm trying to avoid manually specifying maximum row heights, as we're still settling on font stuff.

Any ideas?

XAML
<dxg:GridControl Margin="0,0,0,0" Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsEnabled="{Binding IsDataSourceTestInProgress, Converter={dxmvvm:BooleanNegationConverter}}" ItemsSource="{Binding RemoteDataSources}" SelectedItem="{Binding FocusedDataSource, Mode=TwoWay}" SelectionMode="Row" > <dxg:GridControl.SortInfo> <dxg:GridSortInfo FieldName="ServerName" SortOrder="Ascending" /> <dxg:GridSortInfo FieldName="DataSourceName" SortOrder="Ascending" /> </dxg:GridControl.SortInfo> <!--Immediate posting will trigger selection changed up front, and not after focus leaves--> <dxg:GridControl.View> <dxg:TableView ShowGroupPanel="False" ShowIndicator="False" FadeSelectionOnLostFocus="False" EnableImmediatePosting="True" RowDoubleClickCommand="{Binding GridRowDoubleClickedCommand, Converter={dxmvvm:ToTypedCommandConverter}}" /> </dxg:GridControl.View> <dxg:GridControl.Columns> <dxg:GridColumn Width="30" FieldName="IsSelected" Header="" HeaderToolTip="{x:Static properties:Resources.data_source_chooser_column_tooltip_selected}" /> <dxg:GridColumn FieldName="ServerName" Width="1*" AllowFocus="False" Header="{x:Static properties:Resources.data_source_chooser_column_caption_server}" HeaderToolTip="{x:Static properties:Resources.data_source_chooser_column_tooltip_server}" /> <dxg:GridColumn FieldName="DataSourceName" AllowFocus="False" Width="1*" Header="{x:Static properties:Resources.data_source_chooser_column_caption_data_source_name}" HeaderToolTip="{x:Static properties:Resources.data_source_chooser_column_tooltip_data_source_name}" /> <dxg:GridColumn FieldName="IsSecure" Width="50" AllowFocus="False" Header="{x:Static properties:Resources.data_source_chooser_column_caption_is_secure}" HeaderToolTip="{x:Static properties:Resources.data_source_chooser_column_tooltip_is_secure}" > <dxg:GridColumn.CellTemplate> <DataTemplate> <TextBlock ToolTip="{x:Static properties:Resources.data_source_chooser_column_caption_is_secure}" Style="{StaticResource StandardEmbeddedCheckIconStyle}" /> </DataTemplate> </dxg:GridColumn.CellTemplate> </dxg:GridColumn> <dxg:GridColumn Width="60" AllowFocus="False" HorizontalHeaderContentAlignment="Right" FieldName="Port" Header="{x:Static properties:Resources.data_source_chooser_column_caption_port}" HeaderToolTip="{x:Static properties:Resources.data_source_chooser_column_tooltip_port}" /> <dxg:GridColumn AllowFocus="False" FieldName="Version" Visible="false" Header="{x:Static properties:Resources.data_source_chooser_column_caption_version}" HeaderToolTip="{x:Static properties:Resources.data_source_chooser_column_tooltip_version}" /> <dxg:GridColumn FieldName="Delete" Width="50" HeaderToolTip="{x:Static properties:Resources.data_source_chooser_column_tooltip_delete}" > <dxg:GridColumn.CellTemplate> <DataTemplate> <dx:SimpleButton Style="{StaticResource StyleEmbededDeleteButton}" Command="{Binding DataContext.DeleteButtonCommand, RelativeSource={RelativeSource AncestorType=ContentControl}}" CommandParameter="{Binding RowData.Row}" ToolTip="{x:Static properties:Resources.data_source_delete_button_tooltip }" ></dx:SimpleButton> </DataTemplate> </dxg:GridColumn.CellTemplate> </dxg:GridColumn> </dxg:GridControl.Columns> </dxg:GridControl>
Comments (2)
Alexander D (DevExpress Support) a day ago

    Hello,

    I tested a GridControl with similar settings, but the row height remains consistent on my side. Please refer to the attached sample project and screencast.

    Could you please modify my project to demonstrate the issue and send it back to us for research? In this case, we will be in a better position to recommend a solution.

    I hope to hear from you soon.

    Regards,
    Alexander

    GR GR
    Greg Robertson a day ago

      Shoot, yeah, that one is my bad. I had a global style on the checkedit, but the style is only evaluated when you click into the editor. I'm still new to wpf, sorry!

      I need to figure out how to apply a style to checkedits that aren't in the grid, and not check edits that are in the grid. That's a different problem than this though.

      Answers approved by DevExpress Support

      created a day ago

      Hello Greg,

      Thank you for the clarification.

      This behavior is specific to our controls. In general, our editors have standalone and in-place mode. These modes utilize different templates, and this can affect customization. For general information regarding in-place mode, please refer to the following help topic: In-Place Mode.

      In general, editors outside of specific usage scenarios should not utilize in-place mode. You can use the EditMode property to determine whether the editor is utilized in a GridControl (or a similar control). While this property is usually reserved for internal use, it appears to be optimal for your task.

      To apply your style only to standalone editors, you can define a trigger as follows:

      XAML
      <Style TargetType="dxe:CheckEdit"> <Style.Triggers> <Trigger Property="EditMode" Value="Standalone"> <Setter Property="Background" Value="Red"/> <Setter Property="Foreground" Value="Red"/> <Setter Property="Content" Value="Test"/> </Trigger> </Style.Triggers> </Style>

      Please let me know if this helps.

      Regards,
      Alexander

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.