I have a RadSplitButton that I build menuItems programmatically. But, I can't figure out how to capture a click event when the menuItem is clicked.
The reason I'm doing it this way is because I have a RadbuttonTextbox with the RadSplitButton on its LeftButtonsItems collection.
The RadSplitButton contains previously entered data in the TextBox. The textbox is a Key field for the form, so the radSplitbutton would be perfect for this use if I can get it to work.
No response. So, I thought I would add a bit more detail on what I've tried but the click event is NOT triggering.
Screenshots and code
User has entered a value in a textfield
User clicks on the cancel button
code to add text from textfield as a new RadSpinbutton MenuItem and create the MenuItem Click Event
User clicks on MenuItem from RadSpinButton
Code : MenuItem Click Event : Text for selected MenuItem is entered into the TextField
private void cmdCancel_Click(object sender, EventArgs e) { //if it is okay to cancel current work, AddToPreviousList(txtbutKey.Text); CleanUp(); //focus to key field; } private void AddToPreviousList(string key) { if (! string.IsNullOrEmpty(txtbutKey.Text)) { lstPreviousKey.Add(txtbutKey.Text); } } private void CleanUp() { foreach(string key in lstPreviousKey) { sbutPrevKey.Items.Add(new RadMenuItem(key, new System.EventHandler(this.MenuItem1_Click))); dbutPrevKey.Items.Add(new RadMenuItem(key, new System.EventHandler(this.MenuItem1_Click))); } EnablePreviousButton(true); EnablePanel(ePanel.Key); } private void MenuItem1_Click(Object sender, System.EventArgs e) { // Code goes here that handles the Click event. string sMenuItem = (sender as RadMenuItem).Text; txtbutKey.Text = sMenuItem; }