Telerik Forums
UI for ASP.NET MVC Forum
4 answers
1.5K+ views
Anyone know how I can display a utc date/time I'm getting from my server as the user's local time? I'm putting this date/time in a ClientRowTemplate if that matters. 
Radoslav
Telerik team
 answered on 09 Sep 2015
1 answer
492 views
Hello,
I have a problem with setting the selection color in Kendo Editor in inline mode.
What I've discovered is that if a text inside the editor is not formatted everything is fine (meaning, selecting text with mouse highlight it with system defined color). Eveything breaks when add some styling. Bolding or underscoring text results in while color when selecting text.

I've observed the same issue on Components page (http://demos.telerik.com/kendo-ui/editor/inline-editing)

What could be the solution for this issue?
Dimo
Telerik team
 answered on 09 Sep 2015
4 answers
404 views
I'm trying to add a sparkline column into a grid.
I've tried using a client template to do this, but it just shows [object HTMLScriptElement] in the column, rather than the chart.

I have a template:-
<script id="sparkTemplate" type="text/kendo-tmpl">
 
     @(Html.Kendo().Sparkline()
                        .Name("temp-log_#=ID#")
                        .Type(SparklineType.Column)
                        .Tooltip(tooltip => tooltip.Format("{0} °C"))
                         
                        .Data(ViewBag.TemperatureData)
                        .ToClientTemplate()
               )
 
</script>
This doesn't yet have pass any parameters to the controller - but obviously this will be needed as well.
The grid is:-
        @(Html.Kendo().Grid<CMS_2013.Models.CMSSummaryOne>()
.Name("tabGrid")
.Columns(columns=>
    {columns.Bound(p=>p.DivisionName).Title("Division");
    columns.Bound(p => p.Specialty).Title("Specialty");
    columns.Bound(p => p.Activity).Title("Activity");
    columns.Bound(p => p.Plan).Title("Plan");
    columns.Bound(p => p.Variance).Title("Variance").ClientTemplate("#= formatNumber(Variance) #");
    columns.Bound(p => p.Variance).Title("Variance").ClientTemplate("#=sparkTemplate#");
    })
     
     
   
    .Pageable()
    .Sortable()
    .Selectable()
 
    .DataSource(dataSource=>dataSource
        .Ajax()
        .PageSize(5)
         
        .Read(read=>read.Action("GetTableData","Dashboard")
        .Data("chartFilter")
        )
        )
         
   
       )

What's the best way to embed a chart into a column - I specifically want the chart in a column and not a detail template - something a sparkline looks ideal for.

Thanks
Dimiter Madjarov
Telerik team
 answered on 08 Sep 2015
3 answers
48 views

Hello

I have a grid displaying workitems and the last action taken for a workitem, recently I discovered that I need to extend this to include a history of actions stored in a separate table in the db.

the two tables looks like this:

workItem
id
name
lastActionDate
lastActionText

workAction
id
workItemID
actionDate
ActionText

My model currently looks like this:

public class workItemModel
    {
        public int id { get; set; }
        public string name{ get; set; }
        public DateTime lastActionDate{ get; set; }
        public string lastActionText{ get; set; }
    }

and my read action for the grid looks like this:

public ActionResult workItems_Read([DataSourceRequest]DataSourceRequest request)
        {
            return Json(GetWorkItems().ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
        }
 
        private static IEnumerable<workItemModel> GetWorkItems()
        {
            var wimDB = new wimDB_DEVEntities();
            return wimDB.workItem.Select(wiModel => new workItemModel
            {
                id = wiModel.id,
                name = wiModel.name,
                lastActionDate = wiModel.lastActionDate,
                lastActionText= wiModel.lastActionText
            });
        }
 

How do I extent my model and my read action to include the workAction table from the db?

/Jonas

Jonas
Top achievements
Rank 1
 answered on 08 Sep 2015
1 answer
90 views

Hi ,

   We are planning to switch the project from  Silverlight to MVC , So we need Telerik MVC supporting dlls .
Could you please tell me where I have to found those dlls  , I have downloaded UI for ASP.net MVC from Telerik site but I could not found any MVC dll’s  .
Can you please tell me from where I can get those dll’s .

 

Thanks

Victor

Sebastian
Telerik team
 answered on 08 Sep 2015
6 answers
2.1K+ views
Hello

I have a grid showing data (registrations) with the possibility to edit this data.
Each registration stores information about a region, stored in the DB as forgein key regionId for each registration.

When I edit a registration I want a dropdown for choosing region with the current region selected. The dropdown gets its values from the region table in the DB.
As I load the dropdown I think I loose the registration model and it gets replaced by the region model and thus I have no access to the regionId for the registration anymore, how can I get hold of the regionId value in the dropdown?

My editTemplate:
@model regDB.Models.registration
 
@Html.HiddenFor(model => model.id)
 
<div>
    @Html.EditorFor(model => model.regionId)
</div>
 
<div style="width: 250px;">
    @(Html.Kendo().DropDownList()
          .Name("Regions")
          .HtmlAttributes(new { style = "width: 250px" })
          .DataTextField("name")
          .DataValueField("id")
          .Value(model.regionId)
          .DataSource(source =>
          {
              source.Read(read =>
              {
                  read.Action("GetRegions", "Home");
              });
          })
    )
</div>
 and the GetRegions code:
public JsonResult GetRegions()
        {
            var regDB = new regDB_DEVEntities();
            regDB.Configuration.ProxyCreationEnabled = false;
            return Json(regDB.region, JsonRequestBehavior.AllowGet);
        }
If I remove the ProxyCreationEnabled, I'll get a circular reference error.

I hope you understand my question, otherwise i'll have to try to explain some more

/Jonas
Georgi Krustev
Telerik team
 answered on 08 Sep 2015
5 answers
110 views

Dear Telerik Community,

 I've recognized some weird behavior of the DatePickerWidget when switching from one month to another. You can take a look at the screen shot to see exactly what I'm talking about. I don't know if this already came up to somebody of you - I hope it did so someone can help me fix it.

 Kind regards,

Thomas

Iliana Dyankova
Telerik team
 answered on 07 Sep 2015
14 answers
124 views
Is there an beta/test UI for ASP.NET MVC for vNext (aka MVC 6)? Our team is starting to develop an .NET MVC 5 application, however, the concern is that by the time the product reaches a mature development stage, it will be immediately depreciated by MVC6.
T. Tsonev
Telerik team
 answered on 07 Sep 2015
1 answer
57 views

Hello,

I need to use my viewmodelpage in my read action of kendo mvc grid. This my codes :

#Controller

 VolViewModel model;

public ActionResult Index()
{
model = new VolViewModel { Item = new List<Vol>() };
model.Item = _volBusiness.GetAllVol();
return View(model);
}

[System.Web.Mvc.AcceptVerbs(HttpVerbs.Post)]
public ActionResult Read([DataSourceRequest]DataSourceRequest request)
{
var result = model.Item;
return Json(result.ToDataSourceResult(request));
}

 

#Index.cshtml

.DataSource(dataSource => dataSource
.Ajax()
.ServerOperation(false)
.PageSize(15)
.Model(model =>
{
model.Id(m => m.VolId);
})
.Read(read => read.Action("Read", "Vol")
)

 

Thanks,

Viktor Tachev
Telerik team
 answered on 07 Sep 2015
1 answer
182 views

I have a Telerik MVC extension project that use CookieLocalizationModule to change language used in the application. It works fine and is setup in Web.Config as

        <httpModules>
            <add name="CookieLocalizationModule" type="OTP.Ring.Web.CookieLocalizationModule, OTP.Ring.Web" />
        </httpModules>

But after upgrade to Kendo, it is no longer working. So I want to know how to set CookieLocalizationModule in Kendo. Thanks.

Kiril Nikolov
Telerik team
 answered on 07 Sep 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?