Alternate row style in Reorderlist?

Last post 11-12-2007 3:25 PM by achow. 3 replies.

Sort Posts:

  • Alternate row style in Reorderlist?

    02-28-2007, 4:44 PM
    • Member
      319 point Member
    • mr_breaker
    • Member since 06-28-2006, 7:09 PM
    • Posts 180

    Hi,

    Is there a way to set the style or Css class for alternating "rows" in the Reorderlist control? In this case, the control outputs <li> tags.   I'd like to be able to set a Css class on the alternating list items.


    Thanks!

  • Re: Alternate row style in Reorderlist?

    03-01-2007, 10:30 AM
    Answer
    • Member
      319 point Member
    • mr_breaker
    • Member since 06-28-2006, 7:09 PM
    • Posts 180

    I figured this one out.  It was actually a lot easier than I thought it would be.  Here's the code:

     

        protected void ReorderListISPList_ItemCreated(object sender, AjaxControlToolkit.ReorderListItemEventArgs e)
        {
            // set the Css style for alternate list items
            if ((e.Item.ItemIndex % 2) != 0)
                e.Item.CssClass = "Alternate";
    
            // set the Css style for edit rows
            if (e.Item.ItemIndex == ReorderListISPList.EditItemIndex)
                e.Item.CssClass = "Edit";
        }
      
  • Re: Alternate row style in Reorderlist?

    11-05-2007, 4:06 PM
    • Member
      165 point Member
    • webchetan
    • Member since 06-29-2002, 4:53 PM
    • Posts 48

    thanks

    - webchetan
  • Re: Alternate row style in Reorderlist?

    11-12-2007, 3:25 PM
    • Member
      2 point Member
    • achow
    • Member since 11-12-2007, 3:23 PM
    • Posts 1

     how do you update the colors after reordering an item?

Page 1 of 1 (4 items)
Microsoft Communities