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

Customized Table -> DataTemplate -> Bind whole Task Item

Thread ID:

Created:

Updated:

Platform:

Replies:

121383 Dec 8,2015 02:17 PM UTC Dec 9,2015 12:43 PM UTC WPF 3
loading
Tags: GanttControl
Kamil Kosek
Asked On December 8, 2015 02:17 PM UTC

Hi,
1. i´m trying to customize the GanttGrid as shown in your expample "Customized Table". The issue is, I need the whole bound task item (not only the 'CellBoundValue') in the converter because I need to calculate a value which is then representing the color. 
Is this possible?


2. Is it possible to change the appearance of the parent Tasks including the RowHeader?

thanks in advance,
Kamil Kosek

Rachel A [Syncfusion]
Replied On December 9, 2015 12:36 PM UTC

Hi Kamil,

Thanks for contacting Syncfusion support.

Query1:I need the whole bound task item (not only the 'CellBoundValue') in the converter because I need to calculate a value which is then representing the color. 

We are unable to get the task item in grid row CellItemTemplate. We can get the task item from note collection by corresponding row index and set the color for the row in QueryCellInfo event as in the below code example.

[C#]

        this.AssociatedObject.GanttGrid.InternalGrid.QueryCellInfo += InternalGrid_QueryCellInfo;

        void InternalGrid_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)

        {

            var allnodes = (sender as GridTreeControlImpl).Nodes;

            if (e.Cell.RowIndex == 5)

                e.Style.Background = Brushes.Red;            
        }



Query2: Is it possible to change the appearance of the parent Tasks including the RowHeader?

We can change the appearance of the parent task in the following ways.

1.We can set style for all the parent task using LevelStyles property in GanttGrid .This property will not change the appearance for row header, to set style for row header we have to set RowHeaderStyle property as in the below code example,

[C#]
this.AssociatedObject.GanttGrid.InternalGrid.RowHeaderStyle = new GridStyleInfo() { Background = new SolidColorBrush(Colors.Gray) };

this.AssociatedObject.GanttGrid.LevelStyles.Add(new GridStyleInfo() { Background = new SolidColorBrush(Colors.Gray) });


2. We can  set the style for the row in QueryCellInfo event based on the row index. Here the row header also will be set the same style by using below code example,

[C#]

        this.AssociatedObject.GanttGrid.InternalGrid.QueryCellInfo += InternalGrid_QueryCellInfo;

        void InternalGrid_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)

        {

              if (e.Cell.RowIndex == 5)

                e.Style.Background = Brushes.Red;            
        }



Regards,
Rachel. A


Kamil Kosek
Replied On December 9, 2015 12:41 PM UTC

Hi Rachel,
thanks for the excellent response, I didn´t tried it yet, but it looks very promising.
Thanks :)

Rachel A [Syncfusion]
Replied On December 9, 2015 12:43 PM UTC

Hi Kamil,

Thanks for the update.

Please let us know if you have any query.

Regards,
Rachel.A

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

;