This is a migrated thread and some comments may be shown as answers.

ResourceHeaderTemplate not working in agendaview

4 Answers 10 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
ManniAT
Top achievements
Rank 2
ManniAT asked on 05 Aug 2014, 01:30 PM
Hi,

the default of GroupingDirection in AgendaView is Horizontal, which is fine.
But in this case it ignores the ResourceHeaderTemplate.
Is there a way to change the look of it?

Manfred

4 Answers, 1 is accepted

Sort by
0
Aneliya Petkova
Telerik team
answered on 07 Aug 2014, 10:27 AM
Hi Manfred,

The issue with the ResourceHeadeTemplate in AgendaView is logged for fixing. In the public Ideas & Feedback Portal of Telerik UI for ASP.NET AJAX, you can track its status, comment and vote for it.
You can use .rsResourceHeader class of the <th> element to change the look of the resource header.

Regards,
Aneliya Petkova
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
ManniAT
Top achievements
Rank 2
answered on 07 Aug 2014, 11:14 AM
Thank you Aneliya,

changing via css doesn't help since I want to color the header different depending on the Resource group.

<ResourceHeaderTemplate>
        <div class='<%# Eval("Text") %>'>
            <%# Eval("Text") %>
        </div>
    </ResourceHeaderTemplate>


Which works fine for other views except AgendaView.

Manfred
0
Accepted
Aneliya Petkova
Telerik team
answered on 07 Aug 2014, 02:14 PM
Hi Manfred,

Using the .rsResourceHeader class, you could achieve your scenario. Please watch this video showing how the groups look at my side. Attached you can find the page I made for testing. I used the following JavaScript code for the workaround:
<script type="text/javascript">
    var $ = $telerik.$;
 
    function pageLoad() {
 
        var scheduler = $find("<%=RadScheduler1.ClientID %>").get_element();
        var rsResourceHeader = $(scheduler).find('.rsResourceHeader');
 
        for (var i = 0; i < rsResourceHeader.length; i++) {
            if (rsResourceHeader[i].textContent == 'Development') {
                $(rsResourceHeader[i]).addClass("development");
            }
            else if (rsResourceHeader[i].textContent == 'Marketing') {
                $(rsResourceHeader[i]).addClass("marketing");
            }
        }
    }
</script>

Please try this approach and let me know if this works for you.

Regards,
Aneliya Petkova
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
ManniAT
Top achievements
Rank 2
answered on 08 Aug 2014, 06:52 AM
Hi Aneliya,

thank you for this solution - works perfect - and in my case with even less code.
...
 
    for (var i = 0; i < rsResourceHeader.length; i++) {
        $(rsResourceHeader[i]).addClass(rsResourceHeader[i].textContent);              
    }


Manfred
Tags
Scheduler
Asked by
ManniAT
Top achievements
Rank 2
Answers by
Aneliya Petkova
Telerik team
ManniAT
Top achievements
Rank 2
Share this question
or