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
660
New Columns in Band1 is not getting hide whereas Band0 new columns were hide properly.
posted

Hi All,

Issue 1 : I have a multi band grid and the layout for both bands were set in the design time itself.

Datarelation established between the parent table and child table in the Dataset, while assigning the Dataset using setdatabinding with hidenewcolumns as true.

Band[0] new columsn were hiding properly where as the Band[1] new columns were still showing.

 

Issue 2: If I added a new row to the child table of the dataset, and it doesnt have any matching link in the parent table as well, how to create a new row in the parent and establish the link, and i want  it to get displayed as well.

please do the needful.

With Thanks & Regards

Amjath

Parents
  • 23930
    Offline posted

    Hello Amjath,

     

    About your first question, it seems that the property you are looking for is called NewColumnLoadStyle and it is part of the DisplayLayout object of the grid. Add the following line and the grid should be working correctly:

                ultraGrid1.DisplayLayout.NewColumnLoadStyle = Infragistics.Win.UltraWinGrid.NewColumnLoadStyle.Hide;

    As for your second question, you need to first add the row in the parent table and then add rows in the child table referencing the row in the parent table. If you are using UltraDataSource you can do that by adding the following lines:

     

    // the values have to be of the same type as the datatypes of the columns

    ultraDataSource1.Rows.Add(new Object[] { 2, "George" , "Clifton Str"});

                ultraDataSource1.Rows[2].GetChildRows(ultraDataSource1.Band.

                    ChildBands[NameOfChildBand]).Add(new Object[] { 3, 2, "House", 80000 });

     

    And if you are using a DataSet you need to add this:

     

    ds.Tables[NameOfParentBand].Rows.Add(new Object[] { 2, "George" , "Clifton Str “});

    ds.Tables[NameOfChildBand].Rows.Add(new Object[] { 3, 2, "House", 80000 });

     

    If you have any additional questions please don’t hesitate to ask me.

Reply Children