I i need to be able to access the text boxes within my form popup on rad grid I have tried the usual find controls but to no avail it always returns null. I cannot do it in itemDatabound as I am using a function in my dal which I need to pass the raw value to.
01.
<telerik:RadGrid ID=
"rgNotes"
runat=
"server"
GroupPanelPosition=
"Top"
OnItemCommand=
"rgNotes_ItemCommand"
>
02.
<GroupingSettings CollapseAllTooltip=
"Collapse all groups"
></GroupingSettings>
03.
<MasterTableView NoDetailRecordsText=
"No notes for this Appointment"
AutoGenerateColumns=
"False"
DataKeyNames=
"notes_id"
CommandItemDisplay=
"Top"
CommandItemSettings-AddNewRecordText=
"Add Notes"
AllowAutomaticInserts=
"true"
EditMode=
"PopUp"
>
04.
<Columns>
05.
<telerik:GridEditCommandColumn UniqueName=
"EditCommandColumn"
>
06.
</telerik:GridEditCommandColumn>
07.
<telerik:GridBoundColumn DataField=
"notes_id"
FilterControlAltText=
"Filter notes_id column"
HeaderText=
"notes_id"
ReadOnly=
"True"
SortExpression=
"notes_id"
Visible=
"true"
UniqueName=
"notes_id"
>
08.
</telerik:GridBoundColumn>
09.
<telerik:GridBoundColumn DataField=
"Subject"
FilterControlAltText=
"Filter Subject column"
HeaderText=
"Subject"
ReadOnly=
"True"
SortExpression=
"Subject"
UniqueName=
"Subject"
>
10.
</telerik:GridBoundColumn>
11.
</Columns>
12.
13.
<EditFormSettings EditFormType=
"Template"
InsertCaption=
"Add new Note"
CaptionFormatString=
"Please enter or update note"
>
14.
<FormTemplate>
15.
16.
<telerik:RadTextBox ID=
"txtNotesId"
Visible=
"false"
Width=
"200px"
runat=
"server"
></telerik:RadTextBox>
17.
18.
Subject
19.
<p>
20.
<telerik:RadTextBox ID=
"txtSubjectNotes"
Width=
"200px"
runat=
"server"
></telerik:RadTextBox>
21.
</p>
22.
<p>
23.
Notes<br />
24.
<telerik:RadTextBox ID=
"RadTextBox1"
TextMode=
"MultiLine"
Rows=
"10"
Columns=
"10"
Width=
"200px"
runat=
"server"
></telerik:RadTextBox>
25.
</p>
26.
27.
<telerik:RadButton ID=
"rdSaveNotes"
OnClick=
"rdSaveNotes_Click"
Skin=
"Bootstrap"
BackColor=
"#512479"
ForeColor=
"White"
runat=
"server"
Text=
"Save Notes"
></telerik:RadButton>
28.
<telerik:RadButton ID=
"rdCancel"
OnClick=
"rdCancel_Click1"
CommandName=
"Cancel"
Skin=
"Bootstrap"
BackColor=
"#512479"
ForeColor=
"White"
runat=
"server"
Text=
"Cancel"
></telerik:RadButton>
29.
</FormTemplate>
30.
</EditFormSettings>
31.
</MasterTableView>
32.
<ClientSettings>
33.
<ClientEvents OnPopUpShowing=
"PopUpShowing"
/>
34.
<Selecting AllowRowSelect=
"true"
/>
35.
</ClientSettings>
36.
</telerik:RadGrid>
01.
protected
void
rdSaveNotes_Click(
object
sender, EventArgs e)
02.
{
03.
try
04.
{
05.
int
id = Convert.ToInt32(Request.QueryString[
"id"
]);
06.
tblApertureNetNote _note =
new
tblApertureNetNote();
07.
08.
_note = _dal.GetNotesById(
new
Guid(notes_id),_myuser.UserId);
09.
10.
_note.appointment_id = id;
11.
_note.authUserId = _myuser.UserId;
12.
_note.isActive =
true
;
13.
_note.isDeleted =
false
;
14.
_note.subject = txtSubject.Text;
15.
if
(_note.EntityState == System.Data.EntityState.Detached)
16.
_dal.Addnotes(_note);
17.
18.
rgNotes.DataBind();
19.
}
20.
catch
(Exception ex)
21.
{
22.
logger.Error(
"Error in rdSaveNotes_Click function calandar edit.aspx"
+ ex.ToString());
23.
}
24.
}
It is txtSubjectNotes.Text i require to access and Notes textbox Please can you advise also how can i close the popup from this button. Many thanks.