Text in GroupDropArea

Hello,

I would like to ask if there is any possibility to change 'Drag a column header here to group by that column.' text in GroupDropArea?



3 Replies

AA Arulraj A Syncfusion Team October 12, 2018 04:28 AM UTC

Hi Dariusz, 

Thanks for using Syncfusion product. 

To customize the GroupDropArea default text, you could use the PrepareViewStyleInfo event. Please refer the following code example and the UG link, 

Code example 
this.gridGroupingControl1.GridGroupDropArea.PrepareViewStyleInfo += GridGroupDropArea_PrepareViewStyleInfo; 
 
private void GridGroupDropArea_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e) 
{ 
    if (e.Style.Text.StartsWith("Drag a")) 
    { 
        e.Style.Text = "Drag and Drop Parent Table Column headers"; 
        e.Style.Font.Italic = true; 
    } 
} 


Arulraj A 



DZ Dariusz Zaloga October 12, 2018 11:22 AM UTC

Thanks for your help - solution works pretty good but I couldn't fit cell size to new text.

Fortunately, I found another solution.
All I needed to do was change DragColumnHeaderText property value in GridGroupDropArea.


DY Deivaselvan Y Syncfusion Team October 15, 2018 12:00 PM UTC

Hi Dariusz, 
 
Thanks for the update. 
 
As you updated, the cell size can be changed based on the new text by setting the DragColumnHeaderText property of GridGroupDropArea as your new text. Please refer to the below code, 
 
Code example 
 
//To set the DragColumnHeaderText property. 
gridGroupingControl1.GridGroupDropArea.DragColumnHeaderText = "New Text"; 
 
Regards, 
Deivaselvan 


Loader.
Up arrow icon