I'm trying to get the selected value from a dropdownlist in a radgrid from GridTemplate when being called from a command button.
I don't know how to get the value to pass to an update procedure. ddlassessPeriod.SelectedValue doesn't work when its in ItemTemplate.
Here's some sample code:
I don't know how to get the value to pass to an update procedure. ddlassessPeriod.SelectedValue doesn't work when its in ItemTemplate.
Here's some sample code:
<telerik:RadGrid ID="RadGrid1" runat="server" > <MasterTableView> <Columns> <telerik:GridTemplateColumn UniqueName="TemplateColumn> <ItemTemplate> <asp:DropDownList ID="ddlassessPeriod" runat="server" SelectedValue='<%# Eval("assessPeriod") %>'> <asp:ListItem Value="0" Text="N/A" /> <asp:ListItem Value="1" Text="1" /> <asp:ListItem Value="2" Text="2" /> </asp:DropDownList> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn UniqueName="TemplateColumn" AllowFiltering="False"> <ItemTemplate> <asp:Button ID="update" runat="server" Text="Update" OnCommand="update_Command" CommandName='<%#Eval("seid")%>' /> </ItemTemplate> </telerik:GridTemplateColumn> </Columns> </MasterTableView></telerik:RadGrid>protected void update_Command(object sender, CommandEventArgs e){ SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["curriculum"] + ""); conn.Open(); class.update(conn, ddlassessPeriod.SelctedValue, Convert.ToInt32(e.CommandName));}