动态更改列名

编程入门 行业动态 更新时间:2024-10-09 20:28:09
本文介绍了动态更改列名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个页眉/详细信息自定义屏幕,在该屏幕上,根据页眉中的下拉菜单选择要显示的网格列。这可以正常工作,但现在我也想更改一些列名称。使用记录的语法,我无法使它正常工作。我看不到自己在做什么错-似乎没有什么不同。我已附加到流程中,并在此事件中设置了一个断点,并且达到了终点,但是系统似乎只是忽略了它:

I have a Header / Detail custom screen where I'm manipulating which grid columns display based on a dropdown selection in the header. This works fine, but now I'd like to change a few column names as well. Using the documented syntax, I cannot get this to work. I can't see what I'm doing wrong - nothing seems to make any difference. I've attached to process and put a break point at this event, and it's hitting the line - but the system seems to just ignore it:

protected virtual void ACMappingHeader_RowSelected(PXCache sender, PXRowSelectedEventArgs e) { var mh = (ACMappingHeader)e.Row; if (mh == null) return; if (mh.MappingType == "Option1") { PXUIFieldAttribute.SetDisplayName<ACMappingDetail.target1CD>(this.MappingDetail.Cache, "Target");

谢谢...

推荐答案

您的显示名称例程看起来正确,但是要确保实际更新列名称,您需要执行以下操作:

Your display name routine looks correct however to make sure the column names actually update you need to do the following:

  • 在页面源中,需要在网格上设置 RepaintColumns = true值。可以通过自定义管理器或直接从ASPX源完成。 -告诉网格在回调后刷新列,允许标题实际重新显示。

更多推荐

动态更改列名

本文发布于:2023-07-22 00:47:49,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1182545.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:动态

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!