Reputation: 5631
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)
Upvotes: 0
Views: 2375
Reputation: 1817
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
{
}
}
Upvotes: 0
Reputation: 1042
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.
Upvotes: 1