Iterating through rows getting the value from a raddropdownlist

2 posts, 0 answers
  1. Craig Holmes
    Craig Holmes avatar
    3 posts
    Member since:
    Nov 2009

    Posted 05 Jun 2018 Link to this post

    Wonder if someone could give me a hand with a problem.  I have a radgrid with two columns.  One column is a raddropdownlist with three static items.  The user changes the dropdownlist values as required and then clicks the SAVE button which invokes a code behind function.

    At this point I iterate through the rows, getting the values of the two columns to then save manually in my database.

    Whilst I can get the first databound column (menuname), what ever I do the raddropdownlist returns nothing.

    I've tried various options including findcontrol, mastertable getdatakeyvalues, tablecells but everything returns nothing.

                       <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False">
                            <GroupingSettings CollapseAllTooltip="Collapse all groups"></GroupingSettings>
                                <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                            <MasterTableView EditMode="Batch">
                                    <telerik:GridBoundColumn DataField="menuname" UniqueName="menuname" HeaderText="Plugin" ReadOnly="True">
                                        <HeaderStyle Width="200px" Font-Bold="True"/>
                                    <telerik:GridTemplateColumn HeaderText="Permission" DefaultInsertValue="None" UniqueName="Pluginperm" DataField="Pluginperm">
                                        <HeaderStyle Width="150px" Font-Bold="True"/>
                                            <%# Eval("pluginperm") %>
                                            <telerik:RadDropDownList ID="pluginpermRadDropDownList" runat="server" SelectedText="None" SelectedValue="None">
                                                    <telerik:DropDownListItem runat="server" Text="None" ToolTip="No access" Value="N" />
                                                    <telerik:DropDownListItem runat="server" Text="View" ToolTip="View only access" Value="V" />
                                                    <telerik:DropDownListItem runat="server" Text="Admin" ToolTip="Full access to all options" Value="A" />
                                        <HeaderStyle Width="150px"></HeaderStyle>
                                    <telerik:GridBoundColumn FilterControlAltText="Filter column column" UniqueName="Pluginhidden" Visible="False">

    I know "b = item("pluginperm").ToString" won't work - I've just put it in for completeness.

    ... in the code behind function 

              For Each item As GridDataItem In RadGrid1.Items
                  Dim a As String
                  Dim b As String
                  a = item("menuname").Text
                  b = item("pluginperm").ToString


    I know "b = item("pluginperm").ToString" won't work - I've just put it in for completeness.

    Any help would be really appreciated.


  2. Marin Bratanov
    Marin Bratanov avatar
    5522 posts

    Posted 07 Jun 2018 Link to this post

    Hello Craig,

    If you will not be using the automatic CRUD operations with batch editing, you have two options:


    Marin Bratanov
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top