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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Hide ou Change Position of a Column

Thread ID:

Created:

Updated:

Platform:

Replies:

118683 Mar 31,2015 07:51 PM UTC Apr 2,2015 04:30 AM UTC ASP.NET Web Forms 4
loading
Tags: Gantt
Henrique
Asked On March 31, 2015 07:51 PM UTC

Hi,

I need to show only the columns "Task Name" and "End Date" in Tree Grid.

It´s possible to hide some columns or change order of position?
ID, TaskName, End Date, Start Date, ...

Regards

Henrique


John Rajaram [Syncfusion]
Replied On April 1, 2015 09:54 AM UTC

Hi Marcelo,

Thanks for using Syncfusion products.

Query 1:

I need to show only the columns "Task Name" and "End Date" in Tree Grid.

It´s possible to hide some columns.

Solution:

In Gantt control, we can display the "Task Name" and "End Date" columns alone at TreeGrid part using the “Load” client side event.

Please refer the below code snippets for more details.

Code snippet:

<body>

<form id="form1" runat="server"

<ej:Gantt ID="Gantt" runat="server"


//...


Load="Load">


//...


</ej:Gantt>


<script>

function Load(args) {

var columns = this.getColumns(),

length = columns.length;

for (var i = (length-1); i >= 0 ; i--) {

if (columns[i].field == "taskId" || columns[i].field == "startDate" || columns[i].field == "status") {

columns.splice(i, 1);

}

}

}


</script>

</form>

</body>



We have also prepared a sample based on this. Please find the sample in the following location.

Sample: http://www.syncfusion.com/downloads/support/forum/118683/TwoColumnGantt375453174.zip

We would also like to let you know that, we have already logged and implemented the feature “Column chooser” for hiding and displaying some columns at TreeGrid part of Gantt chart dynamically.

A support incident has been created under your account to track the status of this requirement. Please log on to our support website to check for further updates.

https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents


Query 2:

change order of position?

ID, TaskName, End Date, Start Date, ...

Solution:

In Gantt control, we can change the order position of the TreeGrid columns. Please refer the below code snippets for positioning the “End Date” column before the “Start Date” column.

Code snippet:

<body>

<form id="form1" runat="server"

<ej:Gantt ID="Gantt" runat="server"


//...


Load="Load">


//...


</ej:Gantt>


<script>

function Load(args) {

var columns = this.getColumns(),

length = columns.length;

for (var i = 0; i < length; i++) {

if (columns[i].field == "endDate") {

var endDateColumn = columns.splice(i, 1);

break;

}

}

for (var i = 0; i < length; i++) {

if (columns[i].field == "startDate") {

columns.splice(i, 0, endDateColumn[0]);

break;

}

}

}

</script>

</form>

</body>


We have also prepared a sample based on this. Please find the sample in the following location.

Sample: http://www.syncfusion.com/downloads/support/forum/118683/ColumnOrderChange-325323468.zip

Please let us know if you require further assistance on this.
Regards,
John R


Henrique
Replied On April 1, 2015 10:24 AM UTC

Simply amazing!!!!

Thank you very much!!

Hugs

John Rajaram [Syncfusion]
Replied On April 2, 2015 04:30 AM UTC

Hi Marcelo,

Thanks for the update.

Please let us know if you require further assistance on this.
Regards,
John R


John Rajaram [Syncfusion]
Replied On April 2, 2015 04:30 AM UTC

Hi Marcelo,

Thanks for the update.

Please let us know if you require further assistance on this.
Regards,
John R


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;