Hello,
I want to create the data grid using win grid with one table.
I have Employee table with EMployeeId, EmployeeName,BasicSalary.
I want to display these details in the grid.
EmployeeId and EmployeeName in Band[0] and BasicSalary in Band[1] which is the child band.
I am using self join query for to retrieve the details i.e.
FROM [Employee] t1 FULL OUTER JOIN
How can I design the data grid and bind this data table to grid.
Please help by providing the source code for this.
We are using C#.Net for our Windows application.
Again, I don't profess to be an expert(not an Infragistics employee, was just offering some help as I had dealt with a similar situation) with this but am guessing your datasets aren't set-up correctly. Can you send the code? If you refer to my example, I set up 2 database views from the same table. I then have 2 datasets that are added in to two tables. The two tables are then connected as a DataRelation. This automatically creates the parent band (0) and the child band (1). By binding them in the code, I am able to work with the properties of both bands easily. But, maybe if you send the code, I can take a look and see if something looks off.
Thanks for the reply.
I have created Grid with Band[0] and Band[1] as child band.
I have taken two tables in the data set and taken details from single data table in to this data set. The data set is showing with the all the details in to 2 tables.
But I am getting the following error whilt binding the data to the Wingrid.
""Child list for field Band 0 cannot be created."
Please help me in resolveing this issue.
Hi,
I am certainly no expert with Ultragrids, but I just created one with the same kind of situation - all information comes from the same table but I am displaying some of the "less important" information in a child band. In order to do this, I created 2 views in SQL Server and then wrote this code (this is VB.net). Please note that in my eaxmple, the 2 views are linked by "materialNumber":
Dim SecondDataTable As New DataTable()
Dim MainTableAdapt As New SqlDataAdapter(vw_materialsmain1, CONNSTRING)
Dim MainTable As New DataTable("MainMaterials")
MainTableAdapt.Fill(MainTable)
SecondTableAdapt.Fill(SecondDataTable)
c_dataSet_MaterialsMain.Tables.Add(MainTable)
c_dataSet_MaterialsMain.Tables.Add(SecondDataTable)
, MainTable.Columns("materialNumber") _
c_dataSet_MaterialsMain.Relations.Add(SecondaryMaterials)
UltraGrid2.DataSource = c_dataSet_MaterialsMain
UltraGrid2.DataBind()
==============================================================================
This is working very well for me.
Hope this helps!
Julie
In order to have 2 bands in the grid, your data source needs two bands. I'm not sure since I've never tried to break up a single table like this, but my guess is you are going to need to use two tables in your DataSet. The first table will contain the EmployeeId and EmployeeName. The second table would be the EmployeeId and BasicSalary. Then you add a relationship to the DataSet to relate the two tables by EmployeeId.