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
364
Band Datamember
posted
I have a dataset which 2 datatables (LEVEL_0 and LEVEL_1) and the datatable have a datarelation between them. I then bind the LEVEL_0 table to the grid i.e

grd.DataSource = ds.Tables["LEVEL_0"];

The resultant grid has 2 bands as expected but both have a datamember and key as LEVEL_0. Why does this happen and how do I get round it? I would expect that one band would be LEVEL_0 and the other LEVEL_1...... 

If I add a new table (LEVEL_2) and add a relationship with LEVEL_1 and rebind then I get 3 bands (2 called  LEVEL_0 and another LEVEL_2). So LEVEL_2 works as expected. 

I am using v5.3 of the grid.

 Thanks Nish

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    Hi Nish,

        As far as I know, it's not possible for two bands in the same grid to have the same key. So I don't see how this can be happening. How do you know both bands have the same key? How are you getting the DataMember of the band?

        It looks to me like you should not be binding the grid directly to the table, anyway. You should probably be binding to the DataSet.

        grd.SetDataBinding(ds, "LEVEL_0"); 

Children