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

Change text in GridGroupingControl

I am using the GridGroupingControl to display readonly data and have a couple of question that I can not find the answer for in the documentation. Is it possible to change the text "Drag a column header here to group by that column" and maybe also to hide the text containing the name of the dataset visible in the drop area? Is it possible to print the content of a grid in the way the user has arranged it? How should I do to remove/hide the insert row?

6 Replies

AD Administrator Syncfusion Team June 11, 2004 02:37 PM UTC

Hi Jonas, the text "Drag a column header here to group by that column" is hard-coded but there is a little trick to change it: Try handling groupingControl.GridGroupDropArea.PrepareViewStyleInfo. Check for e.Style.Text to replace the old text with new text when the text is "Drag ..." We will provide a property for that in future so that you can more easily replace that text. Printing could be done using GridPrintDocument, for example: GridControlBase grid = groupingGrid.TableControl; if (grid != null) { try { GridPrintDocument pd = new GridPrintDocument(grid); //Assumes the default printer if (PrinterSettings.storedPageSettings != null) { pd.DefaultPageSettings = PrinterSettings.storedPageSettings ; } PrintDialog dlg = new PrintDialog() ; dlg.Document = pd; dlg.AllowSelection = true; dlg.AllowSomePages = true; DialogResult result = dlg.ShowDialog(); if (result == DialogResult.OK) { pd.Print(); } } catch(Exception ex) { MessageBox.Show("An error occurred attempting to preview the file to print - " + ex.Message); } } To hide the insert row, you can groupingGrid.TableDescriptor.AllowNew = false; Thanks for your interest. Stefan


JO Jonas June 14, 2004 08:10 AM UTC

Thanks a lot! All of the three suggested solutions worked well and solved my issues.


GC Grace Chao December 28, 2007 12:01 AM UTC

My co-worker has an alternative solution for question 1: grid.TableDescriptor.Name = string.Empty; instead of handling event.



JJ Jisha Joy Syncfusion Team December 31, 2007 05:10 AM UTC

Hi Grace,

Thank you for your suggestion.

Regards,
Jisha



KB Karsten Brocksieper July 3, 2008 09:43 AM UTC

Hello,

in this thread Stefan has told about a property to change the text "Drag a column..."


We will provide a property for that in future so that you can more easily replace that text.


I would like to ask if this is implemented in the meantime.

Regards,
Karsten





AD Administrator Syncfusion Team November 13, 2008 03:27 AM UTC



>I am using the GridGroupingControl to display readonly data and have a couple of question that I can not find the answer for in the documentation.
>
>Is it possible to change the text "Drag a column header here to group by that column" and maybe also to hide the text containing the name of the dataset visible in the drop area?
>
>Is it possible to print the content of a grid in the way the user has arranged it?
>
>How should I do to remove/hide the insert row?


Loader.
Live Chat Icon For mobile
Up arrow icon