Column Header Row Length

Hi, I would like to implement the Syncfusion GridControl in a Windows Explorer style. The Windows ListView control does this as well...I would like the column header to extend all the way to the right side of the GridControl. I have attached an image to show what I''m trying to do. Is the Syncfusion GridControl capable of this? By the way, I''m using Syncfusion version 4.1.0.50...Thanks,

grid_header.zip

7 Replies

AD Administrator Syncfusion Team June 2, 2006 09:25 AM UTC

Hi Mitch, I have created the sample as per your requirement. Please refer to the attached sample for more details. Let me know if this helps. Here is a sample. http://www.syncfusion.com/Support/user/uploads/WindowExplorer_53056e49.zip Thanks for choosing Syncfusion Products. Regards, Haneef


MT Mitch Todd June 2, 2006 09:44 AM UTC

Hey Haneef, Solution looks good. I actually implemented a similar solution, but as you see, in a ListView and in Windows Explorer, mousing over the extended part of the header does not give the same mouseover effect as the other "real" columns. I tried subscribing to the CellMouseHoverEnter event and cancelling it for that cell, but was unsuccessful. Is there another way I can achieve this? Thanks again,


AD Administrator Syncfusion Team June 2, 2006 10:43 AM UTC

Hi Mitch, You need to cancel the extra header drawing in grid using grid''s DrawCell event andthen implement your own drawing in a cell. Here is a code snippet private void gridControl1_DrawCell(object sender, Syncfusion.Windows.Forms.Grid.GridDrawCellEventArgs e) { if(e.RowIndex == 0 && e.ColIndex == 4) { e.Style.Enabled = true; System.Drawing.Drawing2D.LinearGradientBrush brush = new System.Drawing.Drawing2D.LinearGradientBrush(e.Bounds, SystemColors.Control,SystemColors.ControlLightLight, System.Drawing.Drawing2D.LinearGradientMode.Vertical); e.Graphics.FillRectangle( brush,e.Bounds); Rectangle rect = e.Bounds; ControlPaint.DrawBorder3D(e.Graphics,rect,Border3DStyle.RaisedInner ); e.Cancel = true; } } //For cancel the activating event in extra header cell private void gridControl1_CurrentCellActivating(object sender, Syncfusion.Windows.Forms.Grid.GridCurrentCellActivatingEventArgs e) { if(e.RowIndex == 0 && e.ColIndex == 4) { e.Cancel = true; } } Please let me know if this helps. Best Regards, Haneef


MT Mitch Todd June 2, 2006 11:22 AM UTC

Thanks Haneef, that worked perfectly! Now I just need to work on getting the same border style for that cell as the rest of the header. Thanks!


AD Administrator Syncfusion Team June 2, 2006 12:47 PM UTC

Hi Mitch, Sorry for the inconvience caused. You need to set the DisplayEmptyColumns property to true. When you set the DisplayEmptyColumns property of the grid, Grid draws the empty column in a clientarea(it is a clientarea only). It doesn''''t add any column to the grid. Here is a code snippet. this.gridControl1.ColCount = 3; this.gridControl1.Model.Options.DisplayEmptyColumns = true; Here is a modified sample. http://www.syncfusion.com/Support/user/uploads/WindowExplorer_157cc493.zip Please let me know if this helps, Regards, Haneef


PB Pierre Brito replied to Mitch Todd February 19, 2018 06:11 PM UTC

Hey Haneef, Solution looks good. I actually implemented a similar solution, but as you see, in a ListView and in Windows Explorer, mousing over the extended part of the header does not give the same mouseover effect as the other "real" columns. I tried subscribing to the CellMouseHoverEnter event and cancelling it for that cell, but was unsuccessful. Is there another way I can achieve this? Thanks again,

Os gráficos do Syncfusion são ótimos para análise de dados.


AR Arulpriya Ramalingam Syncfusion Team February 20, 2018 04:41 AM UTC

Hi Pierre, 
 
Thanks for your feedback. 
 
Please let us know, if you have any other queries. 
 
Regards, 
Arulpriya 


Loader.
Up arrow icon