Dear Telerik Team,
I have a radgrid with editformtemplate in it. Inside Editform template i have a radtab with set a textboxes and gridview. I just want to access those text boxes and gridview inside that radtabs. When I am trying to access those using findcontrol I am getting null values. Any ides how to get the values of textboxes and gridviews. here is my code..
here is my cs code
I tried in all directions that i showed in my C# code. But no luck can any one help me how to get the values. I am always getting null values for
Thanks
Babu
I have a radgrid with editformtemplate in it. Inside Editform template i have a radtab with set a textboxes and gridview. I just want to access those text boxes and gridview inside that radtabs. When I am trying to access those using findcontrol I am getting null values. Any ides how to get the values of textboxes and gridviews. here is my code..
<
telerik:RadGrid
ID
=
"rg200"
runat
=
"server"
AutoGenerateColumns
=
"False"
PageSize
=
"20"
Height
=
"550px"
Width
=
"100%"
AllowPaging
=
"True"
AllowSorting
=
"True"
AllowMultiRowSelection
=
"True"
EnableHeaderContextMenu
=
"True"
GridLines
=
"None"
AllowMultiRowEdit
=
"true"
AllowFilteringByColumn
=
"True"
OnNeedDataSource
=
"rg200_NeedDataSource"
OnItemCommand
=
"rg200_ItemCommand"
OnItemCreated
=
"rg200_ItemCreated"
>
<
MasterTableView
GridLines
=
"None"
DataKeyNames
=
"orderId"
CommandItemDisplay
=
"Top"
EditMode
=
"EditForms"
>
<
Columns
>
<
telerik:GridClientSelectColumn
UniqueName
=
"ClientSelectColumn"
HeaderStyle-Width
=
"3%"
ItemStyle-Width
=
"3%"
>
<
HeaderStyle
Width
=
"3%"
></
HeaderStyle
>
<
ItemStyle
Width
=
"3%"
></
ItemStyle
>
</
telerik:GridClientSelectColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"sId"
HeaderText
=
"sId"
DataField
=
"sId"
ReadOnly
=
"true"
Visible
=
"false"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"orderId"
HeaderText
=
"orderId"
Visible
=
"false"
ReadOnly
=
"true"
DataField
=
"orderId"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"Project Name"
HeaderText
=
"Project Name"
DataField
=
"Project Name"
ReadOnly
=
"true"
>
</
telerik:GridBoundColumn
>
<
telerik:GridTemplateColumn
UniqueName
=
"Site Name"
HeaderText
=
"Site Name"
DataField
=
"SiteName"
ReadOnly
=
"true"
>
<
ItemTemplate
>
<
asp:LinkButton
ID
=
"lnkSiteName"
runat
=
"server"
Text='<%# Eval( "Site Name" ) %>'
ForeColor="Blue" CommandName="sitename"></
asp:LinkButton
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"Task Status"
HeaderText
=
"Task Status"
DataField
=
"Task Status"
ReadOnly
=
"true"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"Clarify Account Nbr"
HeaderText
=
"Clarify Account Nbr"
DataField
=
"Clarify Account Nbr"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"Site ID"
HeaderText
=
"Site ID"
DataField
=
"Site ID"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"Quote ID"
HeaderText
=
"Quote ID"
DataField
=
"Quote ID"
>
</
telerik:GridBoundColumn
>
<
telerik:GridCheckBoxColumn
UniqueName
=
"EDP Created?"
HeaderText
=
"EDP Created?"
DataField
=
"EDP Created?"
>
</
telerik:GridCheckBoxColumn
>
<
telerik:GridEditCommandColumn
UniqueName
=
"EditCommandColumn"
Display
=
"false"
>
</
telerik:GridEditCommandColumn
>
</
Columns
>
<
EditFormSettings
EditFormType
=
"Template"
>
<
FormTemplate
>
<
table
id
=
"Table1"
cellspacing
=
"1"
cellpadding
=
"1"
>
<
tr
>
<
td
>
<
telerik:RadTabStrip
runat
=
"server"
ID
=
"RadTabStrip1"
Orientation
=
"HorizontalTop"
SelectedIndex
=
"0"
MultiPageID
=
"RadMultiPage1"
>
<
Tabs
>
<
telerik:RadTab
Text
=
"Task Data"
PageViewID
=
"RadPageView1"
>
</
telerik:RadTab
>
<
telerik:RadTab
Text
=
"Notes"
PageViewID
=
"RadPageView2"
>
</
telerik:RadTab
>
</
Tabs
>
</
telerik:RadTabStrip
>
<
telerik:RadMultiPage
runat
=
"server"
ID
=
"RadMultiPage1"
SelectedIndex
=
"0"
>
<
telerik:RadPageView
runat
=
"server"
ID
=
"RadPageView1"
>
<..... some code here .....>
</
telerik:RadPageView
>
<
telerik:RadPageView
runat
=
"server"
ID
=
"RadPageView2"
>
<
table
id
=
"Table2"
cellspacing
=
"1"
cellpadding
=
"1"
width
=
"250"
border
=
"0"
>
<
tr
>
<
td
>
<
legend
><
b
>Add Notes</
b
></
legend
>
<
table
id
=
"Tablenotes"
>
<
tr
>
<
td
align
=
"left"
>
Note Type :
<
asp:DropDownList
ID
=
"ddlNoteType"
runat
=
"server"
>
</
asp:DropDownList
>
</
td
>
<
td
align
=
"left"
>
</
td
>
</
tr
>
<
tr
>
<
td
align
=
"left"
colspan
=
"2"
>
Note Description
</
td
>
</
tr
>
<
tr
>
<
td
align
=
"left"
>
<
asp:TextBox
ID
=
"txtNoteDesc"
runat
=
"server"
TextMode
=
"MultiLine"
Rows
=
"2"
Width
=
"650px"
></
asp:TextBox
>
</
td
>
<
td
>
<
asp:ImageButton
ID
=
"btnAddNote"
CommandName
=
'AddNote'
runat
=
"server"
ToolTip
=
"Add Note"
ImageUrl
=
"~/Images/add-icon.png"
/>
<
asp:ImageButton
Visible
=
"false"
ToolTip
=
"Update"
OnClick
=
"imgbtnNotesUpdate_Click"
ID
=
"imgbtnNotesUpdate"
runat
=
"server"
ImageUrl
=
"~/Images/accept-icon.png"
/>
<
asp:ImageButton
Visible
=
"false"
ToolTip
=
"Cancel"
OnClick
=
"imgbtnNotesCancel_Click"
ID
=
"imgbtnNotesCancel"
runat
=
"server"
ImageUrl
=
"~/Images/delete-icon.png"
/>
</
td
>
</
tr
>
<
tr
>
<
td
>
</
td
>
</
tr
>
</
table
>
</
td
>
</
tr
>
<
tr
>
<
td
>
</
td
>
</
tr
>
<
tr
>
<
td
>
<
div
style
=
"overflow: auto; height: 160px"
>
<
asp:GridView
ID
=
"gvNotes"
BorderColor
=
"#004000"
runat
=
"server"
AutoGenerateColumns
=
"false"
BackColor
=
"White"
BorderWidth
=
"1px"
BorderStyle
=
"Solid"
CellSpacing
=
"0"
Width
=
"100%"
OnSelectedIndexChanged
=
"gvNotes_SelectedIndexChanged"
OnRowDataBound
=
"gvNotes_RowDataBound"
>
<
HeaderStyle
Height
=
"20px"
BackColor
=
"#004000"
Font-Size
=
"8pt"
Font-Bold
=
"True"
ForeColor
=
"White"
HorizontalAlign
=
"Center"
BorderColor
=
"White"
BorderWidth
=
"0px"
/>
<
PagerSettings
Mode
=
"NumericFirstLast"
></
PagerSettings
>
<
RowStyle
ForeColor
=
"#000000"
Font-Size
=
"8pt"
HorizontalAlign
=
"Left"
BorderWidth
=
"1px"
BorderColor
=
"#004000"
/>
<
AlternatingRowStyle
Font-Size
=
"8pt"
ForeColor
=
"#000000"
BackColor
=
"#F5F5E9"
BorderWidth
=
"1px"
BorderColor
=
"#004000"
/>
<
PagerStyle
HorizontalAlign
=
"Right"
Font-Bold
=
"true"
Font-Size
=
"8pt"
/>
<
Columns
>
<
asp:TemplateField
Visible
=
"false"
>
<
ItemTemplate
>
<
asp:Label
ID
=
"lblonID"
runat
=
"server"
Text='<%# Bind("onID") %>'></
asp:Label
>
</
ItemTemplate
>
<
ItemStyle
HorizontalAlign
=
"Left"
/>
</
asp:TemplateField
>
<
asp:BoundField
HeaderText
=
"Note Description"
DataField
=
"Description"
/>
<
asp:BoundField
HeaderText
=
"Note Type"
DataField
=
"Type"
/>
<
asp:BoundField
HeaderText
=
"Created By"
DataField
=
"CreatedBy"
/>
<
asp:BoundField
DataFormatString
=
"{0:MM/dd/yyyy}"
HeaderText
=
"Created Date"
DataField
=
"CreationDate"
/>
</
Columns
>
</
asp:GridView
>
</
div
>
</
td
>
</
tr
>
</
table
>
</
telerik:RadPageView
>
</
telerik:RadMultiPage
>
</
td
>
</
tr
>
</
table
>
</
FormTemplate
>
</
EditFormSettings
>
</
MasterTableView
>
<
ClientSettings
AllowColumnsReorder
=
"True"
>
<
Scrolling
AllowScroll
=
"true"
UseStaticHeaders
=
"true"
/>
<
Selecting
AllowRowSelect
=
"true"
/>
<
Resizing
AllowColumnResize
=
"true"
/>
<
ClientEvents
OnRowContextMenu
=
"RowContextMenu"
OnRowSelected
=
"OnRowSelected"
OnRowDeselecting
=
"OnRowDeselecting"
/>
</
ClientSettings
>
<
PagerStyle
Mode
=
"NextPrevAndNumeric"
AlwaysVisible
=
"true"
></
PagerStyle
>
</
telerik:RadGrid
>
here is my cs code
if
(e.CommandName ==
"AddNote"
)
{
clsTaskUpdates_BL objBL =
new
clsTaskUpdates_BL();
string
strName = Session[
"UserName"
].ToString();
GridEditableItem editedItem = e.Item
as
GridEditableItem;
GridEditFormItem item = e.Item
as
GridEditFormItem;
GridDataItem dataitem = e.Item
as
GridDataItem;
TextBox Notedesc = editedItem.FindControl(
"txtNoteDesc"
)
as
TextBox;
GridView gvNotes = (editedItem.FindControl(
"gvNotes"
)
as
GridView);
string
OrdID = editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex][
"orderId"
].ToString();
TextBox Notedescd = (TextBox)dataitem.NamingContainer.FindControl(
"txtNoteDesc"
)
as
TextBox;
string
NoteDesc = (editedItem.NamingContainer.FindControl(
"txtNoteDesc"
)
as
TextBox).Text;
string
NoteType = (editedItem.FindControl(
"ddlNoteType"
)
as
DropDownList).Text;
}
I tried in all directions that i showed in my C# code. But no luck can any one help me how to get the values. I am always getting null values for
txtNoteDesc, ddlNoteType and gvNotes.
.Thanks
Babu