I have a WinGrid that I want two bands associated to it.
So I attached a datasource but I can't really define the relationship in the datasource. When I attached a datasource with a bogus relationship to create the band,
it wouldn't add correctly.
DriverGrid.ActiveRow = row;
UltraGridRow PassengerRow = DriverGrid.DisplayLayout.Bands[1].AddNew();
I thought I was adding a row under the activerow but in reality it added under all childbands[0] rows. I only want to add a row under the current active row (probably based on my bogus relationship).
How do I resolve?
Alternatively if i could define the childband at runtime easily and add data - that could work as well. I would prefere to get the AddNew working correctly however.
Hello,
I am glad that your issue is resolved. Please let me know if you need any additional assistance.
Thank you for using Infragistics components.
Figured it out - Grid treats addrow as adding to dataset / source and thereby using the relation no matter what. I always thought it would add to the Active Row.
The secret is to create a bunch of fake fields in the second band and then create a valid relationship based on the fake fields.
Thank you for contacting Infragistics Developer support.
I will need more information about your scenario. What do you mean by “bogus relationship”? What exactly is your data source and why you can’t create relationships? I tried to reproduce the behavior using a dataset as the data source and using “.DisplayLayout.Bands[1].AddNew();” adds in the child band under the active row. So the issue must be with the relationships of the bands. I have attached my sample, please modify it so it reproduces your issue or send me a sample yourself and I will be glad to help you.
I am looking forward to your reply.