Hi guys, I am having trouble doing something I thought would be simple.
The scenario:
1. A combobox on a page with autopostback set to true and a sub in the codebehind that I want to fire whenever the combobox changes.
Protected Sub cmbxHerbicide_SelectedIndexChanged(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) Handles cmbxHerbicide.SelectedIndexChanged
Dim con As New S
.............
..............
End Sub
2. On page load I grab a querystring and use it to change the combobox.
cmbxHerbicide.SelectedValue = Request.QueryString("ActiveID")
Ok, when I run this the combobox is changed as expected but the sub does not fire.
So I thought I would try:
cmbxHerbicide.SelectedValue = Request.QueryString("ActiveID")
cmbxHerbicide_SelectedIndexChanged(e, e)
This produces an error.
Unable to cast object of type 'System.EventArgs' to type 'Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs'
How do I get around this?
I had expected that if I had AutoPostback set to true, and I changed the selection then the SelectedIndexChanged would fire.
What event args do I need to send?
Cheers
Ian
PS. The sub fires fine if I manually change the combobox. The reason I am doing it in this way is that sometimes I want to run the code from a value pulled from a querystring, but once the user is on the page they can then go and select other values. A worst case scenario is that I duplicate lots of code, I don't want to do that, the simple solution is to change the selection and call the sub.
<telerik:GridEditCommandColumn ButtonType="ImageButton" EditImageUrl="images/edit.gif" UpdateImageUrl="images/update.gif" InsertImageUrl="images/update.gif" CancelImageUrl="images/delete.gif"></telerik:GridEditCommandColumn><telerik:RadEditor runat="server" ID="edNotes" Height="200" Width="98%" ContentAreaMode="Iframe" EditModes="Design" EnableResize="true" ToolsFile="~/App_Data/ToolsFile.xml" SpellCheckSettings-CustomDictionarySuffix="Custom" SpellCheckSettings-DictionaryLanguage="en-US" SpellCheckSettings-DictionaryPath="~/App_Data/RadSpell/" SpellCheckSettings-SpellCheckProvider="MicrosoftWordProvider" SpellCheckSettings-AllowAddCustom="true" /> I have the following in my Page_Load routine:edNotes.SpellCheckSettings.SpellCheckProviderTypeName = typeof(Telerik.Web.UI.WordSpellCheckProvider).AssemblyQualifiedName;Is the MS Word provider supposed to use en-US.tdf, or does it use the dictionary that Word/Office uses? I tested that and it does not seem to be using the Word dictionary. Also, I need to get the Custom dictionary file working as well. Please comment on that as well. Thanks, - Tim



protected void chckRSMCA_CheckedChanged(object sender, EventArgs e){ CheckBox checkboxRS = (CheckBox)sender; RadTextBox Id = (RadTextBox)rlvListView.FindControl("txtRSFarmIdMCA"); RadTextBox Address = (RadTextBox)rlvListView.FindControl("txtRSSvrAddressMCA"); if (checkboxRS.Checked) { Id.Enabled = true; Address.Enabled = true; } else { Id.Enabled = false; Address.Enabled = false; }}An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |