We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

GridDataBoundGrid - MultiHeader rows

Hi,

I''m trying to get multiple rows in my GDBG by following example:

Syncfusion\Essential Studio\4.2.0.37\Windows\Grid.Windows\Samples\DataBound\GDBGMultiHeader

However, despite setting the same properties (in GridSettings2 attached), and doing:

_dataGrid.Model.Rows.HeaderCount = 2;
_dataGrid.Model.Rows.FrozenCount = 2;

I can''t get the header section to change to have two rows. Getting a Cell to span cols using:

dataGrid.Model.CoveredRanges.Add(GridRangeInfo.Cells(0, 3, 0, 4));

does work however.

I''ve attached the code I am using to do this. Can someone suggest why this is not working?

The following line also causes an ArgumentOutOfRangeException:


_dataGrid[0, 3].Text = "Core";

As you can see I bind data to the grid first, so I''m not sure why I can''t set the text in this manner. Again, any suggestions?

MultiHeaderProblem.zip

4 Replies

AD Administrator Syncfusion Team September 5, 2006 06:12 PM UTC

Hi Vito,

Thanks for your sample. But I couldn''t run the sample here as it supporting dlls were not included and Spread_Data_Grid.xml was missing. I cut the GridSettings piece of code onto my sample and found it to be working. Can you modify the attached sample to reproduce the issue?
MultiHeaderGDBG.zip

Sorry for the inconvenience caused.

Best Regards,
Leo.


CH Clive Hill September 7, 2006 07:59 AM UTC

I managed to get this working now. I was building the grid up from a config file and builder classes, but I now use the grid designer tool. There must have been a setting somewhere preventing it from working.

One more question though:

The GidDataBoundGridColumn''s header text automatically appears in the first row of the header''s cell. I tried over writing them by doing:

_dataGrid.Model.CoveredRanges.Add(GridRangeInfo.Cells(0, 4, 0, 5));
_dataGrid[0, 4].Text = "Core";

But this just stretches the 3rd col''s header text to cover the 4th''s; not overwriting by "Core".

Is it possible to over write these values with some static text I can set?


AD Administrator Syncfusion Team September 7, 2006 10:13 AM UTC

Hi Vito,

Try this code snippet to change the HeaderText of the column in a grid.

this.grid.Binder.InternalColumns[3].HeaderText = "welcome";

Let me know if this helps.
Thanks,
Haneef


CH Clive Hill September 7, 2006 01:13 PM UTC

Thanks Haneef, that works.

Loader.
Live Chat Icon For mobile
Up arrow icon