I have a custom Edit mode Form Template defined with a Drop-Down List and 3 check boxes. I want to pre-load the Drop-down list from a related table.
That way when I click edit on a grid row, the custom form pops up and the correct text will be selected in the drop-down based on the lookup value in the source
table and I will be able to change the drop down if I like. When I reference the drop down list ID name in the code behind it doesn't recognize it. The name of the drop down list is ddlWebPages. How can I accomplish this?
Here is my markup code for the Grid:
That way when I click edit on a grid row, the custom form pops up and the correct text will be selected in the drop-down based on the lookup value in the source
table and I will be able to change the drop down if I like. When I reference the drop down list ID name in the code behind it doesn't recognize it. The name of the drop down list is ddlWebPages. How can I accomplish this?
Here is my markup code for the Grid:
<
telerik:RadGrid
ID
=
"RadGridwebpagemanagement"
CssClass
=
"webpageManagementGrid"
MasterTableView-DataKeyNames
=
"ID"
runat
=
"server"
AllowFilteringByColumn
=
"True"
AllowSorting
=
"True"
GroupPanelPosition
=
"Top"
OnNeedDataSource
=
"RadGridwebpagemanagement_NeedDataSource"
OnUpdateCommand
=
"RadGridwebpagemanagement_UpdateCommand"
>
<
ClientSettings
>
<
Scrolling
AllowScroll
=
"True"
UseStaticHeaders
=
"True"
/>
<
Selecting
AllowRowSelect
=
"true"
/>
</
ClientSettings
>
<
MasterTableView
AutoGenerateColumns
=
"false"
CommandItemDisplay
=
"Top"
CommandItemSettings-AddNewRecordText
=
"Add New Webpage"
InsertItemPageIndexAction
=
"ShowItemOnCurrentPage"
>
<
columns
>
<
telerik:GridBoundColumn
DataField
=
"webpage_name"
HeaderText
=
"Web Page"
UniqueName
=
"webpage_name"
ItemStyle-Font-Names
=
"Arial"
ItemStyle-Font-Bold
=
"true"
FilterControlWidth
=
"150px"
>
<
HeaderStyle
Width
=
"200px"
Font-Names
=
"Arial"
/>
<
ItemStyle
Width
=
"200px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridCheckBoxColumn
DataField
=
"add_privledge"
HeaderText
=
"Allow Adds"
UniqueName
=
"add_privledge"
FilterControlWidth
=
"120px"
>
<
HeaderStyle
Width
=
"120px"
Font-Names
=
"Arial"
/>
<
ItemStyle
Width
=
"120px"
/>
</
telerik:GridCheckBoxColumn
>
<
telerik:GridCheckBoxColumn
DataField
=
"edit_privledge"
HeaderText
=
"Allow Edits"
UniqueName
=
"edit_privledge"
FilterControlWidth
=
"120px"
>
<
HeaderStyle
Width
=
"120px"
Font-Names
=
"Arial"
/>
<
ItemStyle
Width
=
"120px"
/>
</
telerik:GridCheckBoxColumn
>
<
telerik:GridCheckBoxColumn
DataField
=
"delete_privledge"
HeaderText
=
"Allow Deletes"
UniqueName
=
"delete_privledge"
FilterControlWidth
=
"120px"
>
<
HeaderStyle
Width
=
"120px"
Font-Names
=
"Arial"
/>
<
ItemStyle
Width
=
"120px"
/>
</
telerik:GridCheckBoxColumn
>
<
telerik:GridEditCommandColumn
ButtonType
=
"LinkButton"
EditText
=
"Edit"
CancelText
=
"Cancel"
ItemStyle-Width
=
"50px"
HeaderStyle-Width
=
"50px"
FilterControlWidth
=
"50px"
/>
<
telerik:GridButtonColumn
ConfirmText
=
"Delete this product?"
ConfirmDialogType
=
"RadWindow"
ConfirmTitle
=
"Delete"
ButtonType
=
"LinkButton"
Text
=
"Delete"
CommandName
=
"Delete"
ItemStyle-Width
=
"50px"
HeaderStyle-Width
=
"50px"
FilterControlWidth
=
"50px"
/>
</
columns
>
<
EditFormSettings
EditFormType
=
"Template"
>
<
FormTemplate
>
<
div
id
=
"divGridEdit"
class
=
"divGrid"
>
<
b
>Add New Role to Webpage Association</
b
>
<
br
/><
br
/>
<
table
>
<
tr
>
<
td
><
asp:Label
Text
=
"Web Page:"
runat
=
"server"
></
asp:Label
></
td
>
<
td
><
asp:DropDownList
ID
=
"ddlWebPages"
runat
=
"server"
></
asp:DropDownList
></
td
>
</
tr
>
<
tr
>
<
td
><
asp:Label
Text
=
"Allow Add:"
runat
=
"server"
></
asp:Label
></
td
>
<
td
><
asp:CheckBox
ID
=
"chkboxAllowAdd"
Checked='<%# Bind("add_privledge") %>' runat="server" /></
td
>
</
tr
>
<
tr
>
<
td
><
asp:Label
Text
=
"Allow Edit:"
runat
=
"server"
></
asp:Label
></
td
>
<
td
><
asp:CheckBox
ID
=
"chkboxAllowEdit"
Checked='<%# Bind("add_privledge") %>' runat="server" /></
td
>
</
tr
>
<
tr
>
<
td
><
asp:Label
Text
=
"Allow Delete:"
runat
=
"server"
></
asp:Label
></
td
>
<
td
><
asp:CheckBox
ID
=
"chkboxDelete"
Checked='<%# Bind("add_privledge") %>' runat="server" /></
td
>
</
tr
>
<
tr
>
<
td
><
br
/></
td
>
<
td
></
td
>
</
tr
>
<
tr
>
<
td
><
asp:Button
ID
=
"btnUpdate"
Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' runat="server" /></
td
>
<
td
><
asp:Button
ID
=
"btnCancel"
Text
=
"Cancel"
runat
=
"server"
CommandName
=
"Cancel"
CausesValidation
=
"false"
/></
td
>
</
tr
>
</
table
>
</
div
>
</
FormTemplate
>
</
EditFormSettings
>
</
MasterTableView
>
<
ClientSettings
>
<
ClientEvents
OnRowDblClick
=
"rowDblClick"
/>
</
ClientSettings
>
</
telerik:RadGrid
>