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
275
WinGrid with expandable cell
posted

Hello,
i would like create a WinGrid like under: 

the first cell contains the name of customr
the second cell contains the second name of customer
the third cell contains the phone number of customer
the fourth cell contains the sum of recharges made in last month
 When i click on cell, i would like see all single recharges made with the data time in cell TYPE

Suppose i have this dataset from database

A1,B1,C1,500,10 Ago 2011
A1,B1,C1,500,11 Ago 2011
A2,B2,C2,250,08 Ago 2011
A2,B3,C2,250,20 Ago 2011
A3,B3,C3,500,07 Ago 2011

I would like see first:
A1,B1,C1,[+]1000
A2,B2,C2,[+]500
A3,B3,C3,[+]500

then when i click on fourth cell of first row i would see:

A1,B1,C1,[+]1000
                  [v]500,10 Ago 2011
                  [v]500,20 Ago 2011
A2,B2,C2,[+]500
A3,B3,C3,[+]500

 

 

It is possible obtain this behaviour 

...thank you in advance :)

 

  • 469350
    Offline posted

    Hi,

    Which part of this, in particular, are you having trouble with?

    It looks like all you have to do is bind the grid to a hierarchical set of data. You could use an UltraDataSource or a DataSet or even a couple of BindingList<T> objects.

    The only thing unusual about what you have here is the expansion indicators inside the cell. The grid does not have that feature built-in. But you could probably achieve it in the grid pretty easily using a CreationFilter.

    Another option would be to use UltraWinTree in OutlookExpress style. That style of the tree places the expansion indicators inside a cell, just like OutlookExpress.

  • 5520
    posted

    i don't think there is a way to do it on the cell level although you can do it on the row level so the (+) will be at the beginning of the row.

    you just need to fill the data in a dataset containing 2 datatables with the right relationship and set it as datasource