Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
60
Help me change name column of XamGantt
posted

Hi Infragictics,

Can you give me a simple project have a change name column about XamGantt Chart.

Example:

change Id = Project ID

change Name = Task Name

change Start = Start Time

I read more ducoment and reseach but can see it, i think it can not  change.

Please quickly for me.

Thanks and best regard

  • 34430
    Offline posted

    Hello Phong,

    If you are using a ListBackedProject ViewProvider for your XamGantt, I would recommend that you see the following article in our online documentation: http://help.infragistics.com/Help/Doc/WPF/2016.1/CLR4.0/html/xamGantt_Code_Example_Changing_xamGantt_Column_Set.html.

    In the above article's code sample, you will notice quite a few ProjectColumns added to the ProjectTable.Columns collection. Each of these ProjectColumn elements has a HeaderText property that you can set to change the name of the header.

    There is an alternative way to do this in case you are not using a ListBackedProject ViewProvider, but it is a bit more complex. This alternative way is to get the ProjectTableGrid element that makes up your XamGantt's grid portion. You can do this by using the Infragistics.Windows.Utilities class and its GetDescendantFromType method. The call to this method would look like this, where myGantt is the XamGantt:

    ProjectTableGrid ptg = Utilities.GetDescendantFromType(myGantt, typeof(ProjectTableGrid), false) as ProjectTableGrid;

    Once you have obtained the ProjectTableGrid, you can loop through its Columns collection and find the columns that you wish to change the header of. With the requirements that you have mentioned above, these columns should have their HeaderText property set to Id, Name, and Start, respectively. Changing the HeaderText property of these columns will allow you to show the appropriate header text that you wish to show.

    I hope this helps you. Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew
    Associate Developer