【问题标题】:Hide Repeating table programmatically以编程方式隐藏重复表
【发布时间】:2014-03-12 08:20:33
【问题描述】:

我有一个标签和一个从重复字段填充的重复表。

在后面的代码(从 Web 服务获取)中为该字段分配值(使用 InnerXML 属性)。所以我想隐藏重复表和标签,以防该字段没有可用的值。

  1. 我可以在后面的代码中做吗?

  2. 或者如何使用格式化规则来做到这一点?我已经尝试了 RepeatingField 的规则是空白但没有运气。

更新:

  • 表格截图:

  • 用于填充数据的表单代码:

    string xmlString = String.Empty;
    foreach (var record in records)
    {
        xmlString += CreateGroup("StatementList");
        xmlString += CreateElement("Statement_ID", record.ID
        xmlString += CreateElement("Statement_Label", record.Label
        xmlString += CreateElement("Statement_Text", record.Text
        xmlString += EndGroup("StatementList");
    }
    
    if (!String.IsNullOrEmpty(statementXML))
    {
        XPathNavigator nodeStatement = Root.SelectSingleNode("/my:AuditForm/my:MasterData/my:StatementGroup", NamespaceManager);
        nodeStatement.InnerXml = statementXML;
    }
    

【问题讨论】:

  • 你能用javascript/jQuery吗?
  • @Juventus18 恐怕你不能。它是使用 XML 结构和 C# 代码的 InfoPath。

标签: c# xml formatting infopath2010


【解决方案1】:

尝试以下步骤在 Infopath 中隐藏对象

如果您需要在 infopath 中隐藏 Reapting 表和标签,请执行以下操作

Click on Reapting Section

Under Manage Rule Select Formatting

Add a condition as the label is blank

and check the check box for hide this control

如果您需要在 infopath 中单独隐藏标签,请执行以下操作

Click on that label

Under Manage Rule Select Formatting

Add a condition as the label is blank

and check the check box for hide this control

【讨论】:

  • 你错过了重点。我只想在重复表中没有数据时隐藏它。
  • 我能得到你表格的任何屏幕截图吗
  • @Shinigamae 任何可用的屏幕截图
  • 给你。已更新。
  • 你试过上面的第一个label is blank hide this control@Shinigamae
猜你喜欢
  • 2011-12-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-01-16
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多