设置数据源后 Infragistics UltraGrid (9.2) 计数 Band

发布于 2024-12-18 11:27:45 字数 254 浏览 5 评论 0原文

在继承的 UltraGrid 中,我想知道在 base.DataSource 上设置新值后网格包含多少个 Band。我如何找到该计数?

谢谢

-a-

/*****添加了 screendump*****/

(代码不是我的财产,所以我已经扰乱了一些可能的商业秘密)

在此处输入图像描述

In an inherited UltraGrid I would like know how many Bands the grid contains after I set a new value on base.DataSource. How do I find that count?

Thanks

-a-

/*****Added screendump*****/

(code is not my property so I've scrambled away some possible trade secrets)

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

羁〃客ぐ 2024-12-25 11:27:45

将新的 dataSource 对象设置为 UltraGrid 的 DataSource 属性后,您可以验证计数,如下所示:

ultraGrid1.DisplayLayout.Bands.Count

希望这就是您正在寻找的。

After setting the new dataSource object to the DataSource property of the UltraGrid you could verify the count like:

ultraGrid1.DisplayLayout.Bands.Count

Hope this is what you are looking for.

夜夜流光相皎洁 2024-12-25 11:27:45

尝试使用基类UltraControlBasePropertyChanged事件:

public void Form1()
{
    InitializeComponents();
    ultraWinGrid.PropertyChanged += new Infragistics.Win.PropertyChangedEventHandler(ultraWinGrid_PropertyChanged);
}
void ultraWinGrid_PropertyChanged(object sender, Infragistics.Win.PropertyChangedEventArgs e)
{
    Infragistics.Shared.PropChangeInfo pinfo = e.ChangeInfo;
    try
    {
        // moving through the trigger stack
        while (pinfo!=null)
        {
            if (Equals(pinfo.PropId, Infragistics.Win.UltraWinGrid.PropertyIds.DataSource))
            {
                int newBandCount = this.ultraWinGrid.DisplayLayout.Bands.Count;
                /// your code here
            }
            pinfo=pinfo.Trigger;
        }
    }
    catch
    { 

    }
}

Try to use PropertyChanged event of the base class UltraControlBase:

public void Form1()
{
    InitializeComponents();
    ultraWinGrid.PropertyChanged += new Infragistics.Win.PropertyChangedEventHandler(ultraWinGrid_PropertyChanged);
}
void ultraWinGrid_PropertyChanged(object sender, Infragistics.Win.PropertyChangedEventArgs e)
{
    Infragistics.Shared.PropChangeInfo pinfo = e.ChangeInfo;
    try
    {
        // moving through the trigger stack
        while (pinfo!=null)
        {
            if (Equals(pinfo.PropId, Infragistics.Win.UltraWinGrid.PropertyIds.DataSource))
            {
                int newBandCount = this.ultraWinGrid.DisplayLayout.Bands.Count;
                /// your code here
            }
            pinfo=pinfo.Trigger;
        }
    }
    catch
    { 

    }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文