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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Custom column header cells with multiple controls

Thread ID:





30865 Jun 24,2005 08:30 PM UTC Jun 28,2005 03:06 PM UTC WinForms 7
Tags: GridControl
John Hawksley
Asked On June 24, 2005 08:30 PM UTC

I want to do something complicated with my header cells. Namely, they should each display three items of data on separate lines within the cell. The first is the header name, followed by a description (which the user should be able to rename at will by right clicking or what not), and the type (which should be expressed as a dropdown box for the user to change). I don''t really know how to begin at making custom cells or header cells that will allow me to do something like this. What should I study?

Administrator [Syncfusion]
Replied On June 24, 2005 10:31 PM UTC

You can probably get this look by adding extra header rows without having to derive any custom cell types. Here is a little sample. http://www.syncfusion.com/Support/user/uploads/GDBG_3HeaderRows_f9512ac1.zip

John Hawksley
Replied On June 27, 2005 05:07 PM UTC

Works fine, thanks.

John Hawksley
Replied On June 27, 2005 09:14 PM UTC

Is it possible to make cells unhighlightable? Try selecting one or a couple of the yellow header cells in the example, it also does a weird thing where it selects those as well as cells in the first row. I''d rather it be such that they can''t be highlight-selected at all. Thanks for the help

Administrator [Syncfusion]
Replied On June 27, 2005 09:43 PM UTC

Try handling teh grid.Model.SelectionsChanging event and cancel it if the range intersects cells you do not want selected.
this.gridDataBoundGrid1.Model.SelectionChanging += new GridSelectionChangingEventHandler(Model_SelectionChanging);

private void Model_SelectionChanging(object sender, GridSelectionChangingEventArgs e)
	if(e.Range.IntersectsWith(GridRangeInfo.Rows(1, 2)))
		e.Cancel = true;

John Hawksley
Replied On June 28, 2005 02:45 PM UTC

Thanks, Clay. I used: private void Model_SelectionChanging(object sender, GridSelectionChangingEventArgs e) { e.Range = e.Range.IntersectRange(GridRangeInfo.Rows(3, dataGrid.Model.RowCount)); } The other way, I''m no longer allowed to use the column header to select the full column. What this does, which I would have wanted anyway, is cause a header selection only to select the data under that column, and not the other 2 header rows.

John Hawksley
Replied On June 28, 2005 02:50 PM UTC

On second thought, this doesn''t exactly solve the initial problem, since I can still drag from one of the headers and select data down below.

John Hawksley
Replied On June 28, 2005 03:06 PM UTC

I hacked it up so it works. Thanks for the help.


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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