This question is locked. New answers and comments are not allowed.
Hello all,
I want to make ComboBox Readonly, i don't find a good Solution in the forum.
I don't to use Skin...
So
I implemented a simple code !!! that i maked with help on demo:
and finnaly
i make 2 simple function JS !!!
Code not complexe, but make combo like textBox,
enjoy!!!!
I want to make ComboBox Readonly, i don't find a good Solution in the forum.
I don't to use Skin...
So
I implemented a simple code !!! that i maked with help on demo:
| if (ZoneText is RadComboBox) |
| { |
| ((RadComboBox)ZoneText).EnableViewState = false; |
| if (mode == ModeEdit.ADD) |
| { |
| ((RadComboBox)ZoneText).BackColor = Color.White; |
| ((RadComboBox)ZoneText).ShowToggleImage = true; |
| //((RadComboBox)ZoneText).ShowDropDownOnTextboxClick = true; |
| //((RadComboBox)ZoneText).ChangeTextOnKeyBoardNavigation = true; |
| ((RadComboBox)ZoneText).OnClientKeyPressing = ""; |
| ((RadComboBox)ZoneText).OnClientDropDownOpening = ""; |
| ((RadComboBox)ZoneText).EnableTextSelection = true; |
| } |
| if (mode == ModeEdit.BROWSE) |
| { |
| ((RadComboBox)ZoneText).BackColor = Color.FromName("#E6E6E6"); |
| ((RadComboBox)ZoneText).ShowToggleImage = false; |
| //((RadComboBox)ZoneText).ShowDropDownOnTextboxClick = false; |
| //((RadComboBox)ZoneText).ChangeTextOnKeyBoardNavigation = false; |
| ((RadComboBox)ZoneText).OnClientKeyPressing = "CancelKeyPress"; |
| ((RadComboBox)ZoneText).OnClientDropDownOpening = "CancelDropDown"; |
| ((RadComboBox)ZoneText).EnableTextSelection = false; |
| } |
| if (mode == ModeEdit.EDIT) |
| { |
| ((RadComboBox)ZoneText).BackColor = Color.White; |
| ((RadComboBox)ZoneText).ShowToggleImage = true; |
| //((RadComboBox)ZoneText).ShowDropDownOnTextboxClick = true; |
| //((RadComboBox)ZoneText).ChangeTextOnKeyBoardNavigation = true; |
| ((RadComboBox)ZoneText).OnClientKeyPressing = ""; |
| ((RadComboBox)ZoneText).OnClientDropDownOpening = ""; |
| ((RadComboBox)ZoneText).EnableTextSelection = true; |
| } |
| } |
| public enum ModeEdit |
| { |
| ADD, |
| EDIT, |
| BROWSE |
| } |
i make 2 simple function JS !!!
| <script type="text/javascript"> |
| function CancelDropDown(sender, eventArgs) { |
| eventArgs.set_cancel(true); |
| } |
| function CancelKeyPress(sender, eventArgs) |
| { |
|
eventArgs.get_domEvent().keyCode = null; |
| } |
| </script> |
Code not complexe, but make combo like textBox,
enjoy!!!!