动态更改列名 [英] Changing column name dynamically

查看:40
本文介绍了动态更改列名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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源完成。 -告诉网格在回调后刷新列,允许标题实际重新显示。

这篇关于动态更改列名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆