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

[Solved] Grid batch editing with dropdownlist control

0 Answers 113 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ruckumane
Top achievements
Rank 1
Ruckumane asked on 29 Mar 2012, 11:13 AM
can anyone tell me how to implement grid batch editing with dropdown control? I want to edit dropdown control implemented as client template. But it is changed to textbox when edit is set to incell.

my view code is:

<%

 

: Html.Telerik().Grid<SystemFeedStatusSample.Models.GetNLAggrTrades_Result>()

 

.Name(

 

"NotelineFeedAggrGrid")

 

.DataKeys(dataKeys => dataKeys.Add(p => p.IssueID))

.ToolBar(commands =>

{

commands.Insert();

commands.SubmitChanges();

})

.ClientEvents(events => events.OnRowDataBound(

 

"OnRowDataBound"))

 

.ClientEvents(events => events.OnDataBinding(

 

"onDataBinding"))

 

.Editable(editing => editing.Mode(

 

GridEditMode.InCell).DefaultDataItem(new SystemFeedStatusSample.Models.GetNLAggrTrades_Result

 

{

 

 

//LastSupply = DateTime.Today

 

}))

.Columns(columns =>

{

columns.Bound(c => c.TrancheID).Width(80);

columns.Bound(c => c.Split).Title(

 

"Split").ClientTemplate(Html.DropDownList("Split", (SelectList)(ViewData["Split"])).ToHtmlString()).Width(180);

 

 

columns.Bound(c => c.Split).Width(290).Title(

 

"Split").HeaderHtmlAttributes(new { style = "text-align:center" });

 

 

 

//columns.ForeignKey(c => c.Split, (SelectList)ViewData["Split"]).Title("Program<br/>Sponsor").Width(290);

 

 

columns.Bound(c => c.SellerID).Title(

 

"Seller ID").ClientTemplate(Html.DropDownList("SellerID", (SelectList)(ViewData["SellerID"]))

 

.ToHtmlString()).Width(180);

columns.Bound(c => c.IssuanceDate).Width(130);

columns.Bound(c => c.MaturityDate).Width(120);

columns.Bound(c => c.NetProceeds).Width(80);

columns.Bound(c => c.TodaysIssuance).Width(60);

columns.Bound(c => c.TradeType).Title(

 

"Tranche Type").ClientTemplate(Html.DropDownList("TrancheType", (SelectList)(ViewData["TrancheType"]))

 

.ToHtmlString()).Width(180);

columns.Bound(c => c.Dealer).Width(120);

columns.Bound(c => c.IntDiscRate).Width(120);

columns.Bound(c => c.InterestType).Title(

 

"Int Type").ClientTemplate(Html.DropDownList("InterestType", (SelectList)(ViewData["InterestType"]))

 

.ToHtmlString()).Width(180);

columns.Bound(c => c.AccrualType).Title(

 

"Accrual Type").ClientTemplate(Html.DropDownList("AccrualType", (SelectList)(ViewData["AccrualType"]))

 

.ToHtmlString()).Width(180);

columns.Bound(c => c.Ind1Code).Title(

 

"Index 1 Code").ClientTemplate(Html.DropDownList("Index1Code", (SelectList)(ViewData["IndexCode1"]))

 

.ToHtmlString()).Width(180);

columns.Bound(c => c.Ind2Code).Title(

 

"Index 2 Code").ClientTemplate(Html.DropDownList("Index2Code", (SelectList)(ViewData["IndexCode2"]))

 

.ToHtmlString()).Width(180);

columns.Bound(c => c.NLBatchID).Width(130).Visible(

 

false);

 

columns.Bound(c => c.AdjIntFlag).Width(130).Visible(

 

false);

 

columns.Bound(c => c.InsertedFlag).Width(130).Visible(

 

false);

 

columns.Bound(c => c.NumSpilts).Width(130).Visible(

 

false);

 

 

 

//columns.Command(commands => commands.Edit());

 

})

.DataBinding(dataBinding => dataBinding.Ajax()

.Select(

 

"_NotelineAggrTrades", "Grid")

 

.Update(

 

"_update", "Grid")

 

.Insert(

 

"_InsertAjaxEditing", "SystemFeedStatus"))

 

.Scrollable(c => c.Height(

 

"400px"))

 

 

 

//.ClientEvents(events => events.OnEdit("onEdit"))

 

.Sortable()

.Pageable()

%>


The foreignkey is not supported in our version. so please tell me some other solution.

Tags
Grid
Asked by
Ruckumane
Top achievements
Rank 1
Share this question
or