在继承的 UltraGrid 中,我想知道在设置新值后网格包含多少条带base.DataSource
。我如何找到该计数?
谢谢
-一个-
/*****添加屏幕转储*****/
(代码不是我的财产,所以我已经排除了一些可能的商业机密)
在继承的 UltraGrid 中,我想知道在设置新值后网格包含多少条带base.DataSource
。我如何找到该计数?
谢谢
-一个-
/*****添加屏幕转储*****/
(代码不是我的财产,所以我已经排除了一些可能的商业机密)
将新的 dataSource 对象设置为 UltraGrid 的 DataSource 属性后,您可以验证计数,如:
ultraGrid1.DisplayLayout.Bands.Count
希望这是您正在寻找的。
尝试使用基类UltraControlBase的PropertyChanged事件:
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
{
}
}