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
65
ultrawebgrid Hierchical layout
posted

Hi , I have an hierachical ultrawebgrid, and what i want is just to display the bands with alternate style but with the parent and chid bands both with the same color.

For example, i want first row and his son row to be gray, and the second row and his band to be white..

hope is clear what i want, and some one answer me with the solution , i couldn´t be able to find the property to do that silly thing!!!

 

I am using ultrawebgrid 2010 version. (not aikido version).

 

Thank you!!!

 

  • 6748
    Suggested Answer
    posted

    Hello Ignacio,

    Let me know if you have further questions related to this.

    Regards,
    Lyuba
    Developer Support Engineer
    Infragistics
    www.infragistics.com/support

     

  • 6748
    Suggested Answer
    posted

    Hello Ignacio,

     

    There is no special property that fits your requirements. Here is how you can achieve the required functionality with a server-side code:

      protected void UltraWebGrid1_PreRender(object sender, EventArgs e)

        {

            foreach (UltraGridRow row in UltraWebGrid1.Rows)

            {

                foreach (UltraGridRow childRow in row.Rows)

                {

                    if (row.IsAlternate())

                        childRow.Style.BackColor = Color.Green;

                    else

                        childRow.Style.BackColor = Color.Red;

                }

            }

        }

    Hope this helps.

     

    Regards,

    Lyuba Petrova

    Developer Support Engineer

    Infragistics

    www.infragistics.com/support

     

  • 65
    Suggested Answer
    posted

    I didn´t find the correct property, or the correct way to do it , so finally i did it by javascript...

     

     

    function AfterRowExpanded(gridName, cellId) {
                var row = igtbl_getRowById(cellId);
                var rowChild = row.getChildRow();
              
                row.Element.style.backgroundColor = "#F3F3F3";
                if ((row.getIndex() + 1) % 2 == 0) {
                     row.Element.style.backgroundColor = "#F3F3F3";
                    rowChild.Element.style.backgroundColor = "#F3F3F3";
                }
                else {

                    row.Element.style.backgroundColor = "#FFFFFF";
                    rowChild.Element.style.backgroundColor = "#FFFFFF";
                }
             }

     

    if anyone could give another way to do what i want without javascript will be really helpfull! 

    Thank you!