Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
543
Applying Css to child band and parent band columns
posted

Hello,

        I am using WebHierarchicalDataGrid v11.2. In my grid I need to apply style sheet to the child band columns. The header, footer as well as cells of the child band columns should be in different color according to the style sheets. In normal case when I do not have any child band columns I'm able to apply the style sheet the following way,

grdGrid2.Rows(0).Items(0).CssClass = "StyleSheet"

But in case when there are child bands present, I am not even able to access grdGrid.Rows(0). Here the count of rows equals to 0.

Also I am creating grid columns dynamically at run time.

I need to apply style sheet to child band as well as parent band columns. What is the way to achieve this? Please help.

Thanks

Amruta D

 

 

Parents
  • 49378
    posted

    Hi Amruta D,

    Thank you for posting in the community.

    In this scenario I would suggest that you use the InitializeRow server side event in order to implement your logic. Note that you can check which band a row belongs to using something similar to:

    1. ContainerGridRecordCollection collection = (Infragistics.Web.UI.GridControls.ContainerGridRecordCollection)e.Row.Owner;
    2. String bandKey = collection.ControlMain.Band.Key.ToString();

    As per styling your child bands, I suggest that you make use of the RowIslandPopulated event. You may find additional useful information relevant to your scenario regarding styling and customization of WebHierarchicalDataGrid at:

    http://forums.infragistics.com/forums/p/61686/312344.aspx

    Please let me know if this helps.

Reply Children