I am trying to access my radcomboboxes that are in my GridTemplateColumn when the Item command perform insert is fired.
protected
void
radGridAssetLocationHistory_ItemCommand(
object
sender, GridCommandEventArgs e)
{
//Refresh Command Button was pressed
if
(e.CommandName == RadGrid.RebindGridCommandName)
{
radGridAssetLocationHistory.Rebind();
}
if
(e.CommandName == RadGrid.PerformInsertCommandName)
{
//Need to access the items to perform insert
}
}
<
telerik:RadGrid
ID
=
"radGridAssetLocationHistory"
runat
=
"server"
Skin
=
"WebBlue"
CellSpacing
=
"0"
GridLines
=
"None"
ShowStatusBar
=
"True"
GroupingEnabled
=
"False"
OnNeedDataSource
=
"radGridAssetLocationHistory_NeedDataSource"
ShowFooter
=
"True"
AutoGenerateColumns
=
"False"
OnItemCommand
=
"radGridAssetLocationHistory_ItemCommand"
OnItemDataBound
=
"radGridAssetLocationHistory_ItemDataBound"
>
<
MasterTableView
CommandItemDisplay
=
"Top"
DataKeyNames
=
"TubularLocationID"
InsertItemPageIndexAction
=
"ShowItemOnCurrentPage"
InsertItemDisplay
=
"Top"
EditMode
=
"InPlace"
>
<
CommandItemSettings
AddNewRecordText
=
"Relocate Tubular To New Location"
ShowRefreshButton
=
"true"
></
CommandItemSettings
>
<
Columns
>
<
telerik:GridEditCommandColumn
UniqueName
=
"CommandColumn"
/>
<
telerik:GridBoundColumn
AllowFiltering
=
"False"
AllowSorting
=
"False"
DataField
=
"TubularLocationID"
DataType
=
"System.Guid"
Display
=
"False"
FilterControlAltText
=
"Filter TubularLocationID column"
Groupable
=
"False"
HeaderText
=
"TubularLocationID"
ReadOnly
=
"True"
ShowSortIcon
=
"False"
UniqueName
=
"TubularLocationID"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
AllowFiltering
=
"False"
AllowSorting
=
"False"
DataField
=
"TubularID"
DataType
=
"System.Guid"
Display
=
"False"
FilterControlAltText
=
"Filter TubularID column"
Groupable
=
"False"
HeaderText
=
"TubularID"
ReadOnly
=
"True"
ShowSortIcon
=
"False"
UniqueName
=
"TubularID"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
AllowFiltering
=
"False"
AllowSorting
=
"False"
DataField
=
"LocationDate"
DataType
=
"System.DateTime"
FilterControlAltText
=
"Filter LocationDate column"
Groupable
=
"False"
HeaderText
=
"Location Date"
ReadOnly
=
"True"
ShowSortIcon
=
"False"
UniqueName
=
"LocationDate"
>
</
telerik:GridBoundColumn
>
<
telerik:GridTemplateColumn
DataField
=
"Region.Region1"
HeaderText
=
"Region"
UniqueName
=
"Region"
Display
=
"true"
>
<
ItemTemplate
><%# Eval("Region.Region1") %></
ItemTemplate
>
<
EditItemTemplate
>
<
telerik:RadComboBox
ID
=
"radComboRegions"
runat
=
"server"
Skin
=
""
OnSelectedIndexChanged
=
"radComboRegions_SelectedIndexChanged"
AutoPostBack
=
"true"
CssClass
=
"CustomRCB"
DropDownWidth
=
"200px"
MarkFirstMatch
=
"true"
AllowCustomText
=
"false"
></
telerik:RadComboBox
>
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
DataField
=
"Facilit.Facility1"
HeaderText
=
"Facility"
UniqueName
=
"Facility"
>
<
ItemTemplate
><%# Eval("Facility.Facility1") %></
ItemTemplate
>
<
EditItemTemplate
>
<
telerik:RadComboBox
ID
=
"radComboFacilities"
runat
=
"server"
Skin
=
""
CssClass
=
"CustomRCB"
OnSelectedIndexChanged
=
"radComboFacilities_SelectedIndexChanged"
AutoPostBack
=
"true"
DropDownWidth
=
"200px"
MarkFirstMatch
=
"true"
AllowCustomText
=
"false"
></
telerik:RadComboBox
>
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
DataField
=
"Region.Region1"
HeaderText
=
"Area"
UniqueName
=
"Area"
>
<
ItemTemplate
><%# Eval("Area.Area1") %></
ItemTemplate
>
<
EditItemTemplate
>
<
telerik:RadComboBox
ID
=
"radComboAreas"
runat
=
"server"
Skin
=
""
CssClass
=
"CustomRCB"
DropDownWidth
=
"200px"
MarkFirstMatch
=
"true"
AllowCustomText
=
"false"
></
telerik:RadComboBox
>
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
</
Columns
>
</
MasterTableView
>
<
FilterMenu
EnableImageSprites
=
"False"
></
FilterMenu
>
</
telerik:RadGrid
>