Telerik Forums
UI for ASP.NET MVC Forum
1 answer
148 views
Currently the MVC helpers will generate an anchor tag with a local href for each tab in the tab strip (e.g. #actions-1, #actions-2), and will generate the subsequent id for each content pane. If the tab strip is the first element on the page, this works ok, but if there is content above the tab strip, then when changing tabs the page will scroll until the tabstrip is at the top of the page, and then scroll back down once the new tab has been loaded. This is a bit jarring and only seems to happen when using Internet Explorer. When using plain html and javascript, local hrefs are not generated. Is there a reason they are generated for the MVC helpers, and are they necessary?
Petur Subev
Telerik team
 answered on 02 Apr 2014
1 answer
129 views
Hi, From one of the example in kendo documentation, when i am trying the same i am unable to bind the data to the scheduler ui, it shows no error but only 500 internal server error. here is my code, I am using mvc 3 razor with EF.

public class Projection : ISchedulerEvent
    {
        public string Title { get; set; }
        public DateTime Start { get; set; }
        public DateTime End { get; set; }
        public string Description { get; set; }
        public bool IsAllDay { get; set; }
        public string Recurrence { get; set; }
        public string RecurrenceRule { get; set; }
        public string RecurrenceException { get; set; }

        public string EndTimezone { get; set; }
        public string StartTimezone { get; set; }
    }

[HttpGet]
        public ActionResult Read()
        {
            List<Projection> cinemaSchedule = new List<Projection> {
                new Projection {
                    Title = "Fast and furious 6",
                    Start = new DateTime(2014,3,31,17,00,00),
                    End= new DateTime(2014,3,31,18,30,00)
                },
                new Projection {
                    Title= "The Internship",
                    Start= new DateTime(2014,3,31,14,00,00),
                    End= new DateTime(2014,3,31,15,30,00)
                },
                new Projection {
                    Title = "The Perks of Being a Wallflower",
                    Start =  new DateTime(2014,3,31,16,00,00),
                    End =  new DateTime(2014,3,31,17,30,00)
                }};
            return Json(cinemaSchedule, JsonRequestBehavior.AllowGet);
        }

@(Html.Kendo().Scheduler<Uco.Models.Projection>()
    .Name("scheduler")
    .Date(new DateTime(2014, 3, 31))
    .StartTime(new DateTime(2014, 3, 31, 7, 00, 00))
    .Height(600)
    .Views(views =>
    {
        views.DayView();
        views.WeekView(weekView => weekView.Selected(true));
        views.MonthView();
    })
    .Timezone("Etc/UTC")
    .BindTo(Model)
)

Can any one help with where i am wrong. I am new to telerik. Thanks in advance




Georgi Krustev
Telerik team
 answered on 02 Apr 2014
1 answer
85 views
Hi i am new to telerik, i am very much confused how to use telerik scheduler controll in my MVC 3 project. I am using Razor for developing my project. Can any one please give any reference of step by step procedure for integrating scheduler in my project.
Thanks in advance..
Atanas Korchev
Telerik team
 answered on 02 Apr 2014
1 answer
146 views
Although the UI for ASP.NET MVC Grid ships with a set EditorTemplates out of the box, there does not appear to be an EditorTemplate for guids.

There are EditorTemplates for integer, number, currency, etc but not for guid.

Any reason why there is not any official Telerik EditorTemplate for guids?

So what's Telerik's recommended best practice?  Create our own EditorTemplate?  Convert back/forth between guids and strings in our ViewModels?
Atanas Korchev
Telerik team
 answered on 02 Apr 2014
3 answers
309 views
Hi,

I am having problems getting the GeoJSON map example working. I have used the same code and there are no errors and the navigation icons on top left are displayed but I can't see any map. The map control works perfectly for Bing so I know that is working.

I assume the issue is related to JSON file I am using. Can I please get a download of the GeoJSON file "~/Content/dataviz/map/countries-users.geo.json" used the example? or a download of the example GeoJSON project.

I am using IE10 latest KendoUI and VS2012.

Thanks

Rob
T. Tsonev
Telerik team
 answered on 01 Apr 2014
10 answers
1.0K+ views
Can the upload control be used in an ajax form within a partial view?  If so can I have an example?  I can make the upload work on a html form but in the ajax form the controller method that is being posted to receives a NULL for the HttpPostedFileBase file parameter.
Stephen
Top achievements
Rank 1
 answered on 01 Apr 2014
3 answers
123 views
This feels like it should be a simple question, but I can't find the answer anywhere.

If a user clicks the remove button (x) on the only file in an upload list, the file is removed from the list and the 'upload' button is hidden. How can I simulate this?

I'm overriding the 'onselect' event and checking for existing files in a directory. If the user selects 'no, I don't want to replace the existing file', I'm removing the item from the upload list successfully, but if it's the only file in the list, I'm left with the button and a border around the empty list.

Thanks in advance.
Dimiter Madjarov
Telerik team
 answered on 01 Apr 2014
3 answers
268 views
I tried this solution (http://www.telerik.com/support/code-library/submit-form-containing-grid-along-with-other-input-elements), for posting a grid inside an html forum and work correctly.
But if I have a grid with checkboxes I don't understend how I can the true or false value.

I've tried this solution, but doesn't work.

columns.Bound(p => p.Inside).ClientTemplate(
"<input type='checkbox' #= (Inside=== true) ? checked : '' # />" +
"<input type='hidden' name='CAB[#= indexCAB(data)#].Inside' value='#= Inside#' />");

Someone can help me.

Thanks
Daniel
Telerik team
 answered on 01 Apr 2014
1 answer
265 views
Hi,

I have the following kendo grid in my page:

@(Html.Kendo().Grid<Di.Service.Tracking.Models.DomainObjects.DTrackingFileEvent>()
 .Name("fileAuditing")
 .Columns(columns =>
{
columns.Bound(c => c.IsError);
columns.Bound(c => c.EventDateTime).Title(@Di.Nls.Label.Event_Date_Time);
columns.Bound(c => c.Details).Title(@Di.Nls.Label.Details);
columns.Bound(c => c.Description).Title(@Di.Nls.Label.Description);
columns.Bound(c => c.Result).Title(@Di.Nls.Label.Result);
})
.ClientRowTemplate(
"<tr bgcolor=#:IsError ? 'Pink' : 'White'# data-uid='#: uid #'>" +
  "<td>" +
  "# if(IsError == true) {# " +
"<img src='/Images/FileState/Error.gif' />" +
"#} else {# " +
"<img src='/Images/FileState/Ok.gif' />" +
"#}#" +
  "</td>" +
  "<td>#: EventDateTime #</td>" +
  "<td>#: Details #</td>" +
  "<td>#: Description #</td>" +
  "<td>#: Result #</td>" +
"</tr>"
)
.DataSource(dataSource => dataSource
.Ajax()
.Model(model => model.Id(p => p.ID))
.Read(read => read.Action("FileAuditingDetails", "FileDetails", new { iFileID = iFileID }))
.Events(e=>e.RequestEnd("onRequestEnd"))
)
)

<script>
function onRequestEnd(e) {
  //do something with event date time
}
</script>

My goal is to format the "Event date time" column so it provides a value based on the user time zone info. In order to do that I wanted to handle the "requestEnd" event, but when I do that I cannot see any data on the grid.

Removing the following line .Events(e=>e.RequestEnd("onRequestEnd")) load all the data correctly.

Any ideas how to achieve my goal?
Alexander Popov
Telerik team
 answered on 01 Apr 2014
1 answer
165 views
Hi there,

I am just getting to grips with WebApi and how to use them with the MVC wrappers. But I am at a loss on how to ensure that the authentication is working correctly as part of the project.

My scenario is I have front end website (www.myfrontendwebsite.com) which is running on one server and then I have the service website with all my Business logic running on a webapi back end website (www.mywebapiwebsite.com) this may/ may not be running on a separate website.

I am forcing my users to log in to ensure that they can access only the parts of the sites they should have.

Obviously with the web api project this needs to be protected as well so I need the user to be authenticated.

Now I am  trying to do something like this with a combobox:


Html.Kendo().ComboBox()
.Name("DateSetup")
.Suggest(true)
.Filter(FilterType.Contains)
.DataSource(data =>
{
data.Read(read => read.Url("http://localhost:59236/api/GenericReport/GetDateFilterTypes"));
})
.Placeholder("Select date setup")


so I know I need to add some additional information to the header that is being provided but how can I do that from the read.Url method? Do I do this via adding .Data afterwards or is there another way of do it.

I have already enabled CORS to work as this works when I an using allow annoynomous.

Thanks in advance.


                      .HtmlAttributes(new { style = "min-width:100%;" })

Daniel
Telerik team
 answered on 01 Apr 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?