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
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.
Thanks Dimitar, Issue 1 is solved now, will check you solution for Issue 2 and will update shortly.
Thanks again
Hi Dimitar,
for issue 2, which event should I use to add the row in the parent datatable.
Saying a case If a user edits the DataLink value, then i need to create a row in the parent table and then recreate the link, for this which event should i use.
Is BeforeCellUpadte on the Band1 will be fine ??
please advise
With Thanks
Hello, Amjath
I am just checking about the progress of your issue. Let me know If you need my further assistance?
Thank you for using Infragistics Components.
Hi Mitko,
Thanks a lot for you help..
now its working fine.