<telerik:RadComboBox EnableTextSelection="false" ID="RadComboBoxForm" Skin="Office2007" CollapseAnimation-Type="InCubic" ExpandAnimation-Type="OutCubic" runat="server" SelectedValue='<%# Eval( "FormTypeId" ) %>' Text='<%# Bind( "FormTypeId" ) %>'>
<Items>
<telerik:RadComboBoxItem runat="server" Text="" Value="" />
<telerik:RadComboBoxItem runat="server" Text="Caplet" Value="1" />
<telerik:RadComboBoxItem runat="server" Text="Capsule" Value="2" />
<telerik:RadComboBoxItem runat="server" Text="Controlled Release" Value="3" />
<telerik:RadComboBoxItem runat="server" Text="Elixir" Value="4" />
<telerik:RadComboBoxItem runat="server" Text="Ointment" Value="5" />
<telerik:RadComboBoxItem runat="server" Text="Solution" Value="6" />
<telerik:RadComboBoxItem runat="server" Text="Supplement" Value="7" />
<telerik:RadComboBoxItem runat="server" Text="Suspension" Value="8" />
<telerik:RadComboBoxItem runat="server" Text="Syrup" Value="9" />
<telerik:RadComboBoxItem runat="server" Text="Tablet" Value="10" />
</Items>
</telerik:RadComboBox>
I am databinding, and I have an integer key awaiting the value of the radcombo in the database. I am finding that it is finding the text value and not the "Value" of the radcombobox which is an integer. Is there any way to store the integer value in the database instead ?
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CustomCertificateEdit.aspx.cs"
Inherits="Web.Admin.CustomCertificateEdit" MasterPageFile="~/Core/DefaultMasterPage.master" %>
<%@ MasterType VirtualPath="~/Core/DefaultMasterPage.master" %>
<%@ Import Namespace="Telerik.Web.UI" %>
<
asp:Content
ID
=
"Content1"
runat
=
"server"
ContentPlaceHolderID
=
"headPlaceHolder"
>
<
style
type
=
"text/css"
>
.radeditorContainer
{
margin-left: auto;
margin-right: auto;
width: 610px;
}
.customCertContentContainer
{
margin-left: auto;
margin-right: auto;
width: 850px;
}
.radEditorErrorColumn
{
vertical-align: bottom;
}
.reTool .ImportField
{
background-image: url(<%= ResolveUrl("~/images/icon_popup_search.gif") %>);
}
</
style
>
<
script
type
=
"text/javascript"
language
=
"javascript"
>
function radEditor_ClientCommand(editor, args) {
if (args.get_commandName() == "ImageManager") {
var callback = function (sender, args) {
var result = args.get_value();
$get("hdnImagesUploaded").value += (result.src + ",");
editor.pasteHtml(result, "ImageManager");
};
args.set_callbackFunction(callback);
}
}
</
script
>
</
asp:Content
>
<
asp:Content
ID
=
"Content2"
runat
=
"server"
ContentPlaceHolderID
=
"ContentPlaceHolder1"
>
<
asp:HiddenField
ID
=
"hdnImagesUploaded"
runat
=
"server"
/>
<
cs:CsPanel
runat
=
"server"
ID
=
"pnlCertificates"
Title
=
"Custom Certificate Advanced Editor"
DoLocalize
=
"true"
>
<
br
/>
<
br
/>
<
div
class
=
"customCertContentContainer"
>
<
div
class
=
"radeditorContainer"
>
<
span
class
=
"FieldName"
>
<%= "Certificate Title:".Localize() %></
span
>
<
asp:TextBox
ID
=
"txtTitle"
runat
=
"server"
MaxLength
=
"300"
CssClass
=
"FieldValue"
Style
=
"width: 300px;"
/>
<
asp:RequiredFieldValidator
ID
=
"reqvTitle"
ControlToValidate
=
"txtTitle"
runat
=
"server"
Text
=
"*"
/><
br
/>
<
br
/>
<
div
style
=
"float: left;"
>
<
cs:CsodRadEditor
ID
=
"radeditorCntrl"
runat
=
"server"
EditorStyle
=
"Advanced"
Width
=
"595"
EnableHtmlEdit
=
"true"
EnableResize
=
"false"
AllowScripts
=
"false"
Skin
=
"Windows7"
ExternalDialogsPath
=
"~/Core/Telerik"
/>
</
div
>
<
div
class
=
"radEditorErrorColumn"
>
<
asp:RequiredFieldValidator
ID
=
"reqvRadEditor"
ControlToValidate
=
"radeditorCntrl"
runat
=
"server"
Text
=
"*"
/>
</
div
>
<
div
style
=
"clear: both;"
>
</
div
>
<
br
/>
<
br
/>
<
cs:CsImageButton
ID
=
"btnSave"
runat
=
"server"
TemplateName
=
"done"
OnClick
=
"btnSave_Click"
/>
<
cs:CsImageButton
ID
=
"btnCancel"
runat
=
"server"
TemplateName
=
"cancel"
OnClick
=
"btnCancel_Click"
/>
</
div
>
</
div
>
</
cs:CsPanel
>
<
script
language
=
"javascript"
>
Telerik.Web.UI.Editor.CommandList["ImportField"] = function (commandName, editor, args) {
//window.popupCaller = 'textbox';
alert('import field');
};
</
script
>
</
asp:Content
>
protected
void
Page_Load(
object
sender, EventArgs e)
{
if
(!Page.IsPostBack)
{
this
.Title =
"Advanced Certificate Page Editor"
.Localize();
this
.breadCrumbs.Reload(
""
);
if
(!isNew)
{
CertificateEntityModel model =
this
.PullCertificateFromId(certificateId.Value);
if
(model !=
null
)
{
txtTitle.Text = model.Title;
radeditorCntrl.Content = model.Html;
}
}
//add the custom import field button
EditorTool importFieldTool =
new
EditorTool(
"Import Field"
,
string
.Empty);
importFieldTool.Name =
"ImportField"
;
importFieldTool.Text =
"Import Field"
.Localize();
radeditorCntrl.Tools[1].Tools.Add(importFieldTool);
//setup the image manager's filepaths and maxfile size
string
[] webPath =
new
string
[] { Functions.GetPublicClientCustomCertificatesUploadPath(CorpName) };
radeditorCntrl.ImageManager.ViewPaths = webPath;
radeditorCntrl.ImageManager.UploadPaths = webPath;
radeditorCntrl.ImageManager.DeletePaths = webPath;
radeditorCntrl.ImageManager.MaxUploadFileSize = ONE_MEG;
radeditorCntrl.OnClientCommandExecuted =
"radEditor_ClientCommand"
;
}
}