Hello,
I add some Group field in code behind, and use the How to to hide column client-side.
For BoundField everything works fine. But for GroupField no ... There is a little layout change clicking on the check box but the group field does not disappear.
Is there something special to do to hide group field, client side ?
Thank's !
thank's for the answer.
I will try this solution as soon as possible.
Best regards,
Hardis
Hello Hardis,
I have received some further information concerning this matter from our development team. The HeaderLayoutColumn has a set_hidden function on the client side which will hide the header and the columns that are under it. For determining if a HeaderColumnLayout is a GroupField as well as which column it is the HeaderLayoutColumn has the get_isGroupField and get_key methods. The following is an example of how you could use this to hide the columns:
var grid = $find("<%=WebDataGrid1.ClientID %>"); var headerColsLayout = grid.get_headerColumnsLayout(); if (headerColsLayout[0].get_isGroupField()) { if (headerColsLayout[0].get_key() == "EmployeeInfo") { headerColsLayout[0].set_hidden(true); } }
Please let me know if you have any questions concerning this matter.
Sincerely,Mike P.Developer Support EngineerInfragistics, Inc.www.infragistics.com
Thank you for the update. You can achieve this by going through the HeaderColumnsLayout it contains the headers of the gird and each header contains the columns that are covered by that header. You would then loop through the columns it contains and hide them. For example:
var grid = $find("<%=WebDataGrid1.ClientID %>"); var headerColsLayout = grid.get_headerColumnsLayout(); var count = headerColsLayout[0].get_columns().length; for (var i = 0; i < count; i++) { headerColsLayout[0].get_columns()[i].set_hidden(true); }
I am also working with our development team to see if there is an easier approach to hiding the group field and the columns contained inside of them. I will give you a progress update concerning this matter by tomorrow.
I thing there is a missunderstand. I am talking about multi header on WebDataGrid using GroupField.
I am trying to combine two features : hidding client side column and more hidding client side multi column header.
http://samples.infragistics.com/aspnet/Samples/WebDataGrid/Display/Multi-Column-Headers/Default.aspx?cn=data-grid&sid=c97530da-4391-4912-9d8f-ce860d1860fe
http://samples.infragistics.com/aspnet/Samples/WebDataGrid/Organization/Column-Hiding-Client-Side/Default.aspx?cn=data-grid&sid=c9ae8b2f-a309-4c2c-b3b0-81c6910b90c9
So I've implemented first the column hidding feature. Everything works fine. Then I 've tried to add groupFiled to group columns on header and so I got in the check box area, columns and groupField. Here is the javascript code below :
grid.get_columns().get_column(index).set_hidden(obj.checked);This code does not work for a GroupField. There is a little change but GroupField and containedcolumn are not hidden.I hope this is more clear for you. Thank's for your help.Regards,Hardis
Hello CDS HARDIS,
Thank you for your patience. I have been looking into this matter and have been unable to find a way to hide the GroupByBox on the client side. Can you please provide me with some details about what you are trying to achieve so I can get a better grasp at what steps should be taken. Why does the GroupByBox need to be hidden on the client? Is the end user going to be able to drag and drop columns to the GroupByBox? You mention a checkbox can you please clarify where you see this?