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
310
Create Child bands using UltraDataSource
posted

I am creating a Log Grid where I have a set of rows in the Band[0] and for each row in this band there is a ChildBand with additional rows.

The code is the same of your tutorials ...

                    _gds = new UltraDataSource();

                    _gds.Band.Columns.Add("Id", typeof (Guid));

                    _gds.Band.Columns.Add("Type", typeof (string));

                    _gds.Band.Columns.Add("CreatedDate", typeof (DateTime));

                    _gds.Band.Columns.Add("CreatedUser", typeof (string));

                    _gds.Band.Columns.Add("PayoutCaption", typeof (string));

                    _gds.Band.Columns.Add("Message", typeof (string));

                    _gds.Band.ChildBands.Add("DetailBand").Columns.Add("Data", typeof (string));

 

                    foreach (MYLOG vo in _items)

                    {

                        UltraDataRow row = _gds.Rows.Add();

                        row["Id"] = vo.Id;

                        row["Type"] = vo.Type.ToString();

                        row["CreatedDate"] = vo.CreatedDate;

                        row["CreatedUser"] = vo.CreatedUser;

                        row["PayoutCaption"] = vo.PayoutCaption;

                        row["Message"] = vo.Message;

 

                        if (!string.IsNullOrEmpty(vo.Data))

                        {

                            var childRows = row.GetChildRows("DetailBand").Add();

                            childRows["Data"] = vo.Data;

                        }

                    }

I have also write the LayoutInitialize and InitializeRow in order to format the Grid appearence.
Well, I don't see at all the ChildBand but it's in the UltraDataSource ...
What am I missing?