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>
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
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.