I am using the RadGrid control with EditMode="InPlace". I have a dropdown and following the example as below:
http://www.telerik.com/help/aspnet/grid/grdoperationswithdropdownlistinedititemtemplate.html
Using the GridDropDownColumn did not work well with my custom datasource. Thats why I am using the above link as a sample
<
Columns>
<telerik:GridEditCommandColumn ButtonType="ImageButton" HeaderStyle-CssClass="edit" ItemStyle-CssClass="edit" />
<telerik:GridBoundColumn DataField="Name" ReadOnly="True"
HeaderText="Header1" />
<telerik:GridTemplateColumn DataField="Description" HeaderText="Header2" >
<ItemTemplate>
<asp:Label id="Label1" runat="server">
<%
# DataBinder.Eval(Container.DataItem, "Description")%>
</asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList id="drpDown" runat="server" />
</EditItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
I am populating the dropdowon on edit mode as below:
if (e.Item is GridEditableItem && e.Item.IsInEditMode)
{
GridEditableItem item = e.Item as GridEditableItem;
// access/modify the edit item template settings here
DropDownList dropDownList = item.FindControl("drpDown") as DropDownList;
dropDownList.DataSource = reactions;
dropDownList.DataTextField =
"description";
dropDownList.DataValueField =
"id";
PatientAllergy paRowData = (e.Item.DataItem as PatientAllergy);
if (paRowData != null)
{
if ((paRowData.Description!= null))
dropDownList.SelectedValue = paRowData.Id;
}
dropDownList.DataBind();
}
fine. I have two outstanding questions:
I want to achive the the batch update with inline editing
1. How do I collapse the editable row when I click outside of the row.
2. How do I keep track of edited rows. Does Telerik has a implematioan for this. the below example does it only with client side and ondoubleclick editing. But I want to achieve with EditMode="InPlace". I want to do inline editing when the Edit button is clicked for the particular row. Please point me the direction.
http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/clienteditbatchupdates/defaultcs.aspx