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.

Merge identical cells in a DataBoundGrid

Thread ID:

Created:

Updated:

Platform:

Replies:

78546 Dec 17,2008 02:10 PM Dec 24,2008 07:06 AM Windows Forms 6
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On December 17, 2008 02:10 PM

Hi,

I'm trying to show hierarchical data in a multi-record style, rather than the expanded tree style.
-----------------------------------
parent1 || son1 specific details
master || ----------------------
details || son2 specific details
-----------------------------------
parent2 || son1 specific details
master || ----------------------
details || son2 specific details
-----------------------------------

I have hierarchical data I represent as a single dataSource, where I'm using a view that contains for each record all the Master details and the specific details.
The data is sorted by the master's columns,
and in this way all the details under the same master are visually grouped.

Instead of having the Master's values repeated in each record group, I want it to Merge all the identical cells.

How can it be done through the code without having to go through the records one by one and asking if the cell's value matches the value of the cell above?

Thanks,
- Miriam.


Nisha Arockiya A [Syncfusion]
Replied On December 18, 2008 05:36 AM

Hi Miriam,

Thanks for your interest in Syncfusion Products.

I have prepared a sample of multi-row record GDBG (each record consumes 9 rows in the grid).
Please refer to it in the sample location.
http://websamples.syncfusion.com//samples/Grid.Windows/Development/GridMultiRowRecord_F78546.zip

Please let me know any further assistance.

Regards,
Nisha


Nisha Arockiya A [Syncfusion]
Replied On December 18, 2008 05:42 AM

Hi again Miriam,

You can also refer to our shipped browser sample in the following path.

..\\My Documents\Syncfusion\EssentialStudio\6.x.x.x\Windows\Grid.Windows\Samples\x.x[FrameWork]\DataBound\MultiRowRecord

Please let me know if this helps.

Regards,
Nisha


Administrator [Syncfusion]
Replied On December 18, 2008 10:10 AM

Hi Nisha,

Thanks for your reply, but this is not what I asked for.
I am not looking to show the same record on different lines.

assuming we have one table with 5 columns :
1.Family_name, 2.Father_name, 3.Mother_Name, 4.Child_Name, 5. Child_Age

If I sort the table by column's 1,2,3 I will get all the children under the same family grouped visually.
Columns 1,2,3 are the same for all the children in the same family. [See attached Sample 1].
I would like the results to bind to the grid without repeating the family's info.[See attached Sample 2].

I don't want to add hierarchy to the table, because then I would get a tree view that takes too much horizontal space. [See attached Sample 3].

Can you please help me out?
thanks in advance,
- Miriam.



GridHelpSamples_2487193.zip

Nisha Arockiya A [Syncfusion]
Replied On December 19, 2008 07:11 AM

Hi Miriam,

Thanks for the updates.

You can refer to a browser sample that will give you an idea on implementing multi-row-record.

..\\My Documents\Syncfusion\EssentialStudio\6.x.x.x\Windows\Grid.Grouping.Windows\Samples\3.5\FeaturedSamples\EmployeeView\cs

Please try and let me know if this helps.

Regards,
Nisha


Administrator [Syncfusion]
Replied On December 22, 2008 06:27 AM

Hi Nisha,

Once again, I'm NOT looking for implementing multi-row-record.

I am looking to implement a parent-children record.
Please take a deeper look at the sample I sent you in the previous message I posted.

I want to show for each parent record a few child records, but I don't want it to look like a list of the parent records that each record expands to show the children.
I want the first columns to show the parent details, and then in the next columns show the children, exactly as I described in the attachment I've sent you previously.

Please help!
Thanks,
- Miriam.


Nisha Arockiya A [Syncfusion]
Replied On December 24, 2008 07:06 AM

Hi Miriam,

Thanks for your updates.

To sort the merged cells correctly, you have to handle QueryCoveredRange event. Please refer to the following code snippet.

void TableModel_QueryCoveredRange(object sender, GridQueryCoveredRangeEventArgs e)
{
Element element = this.gridGroupingControl1.TableModel.GetDisplayElementAt(e.RowIndex);

if (element != null && element.Kind == DisplayElementKind.Record && e.ColIndex == 2)
{
Record rec = element.GetRecord();
if (rec.GetSourceIndex() == 0)
{
e.Range = GridRangeInfo.Cells(e.RowIndex, e.ColIndex, e.RowIndex + 3, e.ColIndex);
e.Handled = true;
}
}
}

The attached sample demonstrates this completely.
http://websamples.syncfusion.com//samples/Grid.Windows/Development/GGC_Merge_78546.zip

Please let me know any further assiatance.

Regards,
Nisha


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.

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.

;