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
270
Using groups to create multi column headings
posted

I found an answer to this on your forum, but when I ran it, I got this error message: "Key not found  Parameter name: key"

Since all that I did was copy and paster this code into my module, I have no idea what the error is talking about...

UltraGridGroup group1 = this.ugManagers.DisplayLayout.Bands[0].Groups.Add( "group1" );

UltraGridGroup group2 = this.ugManagers.DisplayLayout.Bands[0].Groups.Add( "group2" );

ugManagers.DisplayLayout.Bands[0].Columns["Column1"].Group = group1;

ugManagers.DisplayLayout.Bands[0].Columns["Column2"].Group = group2;

ugManagers.DisplayLayout.Bands[0].Columns["Column3"].Group = group2;

 

So, let's start this over for my particular situation and we can probably get it to work.

I have a datagrid with an interesting set of headings.  They will look like this:

                    Topic 1                                                          Topic 2

sub-head-1    sub-head-2    sub-head-3           sub-head-1    sub-head-2    sub-head-3             <--- as indicated, the sub-head-1 thru 3 are repeated twice.

d1   d2   d3   d4   d5   d6   d7   d8   d9           d10  d11  d12   d13  d14 d14   d16  d7  d18        <--- data from a SQL query

 

I understand that you can use Groups to setup a two-heading situation (that's what I was trying to do with the above code snippet), but that for more than two you need to do something else.

I need a lot of guidance to get this to fruition...

Thanks in advance,

Paul

Parents
No Data
Reply
  • 71886
    Offline posted

    Hello Paul and welcome to our forums!

    You should replace group1 and group2 with Topic 1 and Topic 2. Also your columns are named sub-head-1 and so on and not Column 1, Column 2.

    If you replace these keys you should be able to get this to work fine.

     

Children