I need a grid that has a drop down in each row. When you change the drop down it grabs the ID for that row as well as the changed drop down value. I don't want the user to have to hit an edit button then a save button. I've got the look I want below but I'm struggling getting the datakey value of that row. Please help.
<telerik:RadGrid ID="RadGrid2" |
OnNeedDataSource="RadGrid2_NeedDataSource" |
OnItemCommand="Lead_Click" |
Skin="Mac" |
Width="97%" |
AllowSorting="True" |
PageSize="30" |
AllowPaging="True" |
runat="server" |
Gridlines="None"> |
<MasterTableView Width="100%" Summary="RadGrid table" DataKeyNames="Link_ID" AutoGenerateColumns="false"> |
<Columns> |
<telerik:GridBoundColumn DataField="Company_Name" HeaderText="Company Name"></telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="City" HeaderText="City"></telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="State" HeaderText="State"></telerik:GridBoundColumn> |
<telerik:GridTemplateColumn UniqueName="StageTemplate" HeaderText="Stage"> |
<ItemTemplate> |
<telerik:RadComboBox ID="Stage" runat="server" DataValueField="Stage_Definition" Skin="Office2007" OnInit="ddStageBound" OnSelectedIndexChanged="buttonChangeLead_Click" AutoPostBack="true"> |
<Items> |
<telerik:RadComboBoxItem Value="1" Text="Pre-Approach" /> |
<telerik:RadComboBoxItem Value="2" Text="Approach" /> |
<telerik:RadComboBoxItem Value="3" Text="Presentation" /> |
<telerik:RadComboBoxItem Value="4" Text="Close" /> |
<telerik:RadComboBoxItem Value="5" Text="Completed" /> |
</Items> |
</telerik:RadComboBox> |
</ItemTemplate> |
</telerik:GridTemplateColumn> |
</Columns> |
</MasterTableView> |
<PagerStyle Mode="NextPrevAndNumeric" /> |
<ClientSettings |
EnablePostBackOnRowClick="true" |
AllowColumnsReorder="true" |
ReorderColumnsOnClient="true" |
EnableRowHoverStyle="true" > |
<Selecting AllowRowSelect="true" /> |
</ClientSettings> |
</telerik:RadGrid> |
protected void buttonChangeLead_Click(object source, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e) |
{ |
string StageID = e.Value; |
//Need the parent grids datakeynames "Link_ID" of the row that i changed |
} |