Styling RenderedFields

3 posts, 0 answers
  1. G
    G avatar
    4 posts
    Member since:
    Sep 2012

    Posted 10 Oct 2012 Link to this post

    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. G
    G avatar
    4 posts
    Member since:
    Sep 2012

    Posted 11 Oct 2012 Link to this post

    Can anyone from the Telerik team reply to this post.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 12 Oct 2012 Link to this post

    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.
Back to Top