Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Apr 10, 2012 11:58 AM by ashok4v
Member
2 Points
46 Posts
Apr 10, 2012 10:11 AM|LINK
Hi to All ,
am doing a razor mvc3 app.in this am using Telerik grid. i want to to get drodownlist in editing. for this am doing like below
my control code:
-------------------------
public ActionResult sample2() { ViewBag.Name = from i in entity.EMPs select i.ENAME; return View(entity.EMPs.ToList()); }
...................view...............................
Columns(columns => { columns.Bound(p => p.EMPNO).ReadOnly().Width(100); columns.Bound(p => p.ENAME).Width(400); columns.Bound(p => p.DEPTNO).ClientTemplate("<#= OptionalEmail #>");
.............................EditorTemplates (in my view floder)................................
@model string
@( Html.Telerik().DropDownListFor(e => e).BindTo(new SelectList(ViewBag.Name)) )
but am not getting drop down in editting . how to do it plz help me.
220 Points
58 Posts
Apr 10, 2012 10:58 AM|LINK
Hi chenna008,
Did you provide UIHint for your model property i.e., you need to provide the name of your editor template as UIHint to your model property.
for example if "ENAME" is model property where your drop down should display you need to update your model as follows
[UIHint("here type the name of your editor temaplate")] public string ENAME{ get; set; }
Thanks,
Ashok
Apr 10, 2012 11:21 AM|LINK
s i given lke that only.
Apr 10, 2012 11:40 AM|LINK
Can you mention if you are getting any errors?
Apr 10, 2012 11:54 AM|LINK
Am not getting an error also.
public ActionResult sample2() { ViewBag.ENAMEss = from i in entity.EMPs select i.ENAME; // return View(entity.EMPs.ToList());// is there any issue if we give lke this. }
Apr 10, 2012 11:58 AM|LINK
Go through this telerik demo link for binding drop down on edit
http://demos.telerik.com/aspnet-mvc/razor/grid/clientedittemplates
this might help you
chenna008
Member
2 Points
46 Posts
telerik grid with ddl
Apr 10, 2012 10:11 AM|LINK
Hi to All ,
am doing a razor mvc3 app.in this am using Telerik grid. i want to to get drodownlist in editing. for this am doing like below
my control code:
-------------------------
public ActionResult sample2()
{
ViewBag.Name = from i in entity.EMPs
select i.ENAME;
return View(entity.EMPs.ToList());
}
...................view...............................
Columns(columns =>
{
columns.Bound(p => p.EMPNO).ReadOnly().Width(100);
columns.Bound(p => p.ENAME).Width(400);
columns.Bound(p => p.DEPTNO).ClientTemplate("<#= OptionalEmail #>");
.............................EditorTemplates (in my view floder)................................
@model string
@(
Html.Telerik().DropDownListFor(e => e).BindTo(new SelectList(ViewBag.Name))
)
but am not getting drop down in editting . how to do it plz help me.
ashok4v
Member
220 Points
58 Posts
Re: telerik grid with ddl
Apr 10, 2012 10:58 AM|LINK
Hi chenna008,
Did you provide UIHint for your model property i.e., you need to provide the name of your editor template as UIHint to your model property.
for example if "ENAME" is model property where your drop down should display you need to update your model as follows
[UIHint("here type the name of your editor temaplate")]
public string ENAME{ get; set; }
Thanks,
Ashok
(Don't forget to click "Mark as Answer" on the post(s) that helped you.)
chenna008
Member
2 Points
46 Posts
Re: telerik grid with ddl
Apr 10, 2012 11:21 AM|LINK
s i given lke that only.
ashok4v
Member
220 Points
58 Posts
Re: telerik grid with ddl
Apr 10, 2012 11:40 AM|LINK
Can you mention if you are getting any errors?
(Don't forget to click "Mark as Answer" on the post(s) that helped you.)
chenna008
Member
2 Points
46 Posts
Re: telerik grid with ddl
Apr 10, 2012 11:54 AM|LINK
Am not getting an error also.
public ActionResult sample2()
{
ViewBag.ENAMEss = from i in entity.EMPs
select i.ENAME;
//
return View(entity.EMPs.ToList());// is there any issue if we give lke this.
}
ashok4v
Member
220 Points
58 Posts
Re: telerik grid with ddl
Apr 10, 2012 11:58 AM|LINK
Go through this telerik demo link for binding drop down on edit
http://demos.telerik.com/aspnet-mvc/razor/grid/clientedittemplates
this might help you
Thanks,
Ashok
(Don't forget to click "Mark as Answer" on the post(s) that helped you.)