Certainly...here is the EditFormSettings for the RadGrid where the ComboBox with the SelectedIndexChanged event is configured
<
EditFormSettings
EditFormType
=
"Template"
InsertCaption
=
"Add a New Schedule"
CaptionFormatString
=
"Edit Schedule: {0}"
CaptionDataField
=
"SchID"
PopUpSettings-Width
=
"500px"
>
<
FormTemplate
>
<
div
class
=
"popuptitle"
>
Report Name:
</
div
>
<
div
class
=
"popupcontent"
>
<
telerik:RadComboBox
ID
=
"dd_RptID"
Skin
=
"Default"
Font-Size
=
"11px"
ShowToggleImage
=
"true"
MarkFirstMatch
=
"true"
AppendDataBoundItems
=
"true"
OnSelectedIndexChanged
=
"dd_RptID_SelectedIndexChanged"
AutoPostBack
=
"true"
runat
=
"server"
/>
</
div
>
<
div
class
=
"clear"
>
</
div
>
<
div
class
=
"popuptitle"
>
Start Date:
</
div
>
<
div
class
=
"popupcontent"
>
<
telerik:RadDatePicker
ID
=
"dp_SchStDt"
Skin
=
"Default"
DateInput-Font-Size
=
"11px"
ShowPopupOnFocus
=
"true"
Calendar-ShowOtherMonthsDays
=
"false"
Calendar-ShowRowHeaders
=
"false"
runat
=
"server"
/>
</
div
>
<
div
class
=
"clear"
>
</
div
>
<
div
id
=
"divOptions"
runat
=
"server"
>
</
div
>
<
div
class
=
"clear"
>
</
div
>
<
div
class
=
"popupbuttons"
>
<
asp:ImageButton
ID
=
"btn_ReqSubmit"
ImageUrl='<%# (Container is GridEditFormInsertItem) ? "~/App_Themes/InfoSource/Images/ico_add_24.png" : "~/App_Themes/InfoSource/Images/ico_update_24.png" %>'
CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'
runat="server" />
</
div
>
<
div
class
=
"popupbuttons"
>
<
asp:LinkButton
ID
=
"lbl_ReqSubmit"
Text='<%# (Container is GridEditFormInsertItem) ? "Add Schedule" : "Update Schedule" %>'
CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'
runat="server" />
</
div
>
<
div
class
=
"popupbuttons"
>
<
asp:ImageButton
ID
=
"btn_ReqCancel"
ImageUrl
=
"~/App_Themes/InfoSource/Images/ico_cancel_24.png"
CommandName
=
"Cancel"
runat
=
"server"
/>
</
div
>
<
div
class
=
"popupbuttons"
>
<
asp:LinkButton
ID
=
"lbl_ReqCancel"
Text
=
"Cancel"
CommandName
=
"Cancel"
runat
=
"server"
/>
</
div
>
</
FormTemplate
>
</
EditFormSettings
>
and here is the code behind for that event
I did not have EnableViewState set to false, however, when I attempted that, the postback after changing the ComboBox to another value doesn't save that change and returns me to the first selection the list again. So, if Call Response is the first item in the ComboBox and I use the dropdown to change to Call Detail, when the popup does a postback, I'm returned to Call Response again.
Thank you for your assistance...please let me know if you need anything to help troubleshoot this.
If you need the code for the BuildOptions function, here it is:
protected
void
BuildOptions(GridEditFormItem editFormItem)
{
RadComboBox dd_RptID = (RadComboBox)editFormItem.FindControl(
"dd_RptID"
);
EISDataContext db =
new
EISDataContext();
// get the unique report options for the current selected report so we can render the correct controls
var q_options = (from options
in
db.tReportConfigs
where options.RptID == dd_RptID.SelectedItem.Value
select options.OptID).Distinct();
foreach
(var option
in
q_options)
{
string
optionType = (from options
in
db.tReportOptions
where options.OptID == option
select options.OptTyp).FirstOrDefault();
string
optionName = (from options
in
db.tReportOptions
where options.OptID == option
select options.OptNm).FirstOrDefault();
// get the option values for this option
var q_optionValues = from optionvalues
in
db.tReportConfigs
where optionvalues.RptID == dd_RptID.SelectedItem.Value && optionvalues.OptID == option
select optionvalues;
// create a div for the option control and populate it with the correct control
Panel panelContent =
new
Panel();
panelContent.Attributes.Add(
"class"
,
"popupcontent"
);
if
(optionType ==
"ComboBox"
)
{
RadComboBox combo =
new
RadComboBox();
combo.ID =
"dd_"
+ option.ToString();
combo.Font.Size = 8;
foreach
(var optionValue
in
q_optionValues)
{
combo.Items.Add(
new
RadComboBoxItem(optionValue.tReportOptionValue.OptNm, optionValue.tReportOptionValue.OptVal));
}
panelContent.Controls.Add(combo);
}
if
(optionType ==
"DatePicker"
)
{
RadDatePicker dp =
new
RadDatePicker();
dp.ID =
"dp_"
+ option.ToString();
panelContent.Controls.Add(dp);
}
// create a div for the option title and populate it with the option name
Panel panelTitle =
new
Panel();
panelTitle.Attributes.Add(
"class"
,
"popuptitle"
);
Label pnlLabel =
new
Label();
pnlLabel.Text = optionName +
":"
;
panelTitle.Controls.Add(pnlLabel);
// create a div for the clear control
Panel panelClear =
new
Panel();
panelClear.Attributes.Add(
"class"
,
"clear"
);
editFormItem.FindControl(
"divOptions"
).Controls.Add(panelTitle);
editFormItem.FindControl(
"divOptions"
).Controls.Add(panelContent);
editFormItem.FindControl(
"divOptions"
).Controls.Add(panelClear);
}
}
}