diff --git a/doc/source/handycontrol/native_controls/dataGrid/index.md b/doc/source/handycontrol/native_controls/dataGrid/index.md index 7ea36f18..245bb2c0 100644 --- a/doc/source/handycontrol/native_controls/dataGrid/index.md +++ b/doc/source/handycontrol/native_controls/dataGrid/index.md @@ -2,6 +2,19 @@ title: DataGrid 数据表格 --- +**HandyControl中自带DataGrid相关样式** + +| style名称 | 所属类型 | 用途描述 | +| :------------------------ | :------------------------------------------ | :----------------------------------------------------- | +| RowHeaderGripperStyle | Thumb | RowHeader的可拖拽样式 | +| ColumnHeaderGripperStyle | Thumb | ColumnHeader可拖拽样式 | +| DataGridCellStyle | DataGridCell | DataGrid数据列样式 | +| DataGridRowStyle | DataGridRow | DataGrid数据行样式 | +| DataGridColumnHeaderStyle | DataGridColumnHeader | DataGrid列头样式 | +| DataGridRowHeaderStyle | DataGridRowHeader | DataGrid行头样式 | +| TextBlockComboBoxStyle | controls:DataGridAttach.ComboBoxColumnStyle | DataGrid附加属性文本框下拉列的非编辑模式下文本显示样式 | +| DataGridTextColumnStyle | TextBlock | DataGrid文本列样式 | + {% note info no-icon %} 用例: @@ -29,4 +42,34 @@ title: DataGrid 数据表格 {% endcode %} ![ContextMenu](https://raw.githubusercontent.com/NaBian/HandyControl/master/Resources/DataGrid.png) -{% endnote %} \ No newline at end of file +{% endnote %} + +**常见问题:** +{% note warning%} +对于文本显示列`DataGridTextColumn`需要设定文本内容`水平居中`或者`水平居右`,而不是HandyControl中设定的样式默认显示为`居左`时,需要继承`DataGridCellStyle`重写`HorizontalContentAlignment` 属性为`Center` 或`Right` 需要注意的是,此方式仅仅使用与引入了HandControl资源样式的项目,普通原生DataGrid使用该方式无效。 + +用例如下: + +{% code %} + +样式: + + +xaml中的使用: + + + + + + + + +{% endcode %} + +效果如下: + +![DataGridWarning01](..\images\DataGrid-Warning01.png) + +{% endnode %} diff --git a/doc/source/handycontrol/native_controls/images/DataGrid-Warning01.png b/doc/source/handycontrol/native_controls/images/DataGrid-Warning01.png new file mode 100644 index 00000000..f1d39abe Binary files /dev/null and b/doc/source/handycontrol/native_controls/images/DataGrid-Warning01.png differ