This is a migrated thread and some comments may be shown as answers.

RadComboBox Bind Based on RadGrid Items

1 Answer 57 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
ADAPT
Top achievements
Rank 2
ADAPT asked on 13 Aug 2014, 01:41 PM
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?

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 14 Aug 2014, 04:46 AM
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.
Tags
ComboBox
Asked by
ADAPT
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
Share this question
or