Telerik Forums
UI for ASP.NET MVC Forum
3 answers
116 views
I am using the Kendo UI Upload control with the Knockout-Kendo.js project's binders.  I have a file upload control on my form and am seeking to upload the file through the ajax callback provided by the Knockout-Kendo.js api.  Most of the time, the upload goes through successfully, but every once in a while, so far only on IE, there's an issue and I get a javascript error saying "SCRIPT5: Access is denied."   I've read that IE9 has security rules that can cause this error in certain situations, but I do not understand well enough how the kendo ui control works (or how the knockout-kendo library works) to understand what I might need to change to prevent the error.  Any ideas will be very much appreciated!

Here is a simplified version of my code:
In the view:
<input name="fileUpload" type="file" id="fileUpload" data-bind="kendoUpload: $root.fileUploadSettings()" />

In the javascript viewmodel:
var fileCategory = "myCategory";
 
fileUploadSettings = function () {
        var kendoSettings = {
            multiple: false,
            enabled: true,
            async: { saveUrl: "../Entity/AddFiles" },
            success: function (e) { _uploadFileSuccess(e, fileCategory); },
            error: function (e) { _uploadFileError(e, fileCategory); },
            select: function (e) { _uploadFile(e, fileCategory); },
            localization: { select: "Upload File" },
        };
In the MVC controller: 
[HttpPost]
public ActionResult AddFiles(File data, System.Web.HttpPostedFileBase fileUpload)
{
    try
    {
        File file = FileUIService.AddFile(data, fileUpload);
        FileView rfv = new FileView()
        {
            Id = file.Id,
            Name = fileUpload.FileName.Substring(fileUpload.FileName.LastIndexOf('\\') + 1)
        };
 
        return Json(rfv, "text/plain");
    }
    catch (Exception ex)
    {
        return Json(ex.Message, "text/plain");
    }
}
Daniel
Telerik team
 answered on 10 Jul 2013
0 answers
44 views
Please refer the attached file.
Prasad
Top achievements
Rank 1
 asked on 09 Jul 2013
3 answers
1.6K+ views
I'm trying to change the color of the grid command button but the CSS is not taking effect.  The CSS is being called because the font size is changing.  The color is not for some reason.  Any ideas.


CSS:
.editButtonChangeColor
{
background-color: Red;
color: Red;
border-color: Red;
font-size: 20px;
}

Databound function of grid:
$(".k-grid-edit").addClass("editButtonChangeColor");
Dimiter Madjarov
Telerik team
 answered on 09 Jul 2013
2 answers
221 views
I looked at the code sample at http://www.kendoui.com/code-library/mvc/grid/export-grid-to-excel.aspx
It uses AJAX binding.
Can this be done using server binding? I am having some issues with ajax binding.

Thanks

Jagdish
Top achievements
Rank 1
 answered on 08 Jul 2013
1 answer
48 views
The Model has 4 properties, Description, Amount, Note and a boolean, NoteRequired.
I have a grid with 3 columns, Description, Amount and Note.  
If NoteRequired is True for a row and the Amount > 0, how do I show them a message that a Note is Required and set the focus in the Note field?

Dimo
Telerik team
 answered on 08 Jul 2013
5 answers
148 views
I created MVC 3 web application and then convert it to Kendo UI for ASP.NET MVC application. Plz see attached project.

There is a simple grid on index page, add new item button is on grid toolbar, edit and destroy buttons are in column.

I could add new row successfully, but when I try to edit existing row, another create action is posted again. Refresh page, two rows in grid. the same thing happens when I try to delete a row.

Why? Am I missing anything there?

Please advise.
Jason
Top achievements
Rank 1
 answered on 08 Jul 2013
0 answers
90 views
hello all, 
i need to work on new project and we are planning to have rich data grid functionality. i searched for telerik controls for Data Grid and came to this Kendo UI . our platform would be Asp.net Mvc4. please help.
Sandeep
Top achievements
Rank 1
 asked on 08 Jul 2013
2 answers
218 views
I have a panelbar in which the content is loaded via ajax.

I would like to reload the content based on the change event in a dropdown list.  However, it doesn't appear that I can do this.

I tried the reload() method on the panelbar object but it didn't do anything so I figured there was some caching involved.

Can I trigger a reload to occur?

Below is my client-side code and the panelbar.

thanks
var panelbar = $("#HomePanelBar").data("kendoPanelBar");
panelbar.reload();
 
 @(Html.Kendo().PanelBar()
        .Name("HomePanelBar")
        .HtmlAttributes(new { style = "width:400px;" })
        .ExpandMode(PanelBarExpandMode.Single)
        .Items(panelBar =>
        {
            panelBar.Add()
                .Text("Notification")
                .HtmlAttributes(new { id = "item1" })
                .Expanded(true)
                .LoadContentFrom("_Announcement", "Help");
        })
    )
 


William Dunn
Top achievements
Rank 1
 answered on 08 Jul 2013
3 answers
263 views
Hej

Im trying to use the Kendo Grid for a minor project, where i want to show the column summary in the groupheader. But I cant get it to Work :-(. When i use the Groupfooter, then it works fine.

Anyone got any suggestions?

************************************************************************************
@(Html.Kendo().Grid((IEnumerable<FTEReport>)ViewBag.Test) 
     .Name("grid")
     .Columns(columns =>
{
 columns.Bound(FTEReport => FTEReport.Jan)
.ClientGroupHeaderTemplate("#=sum#");

columns.Bound(FTEReport => FTEReport.Feb)
.ClientGroupFooterTemplate("#=sum#"); 
}
 .DataSource(ds => ds.Ajax()
.Aggregates(aggregates =>
{
aggregates.Add(p => p.Jan).Sum();
aggregates.Add(p => p.Feb).Sum();
 })
.Group(g =>
{
g.Add(c => c.Allocated);
g.Add(c => c.Project);
g.Add(c => c.Department);
})
.Read(read => read.Action("Aggregates_Read", "grid"))
 )
)

Regards
Lennart
Vladimir Iliev
Telerik team
 answered on 08 Jul 2013
2 answers
165 views
I use a splitter with a left and a right pane within a window widget. If I create the window with “Visible(true)” everything works as it should.
But since the window is supposed to be displayed, when the user clicks on a button, I have to use “Visible(false)” and make it visible after the click occurred.
 In this case the given pane size of the left pane seems to be ignored and the right pane is not displayed at all(see attached picture).

After manual resize of the splitter, it seems to work. But when I close the window and reopen it via Javascript, the size parameter is still ignored. Instead the
manual chosen size is used. It makes no difference if I use Ajax Loading or direct rendering. My Code:

Window:
@( Html.Kendo().Window()
       .Name("popupSplitter")
       .Title("Popup Splitter")
       .Draggable(true)
       .Modal(true)
       .Content(
           @<text>
<div>
    @RenderSplitter()
</div>
    </text>
)
        .Width(600)
        .Height(450)
        .Visible(false)
)
Splitter:
@helper RenderSplitter()
{
   @Html.Kendo().Splitter()
   .Name("MySplitter")
   .Orientation(SplitterOrientation.Horizontal)
   .HtmlAttributes(new { style = "width: 100%; height: 400px; " })
   .Panes(hPanes =>
       {
            hPanes.Add()
                  .Size("200px")
                  .MinSize("100px")
                  .Content(
                      @<text>
                           @RenderTreeView()
  </text>
                  )
                  .HtmlAttributes(new { id = "left_pane" });
 
            hPanes.Add()
                  .Scrollable(true)
    .HtmlAttributes(new { id = "right_pane" });
                  .Content(
                      @<text><p>test</p></text>
                );
        })
}
Button:
<button class="k-button" id="btnAdd" onclick="addSomething()"><span class="k-icon k-add"></span></button>
Javascript:
function addSomething() {
        var window = $("#popupSplitter ").data("kendoWindow");
        window.center();
        window.open();
}

Am I missing something here?
KRichter
Top achievements
Rank 1
 answered on 08 Jul 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?