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
close icon

Custom column header cells with multiple controls

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?

7 Replies

AD Administrator Syncfusion Team 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


JH John Hawksley June 27, 2005 05:07 PM UTC

Works fine, thanks.


JH John Hawksley 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


AD Administrator Syncfusion Team 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;
}


JH John Hawksley 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.


JH John Hawksley 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.


JH John Hawksley June 28, 2005 03:06 PM UTC

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

Loader.
Live Chat Icon For mobile
Up arrow icon