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

How not to insert in the Column ChooserWindow the columns that are hidden ?

Hi,

I have a datagrid that is first displayed with some hidden columns.
These columns are hidden according to some business calculation made before the grid is loaded and, we can say, they don't exist for the user.
So I would like the user can't see them in any way.
Unfortunately when the user shows the column ChooserWindow to configure what columns to show in his grid, also the initial hidden columns appear in the list on the form.
Is there any way not to insert these hidden columns in the list that appears in this form ?

Thank you in advance.

Silvio

7 Replies

SP Sowndaiyan Paulpandi Syncfusion Team January 18, 2016 01:53 PM UTC

Hi Silvio,

Thanks for contacting Syncfusion Support.

We have analyzed your query. In SfDataGrid, default ColumnChooser will be working based on hidden columns. So could you please share more details about your exact requirement of ColumnChooser on your application? It will be helpful for us to analyze further. 


Regards,

Sowndaiyan



SI Silvio January 18, 2016 04:11 PM UTC

I explain you better.

Is there any event on ChooserWindow that I can join to, where I could change the current columns contained in it?
I understand that by default this form shows all the current hidden columns of the datagrid.
But in this case I would like to exclude some columns from this form even if the are hidden
In practice, I don't want the user see them any way because, in some cases, it should be an error for him to be able to show them.
So, have you understood my question?
I would need a way to exclude some columns from this form even if they are hidden.


SP Sowndaiyan Paulpandi Syncfusion Team January 19, 2016 12:32 PM UTC

Hi Silvio,

In SfDataGrid ColumnChooser, we do not have the direct support to achieve your requirement. But you can achieve this by customizing the ColumnChooser in sample level. We have prepared a sample as per your requirement and you can download the same from the below location. In this sample we have created the Customized ColumnChooser class “
ColumnChooserExt” and OnApplyTemplate method  and added the hidden columns in ColumnChooser where you can modify this as per your requirement to include or exclude the columns.

Sample : http://www.syncfusion.com/downloads/support/forum/121690/ze/ColumnChooserDemo1229417084



Regards,

Sowndaiyan



SI Silvio January 3, 2017 03:10 PM UTC

Hi,

I have upgraded today to the new Syncfusion version and this example does not work yet.
If a drag a column from the grid to the column chooser window, it appear a red mouse cursor icon and I cannot yet move columns on it in order to hide them.
Have you any idea what can I do to solve this bug?
Thank you.

Silvio


JG Jai Ganesh S Syncfusion Team January 5, 2017 12:57 PM UTC

Hi Silvio, 
Sorry for the delay. We have modified the sample based on our source and please find the sample from the below location, 
public virtual Rect GetControlRect() 
        { 
            var point = this.TranslatePoint(new Point(0, 0), this.DataGrid); 
 
            var rect = new Rect(point.X, point.Y, this.ActualWidth, this.ActualHeight); 
            return rect; 
 
        } 
 
Regards, 
Jai Ganesh S 



SI Silvio January 5, 2017 02:40 PM UTC

Thank you Ganesh, perfect now !


JG Jai Ganesh S Syncfusion Team January 6, 2017 12:02 AM UTC

Hi Silvio,  
Thank you for the update. 
Please let us know if you need further assistance on this. 
Regards, 
Jai Ganesh S 


Loader.
Up arrow icon