getting the selectedvalue in radgridcolumn editor

3 posts, 0 answers
  1. Bassem
    Bassem avatar
    14 posts
    Member since:
    Jul 2012

    Posted 20 Jul 2012 Link to this post



    <telerik:RadGrid ID="UserTicketGrid" runat="server" AllowSorting="True"<br>                                        AllowPaging="True" PageSize="5" CellSpacing="0"  <br>                                         Width="600px"   OnUpdateCommand="UserTicketGrid_UpdateCommand" AllowAutomaticUpdates="false"><br>                                          <br>                                            <ClientSettings><br>                                            <br>                                            <Selecting AllowRowSelect="true"/><br>                                            <ClientEvents OnRowClick="rowClick" OnCommand="oncommand" /><br>                                            </ClientSettings><br>                                           <MasterTableView EditMode="InPlace" AutoGenerateColumns="false"><br>                                          <br>                                           <Columns><br>                                         <telerik:GridEditCommandColumn  UniqueName="EDIT" HeaderText="<%$Resources:Resource,edit  %>" ButtonType="ImageButton" EditImageUrl="App_Themes/WebPortalTheme/images/edit_icon.png"/><br>                                           <telerik:GridBoundColumn DataField="SUPP_SERV_ID" Display="false" ReadOnly="true" HeaderText="ID" UniqueName="SUPP_SERV_ID"></telerik:GridBoundColumn><br>                                           <telerik:GridBoundColumn DataField="SUPP_SERV_TITLE"  HeaderText="<%$Resources:Resource,gridtitle  %>" UniqueName="TITLE" ReadOnly="true"></telerik:GridBoundColumn><br>                                           <telerik:GridDropDownColumn  DataField="TICKET_STATUS_ID"    DataSourceID="ds_TICKETStatus"  HeaderText="<%$Resources:Resource,status  %>"<br>                                           UniqueName="STATUS_ID" ListTextField="TICKET_STATUS_NAME" ListValueField="TICKET_STATUS_ID"></telerik:GridDropDownColumn><br>                                           <telerik:GridBoundColumn DataField="SUPP_SERV_RATE" HeaderText="<%$Resources:Resource,rate  %>" UniqueName="RATE" ReadOnly="true"> </telerik:GridBoundColumn><br>                                           <telerik:GridBoundColumn DataField="SUPP_SERV_DATE_POSTED" HeaderText="<%$Resources:Resource,dateposted  %>" UniqueName="POSTEDDATE" ReadOnly="true"></telerik:GridBoundColumn><br>                                           <telerik:GridBoundColumn DataField="ISPUBLIC" HeaderText="<%$Resources:Resource,ispublic %>" UniqueName="ISPUBLIC" ReadOnly="true"></telerik:GridBoundColumn><br>                                           </Columns><br>                                            <br>                                           </MasterTableView><br>                                       </telerik:RadGrid><br>

    code behind:


    UserDataT = WebsiteDataHelper.GetUserTickets(UserID, type, realID, versionID);<br>            if (UserDataT.Rows.Count != 0)<br>            {<br>                GridIsEmpty.Style["display"] = "none";<br>                <br>                UserTicketGrid.DataSource = UserDataT;<br>                UserTicketGrid.DataBind();<br>             }<br><br>protected void UserTicketGrid_UpdateCommand(object sender, GridCommandEventArgs e)<br>    {<br><br>/// i need to access GridDropDownColumn selected value here how can i acheive this<br><br>   }

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 20 Jul 2012 Link to this post

    Hello,

    Try accessing the DropDownColumn as shown below.
    C#:
    void RadGrid1_UpdateCommand(object sender, GridCommandEventArgs e)
    {
     GridEditableItem item = (GridEditableItem)e.Item;
     GridEditManager editMan = item.EditManager;
     GridDropDownColumnEditor editor = (GridDropDownColumnEditor)editMan.GetColumnEditor("UniqueName");
     string value = editor.SelectedValue.ToString();
    }

    Thanks,
    Shinu.
  3. Bassem
    Bassem avatar
    14 posts
    Member since:
    Jul 2012

    Posted 20 Jul 2012 Link to this post

    thank you for your reply um i tried your code but i'm having a problem the selected index is always the first value of the drop down box and it's not changing it's always giving me the first index in the drop down box what is my problem please help
Back to Top