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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridDataBoundGrid - MultiHeader rows

Thread ID:

Created:

Updated:

Platform:

Replies:

48846 Sep 5,2006 01:19 PM UTC Sep 7,2006 01:13 PM UTC Windows Forms 4
loading
Tags: GridControl
Clive Hill
Asked On September 5, 2006 01:19 PM UTC

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

Administrator [Syncfusion]
Replied On 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.

Clive Hill
Replied On 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?

Administrator [Syncfusion]
Replied On 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

Clive Hill
Replied On September 7, 2006 01:13 PM UTC

Thanks Haneef, that works.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;