Xceed dataGrid scroll FixedColumnCount
2014-02-27 17:03
429 查看
昨天,客户提个新需求,要求dataGrid 水平滚动时,第一列固定显示,不能进行隐藏。
我使用的是Xceed 控件,对此控件不是很熟悉,在网上查询了下, 用此段代码可以实现。
<code>
<xcdg:DataGridControl>
<xcdg:DataGridControl.View>
<xcdg:TableView FixedColumnCount="2" />
</xcdg:DataGridControl.View>
<xcdg:DataGridControl.DetailConfigurations>
<xcdg:DetailConfiguration RelationName="MyDetail" xcdg:TableView.FixedColumnCount="5" />
</xcdg:DataGridControl.DetailConfigurations>
</xcdg:DataGridControl>
</code>
功能实现了 ,可是 样式全变化了,估计用户接受不了。所以我就换成了VS1012自带的控件,DataGrid.
FrozenColumnCount="1"
实现了,然后又重新写了下样式。
<DataGrid.RowStyle
>
<Style
TargetType="DataGridRow">
<Style.Triggers>
<Trigger
Property="IsMouseOver"
Value="True">
<Setter
Property="Background"
Value="#FFF1FAFF"/>
<Setter
Property="FontSize"
Value=" 16"/>
<Setter
Property="Height"
Value="26"/>
<Setter
Property="Foreground"
Value="Blue"/>
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
<DataGrid.CellStyle
>
<Style
TargetType="DataGridCell">
<Style.Triggers
>
<Trigger
Property="IsSelected"
Value="True">
<Setter
Property="Background"
Value="Gray"/>
<Setter
Property="FontSize"
Value=" 16"/>
<Setter
Property="Height"
Value="26"/>
<Setter
Property="Foreground"
Value="Blue"/>
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.CellStyle>
我使用的是Xceed 控件,对此控件不是很熟悉,在网上查询了下, 用此段代码可以实现。
<code>
<xcdg:DataGridControl>
<xcdg:DataGridControl.View>
<xcdg:TableView FixedColumnCount="2" />
</xcdg:DataGridControl.View>
<xcdg:DataGridControl.DetailConfigurations>
<xcdg:DetailConfiguration RelationName="MyDetail" xcdg:TableView.FixedColumnCount="5" />
</xcdg:DataGridControl.DetailConfigurations>
</xcdg:DataGridControl>
</code>
功能实现了 ,可是 样式全变化了,估计用户接受不了。所以我就换成了VS1012自带的控件,DataGrid.
FrozenColumnCount="1"
实现了,然后又重新写了下样式。
<DataGrid.RowStyle
>
<Style
TargetType="DataGridRow">
<Style.Triggers>
<Trigger
Property="IsMouseOver"
Value="True">
<Setter
Property="Background"
Value="#FFF1FAFF"/>
<Setter
Property="FontSize"
Value=" 16"/>
<Setter
Property="Height"
Value="26"/>
<Setter
Property="Foreground"
Value="Blue"/>
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
<DataGrid.CellStyle
>
<Style
TargetType="DataGridCell">
<Style.Triggers
>
<Trigger
Property="IsSelected"
Value="True">
<Setter
Property="Background"
Value="Gray"/>
<Setter
Property="FontSize"
Value=" 16"/>
<Setter
Property="Height"
Value="26"/>
<Setter
Property="Foreground"
Value="Blue"/>
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.CellStyle>
相关文章推荐
- mysql的limit语句
- Android Animation时间插入器Interpolator
- mahout聚类
- configure.in Makefile.am解析
- 伪元素 :Before 和 :After的学习
- DevExpress Xaf入门——关于一对多关系的配置(DC模式)
- 【技术】js控制滚动条位置
- 浅析android应用增量升级(差分升级)
- ORA-01157: cannot identify/lock data file
- disk benchmark和bonnie++,noatime对性能的影响
- 程序员的本职工作和私活孰轻孰重?
- Tao-ReviewBoard 提交时报出 HttpClient.excuteMethod Error HttpCode=400 的错误
- 好用的淘宝开源工具tsar工具
- jquery 侧边商品分类二级导航菜单样式
- linux,串口读取指定数目的字节,串口读取数据错误
- sencha2.3与phonegap的配置
- JNDI与JDBC比较以及连接池的技术
- Flex中使用HTTPService向后发送请求,参数中如何使用URL的保留字符(问号、百分号)
- (11)ExtJS之Ext.form.field.Number数字输入框
- ubuntu 反编译apk