Hello,
I have a RadGrid that I am trying to place three controls inside a GridTemplateColumn/EditItemTemplate. Two buttons and a drop down list. When one of the buttons is fired I would like to see what value is selected in the DropDownList. I can't seem to access the control.
ASPX example:
VB example:
Thanks for any help!
I have a RadGrid that I am trying to place three controls inside a GridTemplateColumn/EditItemTemplate. Two buttons and a drop down list. When one of the buttons is fired I would like to see what value is selected in the DropDownList. I can't seem to access the control.
ASPX example:
<telerik:GridTemplateColumn> <EditItemTemplate> <p></p> <asp:Button runat="server" ID="btnAddBox" CommandArgument="WHAT!" CommandName="AddBox" Text="Add Box To This Batch" /> <p></p> <asp:DropDownList runat="server" ID="ddBoxList"></asp:DropDownList> <asp:Button runat="server" ID="btnRemoveBox" CommandArgument="WHAT!" CommandName="RemoveBox" Text="Remove Box" /> </EditItemTemplate> </telerik:GridTemplateColumn>VB example:
Protected Sub rgBatchView_ItemCommand(ByVal source As Object, ByVal e As GridCommandEventArgs) Handles rgBatchView.ItemCommand If e.CommandName = "AddBox" Then Dim item = CType(e.Item, GridDataItem) Dim BatchID = item.GetDataKeyValue("BatchID") Dim b As New batch b.LoadBatch(BatchID) b.AddBox() notify.Show("Box Added!") ElseIf e.CommandName = "RemoveBox" Then Dim item = CType(e.Item, GridDataItem) Dim BatchID = item.GetDataKeyValue("BatchID") Dim b As New batch Dim dd As DropDownList = e.Item.Parent.FindControl("ddBoxList") ' **** This returns nothing, Also tried without ".parent" b.LoadBatch(BatchID) b.RemoveBox(dd.SelectedValue) notify.Show("Box Removed") End If End SubThanks for any help!