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

Styling RenderedFields

2 Answers 115 Views
OrgChart
This is a migrated thread and some comments may be shown as answers.
Gundeep
Top achievements
Rank 1
Gundeep asked on 10 Oct 2012, 12:02 PM
Hello,

I have to display multiple text items in a node in an Telerik OrgChart control.

So I am using RenderedFields like this:
</RenderedFields>
 <ItemFields>
 <telerik:OrgChartRenderedField DataField="Certificates" Label="Certificates" />
 </ItemFields>
<ItemFields>
 <telerik:OrgChartRenderedField DataField="Role" Label="Role" />
 </ItemFields>

 </RenderedFields>


However I want to style each OrgChartRenderedField differently. Infact some of these fields will be hidden in some situations.

Can anyone suggest how to do it.

Thanks

2 Answers, 1 is accepted

Sort by
0
Gundeep
Top achievements
Rank 1
answered on 11 Oct 2012, 09:55 AM
Can anyone from the Telerik team reply to this post.
0
Peter Filipov
Telerik team
answered on 12 Oct 2012, 10:58 AM
Hello Singh,

Please review the following mark up and CSS. Keep in mind that the nth-of-type selector is not supported under ie8 and older versions of IE.
      <style type="text/css">
        .rocItemField:nth-of-type(3)
        {
            color:red;
        }
 
        .rocItemField:nth-of-type(4)
        {
            color:blue !important;
        }
 
    </style>
.........................
            <telerik:RadOrgChart runat="server" ID="RadOrgChart1">
                <Nodes>
                    <telerik:OrgChartNode>
                        <GroupItems>
                            <telerik:OrgChartGroupItem Text="Peter">
                                <RenderedFields>
                                    <telerik:OrgChartRenderedField Text="Field1" />
                                    <telerik:OrgChartRenderedField Text="Field2" />
                                </RenderedFields>
                            </telerik:OrgChartGroupItem>
                        </GroupItems>
                    </telerik:OrgChartNode>
                </Nodes>
            </telerik:RadOrgChart>


Regards,
Peter Filipov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
OrgChart
Asked by
Gundeep
Top achievements
Rank 1
Answers by
Gundeep
Top achievements
Rank 1
Peter Filipov
Telerik team
Share this question
or