I have a combobox in a grid popup edit form that I'm creating programatically and I'm trying to set the SelectedIndexChanged event, but I can't seem to get it to fire.
there are some data points that get read in to determine whether or not to set the SelectedIndexChanged event, but here is the code
I know I'm getting to the point where it should assign the SelectedIndexChanged event because the AutoPostBack attribute right above it is working (I can comment out that line and the combobox doesn't postback).
Here is the associated event code
I put in the Response.Redirect just to see if the event was firing and it's not.
Am I not going about this correct way? I need to be able to fire off this event so the BuildOptions event gets run when the postback occurs.
Thanks
there are some data points that get read in to determine whether or not to set the SelectedIndexChanged event, but here is the code
if
(optionType ==
"ComboBox"
)
{
RadComboBox combo =
new
RadComboBox();
combo.ID =
"dd_"
+ option.ToString();
combo.Font.Size = 8;
if
(optionName ==
"Report Date"
)
{
combo.AutoPostBack =
true
;
combo.SelectedIndexChanged +=
new
RadComboBoxSelectedIndexChangedEventHandler(dd_RptDate_SelectedIndexChanged);
}
foreach
(var optionValue
in
q_optionValues)
{
combo.Items.Add(
new
RadComboBoxItem(optionValue.tReportOptionValue.OptNm, optionValue.tReportOptionValue.OptVal));
// if option is Report Date, determine additional controls depending on dropdown value
if
(optionName ==
"Report Date"
)
{
//if optionvalue is specific date, set the datepickers bool to true
if
(optionValue.tReportOptionValue.OptNm ==
"Specific Date"
)
{
datepickers =
true
;
}
//if optionvalue is specific months, set the monthpickers bool to true
if
(optionValue.tReportOptionValue.OptNm ==
"Specific Months"
)
{
//datepickers = true;
}
}
}
panelContent.Controls.Add(combo);
}
I know I'm getting to the point where it should assign the SelectedIndexChanged event because the AutoPostBack attribute right above it is working (I can comment out that line and the combobox doesn't postback).
Here is the associated event code
protected
void
dd_RptDate_SelectedIndexChanged(
object
sender, RadComboBoxSelectedIndexChangedEventArgs e)
{
string
url =
"/"
;
Response.Redirect(url);
RadComboBox combo = (RadComboBox)sender;
GridEditFormInsertItem editFormItem = (GridEditFormInsertItem)combo.NamingContainer;
BuildOptions(editFormItem);
}
I put in the Response.Redirect just to see if the event was firing and it's not.
Am I not going about this correct way? I need to be able to fire off this event so the BuildOptions event gets run when the postback occurs.
Thanks