【问题标题】:Modifying DevExpress GridControl expand button修改 DevExpress GridControl 展开按钮
【发布时间】:2016-09-01 13:26:26
【问题描述】:

我是 DevExpress 的新手,我找不到修改嵌套网格视图上的加号的解决方案。 由于我的一些用户拥有平板电脑,他们希望通过触摸加号来扩展行。然而,他们很难准确地触摸加号。 有什么办法可以修改让它变大吗?

改变标志的大小或完全改变图像对我来说很好。

欢迎您的想法。

【问题讨论】:

  • 点击行=展开怎么样?或者双击
  • 这是我只能以某些形式使用的替代解决方案。在其他网格中,触摸可以编辑单元格。在这种情况下,我需要那个加号。

标签: c# devexpress gridcontrol


【解决方案1】:

我建议您浏览以下参考链接,这些链接将为您提供有关所需功能的更多详细信息:

要修改Group Expand Button

How to display an image in a group row
GridView.CustomDrawGroupRow Event
How to get skin's '+' icon for Custom Draw Group Rows


如果是 Mater-Details:

用于增加展开/折叠按钮的大小:
Enlarge Exapnd/Collapse button of master detail view in xtragrid
master detail expand button size

如果您想更改 GridView 的展开\折叠图标,那么您可以 通过修改 Grid 的图像来改变它 | PlusMinusEx 皮肤 元素。这是一个代码 sn-p 说明如何替换图像 在当前应用的皮肤中使用您的自定义皮肤。

Skin skin = GridSkins.GetSkin(DevExpress.LookAndFeel.UserLookAndFeel.Default);
SkinElement element = skin[GridSkins.SkinPlusMinusEx];
element.Image.SetImage(GetNewImage(), Color.Magenta);
LookAndFeelHelper.ForceDefaultLookAndFeelChanged();

您还可以在 CustomDrawCell 上绘制展开/折叠按钮 事件处理程序。请以完全相同的方式查看How to paint the master row's expand buttons within the CustomDrawCell event 正如 XtraGrid 所做的知识库文章以获取更多信息。

参考资料:
Draw custom expand/collapse button in GridView Row
Custom Draw +/- button for Master Detail GridView
Grid - How to change the master-detail expand button
XtraGrid:Adding a button to a cell that will allow cell data to expand - collapse.

【讨论】:

    【解决方案2】:

    或者,您可以使用 TouchUIMode 功能,该功能可以在启用触摸的环境中使事情变得更大且更易于使用。请参阅此页面:

    https://documentation.devexpress.com/#WindowsForms/DevExpressXtraEditorsWindowsFormsSettings_TouchUIModetopic

    编辑:还有一个触摸优化的皮肤,你可以在这篇博文中看到: https://community.devexpress.com/blogs/theonewith/archive/2011/12/29/build-for-beautiful-with-dxv2-metro-inspired-winforms-apps.aspx

    【讨论】:

      猜你喜欢
      • 2013-12-01
      • 2015-04-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多