This is a migrated thread and some comments may be shown as answers.

getting the selectedvalue in radgridcolumn editor

2 Answers 35 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Bassem
Top achievements
Rank 1
Bassem asked on 20 Jul 2012, 08:40 AM


<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 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 20 Jul 2012, 09:12 AM
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.
0
Bassem
Top achievements
Rank 1
answered on 20 Jul 2012, 11:49 AM
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
Tags
General Discussions
Asked by
Bassem
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Bassem
Top achievements
Rank 1
Share this question
or