I have a radgrid (master detail) as shown below in the code snippets. I want to access a control (TextBox) within another control's (Checkbox) checked_changed event. Please i need your assistance.
Let's say, i need to access the control as follows:
Protected void OnCheckedChanged(object sender, EventsArg e)
{
// I need to find a control here.the control shown in code 'ShortTextBox'
}
Thanks in advance.
Robert
Let's say, i need to access the control as follows:
Protected void OnCheckedChanged(object sender, EventsArg e)
{
// I need to find a control here.the control shown in code 'ShortTextBox'
}
Thanks in advance.
Robert
<
rad:RadGrid
ID
=
"qualRadGrid"
runat
=
"server"
AllowAutomaticDeletes
=
"false"
AllowAutomaticInserts
=
"false"
AllowAutomaticUpdates
=
"false"
AllowPaging
=
"True"
OnInsertCommand
=
"qualRadGrid_InsertCommand"
OnDeleteCommand
=
"CategoryGrid_DeleteCommand"
OnUpdateCommand
=
"qualRadGrid_UpdateCommand"
AllowSorting
=
"True"
AutoGenerateColumns
=
"False"
DataSourceID
=
"ProgrammeDs"
EnableAJAX
=
"False"
GridLines
=
"None"
RadControlsDir
=
"~/Resources/RadControls/"
Skin
=
"Web20"
SkinsPath
=
"~/Resources/RadControls/Grid/Skins"
Width
=
"750px"
>
<
MasterTableView
AllowMultiColumnSorting
=
"True"
DataKeyNames
=
"ProgId"
DataSourceID
=
"ProgrammeDs"
CommandItemDisplay
=
"Top"
Name
=
"Programme"
>
<
DetailTables
>
<
rad:GridTableView
runat
=
"server"
CommandItemDisplay
=
"Top"
DataKeyNames
=
"QualId"
DataSourceID
=
"QualificationDs"
Name
=
"Qualification"
AllowMultiColumnSorting
=
"True"
AllowAutomaticDeletes
=
"false"
AllowAutomaticInserts
=
"false"
AllowAutomaticUpdates
=
"false"
>
<
ParentTableRelation
>
<
rad:GridRelationFields
DetailKeyField
=
"ProgrammeId"
MasterKeyField
=
"ProgId"
/>
</
ParentTableRelation
>
<
RowIndicatorColumn
>
<
HeaderStyle
Width
=
"20px"
/>
</
RowIndicatorColumn
>
<
ExpandCollapseColumn
>
<
HeaderStyle
Width
=
"20px"
/>
</
ExpandCollapseColumn
>
<
Columns
>
<
rad:GridEditCommandColumn
ButtonType
=
"ImageButton"
EditImageUrl
=
"~/Resources/Buttons/EditButton.jpg"
>
</
rad:GridEditCommandColumn
>
<
rad:GridBoundColumn
DataField
=
"QualId"
HeaderButtonType
=
"TextButton"
HeaderText
=
"Qual Id"
SortExpression
=
"QualId"
UniqueName
=
"QualId"
Visible
=
"false"
>
</
rad:GridBoundColumn
>
<
rad:GridBoundColumn
DataField
=
"QualDescription"
HeaderButtonType
=
"TextButton"
HeaderText
=
"Short Description"
UniqueName
=
"ShortDesc"
>
</
rad:GridBoundColumn
>
</
Columns
>
<
EditFormSettings
EditFormType
=
"Template"
>
<
FormTemplate
>
<
table
id
=
"editableTables-1"
>
<
tr
>
<
td
>
<
asp:Label
ID
=
"Label1"
runat
=
"server"
>Short Description:</
asp:Label
>
</
td
>
<
td
>
<
asp:TextBox
ID
=
"ShortTextBox"
Text='<%# Eval("QualDescription") %>' Width="155px"
runat="server" TextMode="MultiLine" Height="30">
</
asp:TextBox
>
<
asp:RequiredFieldValidator
ValidationGroup
=
"validD"
id
=
"ReqSponsorTextBox"
runat
=
"server"
ErrorMessage
=
"*"
ControlToValidate
=
"ShortTextBox"
></
asp:RequiredFieldValidator
>
</
td
>
</
tr
>
<
tr
>
<
td
>
<
asp:CheckBox
ID
=
"requiresSubjects"
runat
=
"server"
Text
=
"Requires Subjects:"
AutoPostBack
=
"true"
OnCheckedChanged
=
"FindTextBox_OnIndexChanged"
/>
</
td
>
<
td
>
<
telerik:RadComboBox
ID
=
"subjectsCombo"
EnableLoadOnDemand
=
"true"
AutoPostBack
=
"true"
MarkFirstMatch
=
"true"
OnItemsRequested
=
"OnItemsRequested_getSubjects"
runat
=
"server"
RadControlsDir
=
"~/Resources/RadControls/Combobox/Skins"
Width
=
"155px"
Skin
=
"WebBlue"
SkinsPath
=
"~/Resources/RadControls/Combobox/Skins/"
>
</
telerik:RadComboBox
>
</
td
>
</
tr
>
<
tr
>
<
td
>
<
asp:ImageButton
ID
=
"LinkInsert"
ValidationGroup
=
"validD"
Text='<%# (Container is Telerik.WebControls.GridEditFormInsertItem) ? "Insert" : "Update" %>'
ImageUrl="~/Resources/Buttons/SaveButton.jpg" runat="server" CommandName='<%# (Container is Telerik.WebControls.GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'
Visible='<%# (Container is Telerik.WebControls.GridEditFormInsertItem) ? true : false %>' />
<
asp:ImageButton
ID
=
"LinkButton1"
Text='<%# (Container is Telerik.WebControls.GridEditFormInsertItem) ? "Insert" : "Update" %>'
ImageUrl="~/Resources/Buttons/SaveButton.jpg" runat="server" CommandName='<%# (Container is Telerik.WebControls.GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'
Visible='<%# (Container is Telerik.WebControls.GridEditFormInsertItem) ? false : true %>' />
<
asp:ImageButton
ID
=
"LinkButtonCancel"
ImageUrl
=
"~/Resources/Buttons/CancelButton.jpg"
runat
=
"server"
Text
=
"Cancel"
CausesValidation
=
"false"
CommandName
=
"Cancel"
/>
</
td
>
</
tr
>
<
td
>
<
tr
>
<
td
>
<
asp:TextBox
ID
=
"IDTextBox"
Text='<%# Eval("QualId") %>' runat="server" Visible="false">
</
asp:TextBox
>
</
td
>
</
tr
>
</
table
>
</
FormTemplate
>
<
EditColumn
UniqueName
=
"EditCommandColumn1"
>
</
EditColumn
>
</
EditFormSettings
>
</
rad:GridTableView
>
</
DetailTables
>
<
RowIndicatorColumn
>
<
HeaderStyle
Width
=
"20px"
></
HeaderStyle
>
</
RowIndicatorColumn
>
<
ExpandCollapseColumn
Visible
=
"True"
>
<
HeaderStyle
Width
=
"20px"
></
HeaderStyle
>
</
ExpandCollapseColumn
>
<
Columns
>
<%--<
rad:GridEditCommandColumn
ButtonType
=
"ImageButton"
EditImageUrl
=
"~/Resources/Buttons/EditButton.jpg"
>
</
rad:GridEditCommandColumn
>--%>
<
rad:GridBoundColumn
DataField
=
"ProgId"
HeaderText
=
"Programme ID"
SortExpression
=
"ProgId"
UniqueName
=
"ProgId"
Visible
=
"false"
>
</
rad:GridBoundColumn
>
<
rad:GridBoundColumn
DataField
=
"ProgCode"
HeaderText
=
"Programme Code"
SortExpression
=
"ProgCode"
ConvertEmptyStringToNull
=
"false"
UniqueName
=
"ProgCode"
>
</
rad:GridBoundColumn
>
<
rad:GridBoundColumn
DataField
=
"ProgrammeName"
HeaderText
=
"Programme Name"
SortExpression
=
"ProgrammeName"
ConvertEmptyStringToNull
=
"false"
UniqueName
=
"ProgrammeName"
>
</
rad:GridBoundColumn
>
</
Columns
>
</
MasterTableView
>
</
rad:RadGrid
>