Hi,
I have three table in my dataset. I want to show these tables as a part of Band in the my WinGrid.
Please Help me to achieve this.
If i use UltraDataSource and add bands throgh wizard then it is working.
Faiz Ahmad
If your DataSet has three DataTables, then each table will represent a separate band in WinGrid. If you want data from multiple tables to be shown in the same band, then you'll need to composite that data in some way - whether using a WinDataSource or by copying the data to a separate DataSet that uses a single table per band.
Thanks,
But.. Should we have to write some code for to show 2nd table as a child table of 1st like a treeview.
Please Help
That's a different question from the one I answered, I believe.
From your follow-up question, I'm assuming you want data from one table to show as "children" of data from another table, in a hierachical fashion. To accomplish this using a DataSet, make sure you have a DataRelation defined between your parent table and your chlid table. Be sure you set the DataMember of your grid (or of the BindingSource you bind to the grid) to the TableName of the DataTable you want to use as the "root."
Each table displays as a separate band. All the data in your parent table is one band, while all the data in the child table is a second band, and all the data in the grandchild table (since you mentioned having three DataTables in your DataSet) is a third band.
Hi Vince,
Done.. thanks for your help.
Still I am not able to achieve this. Please Check the below code that writing in page load to bind wingrid..
//New table
DataRow dr;
dt.Columns.Add(PID);
DataColumn Name = new DataColumn("Name");
dt.Columns.Add(Name);
dt.Columns.Add(Description);
DataColumn Price = new DataColumn("B");
dt.Columns.Add(Price);
dt.Columns.Add(C);
dr = dt.NewRow();
dt.Rows.Add(dr);
ds.Tables.Add(dt);
//New table 2
DataRow dr1;
dt1.Columns.Add(CID);
DataColumn Name1 = new DataColumn("Name1");
dt1.Columns.Add(Name1);
dt1.Columns.Add(Description1);
dr1 = dt1.NewRow();
dt1.Rows.Add(dr1);
ds.Tables.Add(dt1);
//Data Relation
dc1 = ds.Tables["DataTable"].Columns["PID"];
DataRelation drel;
this.gridRowProperties.DataSource = ds;
------------------------------------------------------
Also the below code i am wring in InitializeLayout to Hide the columns.
e.Layout.Bands[1].Columns["PID"].Hidden = true;
But for the second line , it is giving exception of index out of range.
Please help.