Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
217
How to add row in childBand thorugh Coding
posted

Hi,

 Actually i am using UltraGrid and place two bands one is parent and another is child and fill the data through coding.

But I am not able to add the rows in child band. can u plz guide me how to do  that?

i am using following Code:-

For Each Obj As Schedule In sc

UltraDataSource1.Rows.Add(New Object() {CType(Obj.SName, String), _

CType("aa", String), _

CType("vv", String)})

Dim rs As List(Of String) = ReportScheduleDataStore.GetInstance.FindAllReportNamesBySchID(Obj.SId)

For Each r As String In rs

Dim u As Infragistics.Win.UltraWinDataSource.UltraDataBand = UltraDataSource1.Band.ChildBands(0)

u.DataSource.Rows.Add(New Object() {CType(r, String)})

 

Next

Next

 

Thanks,

 Waiting ur reply

  • 469350
    Offline posted

    From the code here, it looks like you are trying to add rows to the child band directly. 

    UltraDataSource does not calculate the parent-child relations on the fly like a DataSource does. So when you add a child row, you have to add the child row to a parent row - you can't add it to the child band, because then it would not know what parent row it was under.

    So a very simple example would look something like this:

            Dim udr As UltraDataRow = Me.UltraDataSource1.Rows.Add(New Object() {"This is a parent row"})
            udr.GetChildRows("name of child band").Add(New Object() {"This is a child row"})