attributes in dropdown lost after postback RRS feed

  • Question

  • User-153404742 posted


    So I'm setting the attribute for listItems that are then added to the dropdown when page loads based on some condition...so not all the listItems will have the same attribute as pxVal will be different for each item.  I'm basically trying to make it look like a treeview control.  However, when I try to add the selected item to gridview, the postback occurs and the attribute styling is gone.  So I was trying to rebind the list but I don't want to duplicate the records so I cleared the items first and readded them to the list.  The problem is, ddlControl.Items.Clear method make a linkbutton I have in a gridview control not fire.  Any ideas why a rowcommand event won't fire?  I'm binding the gridview on a button click event and then calling the function to clear the dropdownlist items and repopulate it...

    li.Attributes.Add("style", "padding-left:" + pxVal + ";");

    Tuesday, November 19, 2019 11:38 PM

All replies

  • User1535942433 posted

    Hi inkaln,

     According to your description, I couldn’t understand your requirement clearly.

     Could you please post the details aspx codes and the code-behind make up? 

    If you post more details information and codes, it will be more easily for us to reproduce your issue and find out the solution.

    Best regards,

    Yijing Sun

    Wednesday, November 20, 2019 7:34 AM