Change resource style

Hi,

i see the possibility to change the template of the resources with ResourceContainerTemplateSelector, but is there the possibility to change only the style?

Best regards
Gian Piero Truccolo

7 Replies 1 reply marked as answer

SS Sridevi Sivakumar Syncfusion Team June 21, 2021 12:42 PM UTC

Hi Gian Piero Truccolo,

Query: is there the possibility to change resource the style?
No, we don't have support to change the resource style. Please use Gantt control  ResourceContainerTemplateSelector property to customize the resource template. We have prepared a sample for your requirement, please have a sample from below link

Sample link: https://www.syncfusion.com/downloads/support/directtrac/general/ze/GanttSample1559794919

Regards,
Sridevi S.
 
 



GI Gian June 24, 2021 01:50 PM UTC

Hi,


so can't change for example the FontFamily dinamically to  "Segoe UI" to "Arial" is not possible?


 <DataTemplate x:Key="temp">

                    <StackPanel Orientation="Horizontal">

                        <Image Source="..\..\Image\Peter.png" />

                        <TextBlock Width="100"

                           HorizontalAlignment="Left"

                           VerticalAlignment="Center"

                           FontFamily="{Binding FontFamily}"

                           FontStyle="Italic"

                           FontWeight="Bold"

                           Foreground="#333333"

                           Text="{TemplateBinding Content}" />

                    </StackPanel>

                </DataTemplate>


Best regards

Gian Piero Truccolo



SS Sridevi Sivakumar Syncfusion Team June 25, 2021 02:56 PM UTC

Hi Gian Piero Truccolo,

We can change the resource font family in gantt ResourceContainerCreated event as per below code snippet.

[XAML]: 
   <sync:GanttControl x:Name="Gantt"  ResourceContainerCreated="Gantt_ResourceContainerCreated" 
                               Grid.Row="1" 
                               ItemsSource="{Binding TaskCollection}" 
                               UseAutoUpdateHierarchy="False" 
                               ResourceContainerTemplateSelector="{StaticResource Selector}" 
                               VisualStyle="Metro"> 
… 
</sync:GanttControl> 
 
 

[C#]: 
     private void Gantt_ResourceContainerCreated(object sender, Syncfusion.Windows.Controls.Gantt.ResourceContainerCreatedEventArgs args) 
       
           if( args.CurrentResource.Content == "Leslie") 
           args.CurrentResource.FontFamily = new FontFamily("Arial"); 
       

Regards,
Sridevi S. 
 



GI Gian June 28, 2021 07:04 AM UTC

Hi,

i try to update style a second time but is not working.


Best regards

Gian Piero Truccolo


Attachment: StyleResourcesNotUpdate_5e2b8d5a.zip


RS Ramya Soundar Rajan Syncfusion Team June 29, 2021 12:10 PM UTC

Hi Gian Piero Truccolo, 
 
We can reproduce the reported problem and confirmed “Dynamically changing the resource collection is not working properly” as an issue and we have consolidated this issue with already created bug report. You can keep track of the bug from the feedback portal below. 
 
Feedback link: https://www.syncfusion.com/feedback/26488

The provided feedback link is private, and you need to login to view this feedback.

We will fix this issue and provide the consolidated patch on July 1,2021.

If you have any more specification/precise replication procedure or a scenario to be tested, you can add it as a comment in the portal. 
 
Regards, 
Ramya S. 



SS Sridevi Sivakumar Syncfusion Team July 1, 2021 12:39 PM UTC

Hi Gian Piero Truccolo,

We have fixed “Dynamically changing the resource collection is not working properly” issue. Please find the patch from (#166691) forum.

The fix will be included in our next weekly NuGet release which is expected to be rolled out on July 6, 2021.


We appreciate your patience until then.

Regards,
Sridevi S. 
 



SS Sridevi Sivakumar Syncfusion Team July 6, 2021 10:36 AM UTC

Hi Gian Piero Truccolo,

We have fixed the “Dynamically changing the resource collection is not working properly” issue and the fix is included in our weekly NuGet of July 6, 2021.

NuGet Version: 19.2.0.46

We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.

Regards,
Sridevi S.
 


Marked as answer
Loader.
Up arrow icon