RadComboBox Bind Based on RadGrid Items

2 posts, 0 answers
  1. TommyBoy
    TommyBoy avatar
    22 posts
    Member since:
    Oct 2011

    Posted 13 Aug 2014 Link to this post

    Hello

    This seems pretty unique concept but hopefully not.

    I have a RadGrid displaying shopping cart items. I have a RadComboBox with other services that a user can select to add to the shopping cart such as expedited shipping. What I want to accomplish is, once the selection has been made from the RadComboBox and the item has added to the shopping cart, I would like that item in the RadComboBox to be hidden or removed from selection. The idea is to not allow the same item to be added again.

    I s this possible? Is there a better way to handle this?
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 13 Aug 2014 in reply to TommyBoy Link to this post

    Hi TommyBoy,

    Please try to attach the OnSelectedIndexChanged event of RadComboBox and get the SelectedItem by using Value/Text, then you can make it as disabled or hidden based on your requirement.

    C#:
    protected void rcboOrderItems_SelectedIndexChanged(object sender, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
    {
        //Your code
        RadComboBox senderCombo = (RadComboBox)sender;
        RadComboBoxItem item = (RadComboBoxItem)senderCombo.FindItemByText(e.Text);
        item.Enabled = false;
        //OR
        item.Visible = false;
    }

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top