Telerik Forums
UI for ASP.NET MVC Forum
2 answers
262 views
with an input tag I can use a fontawesome icon in the placeholder use the following " find your school"
but with autocomplete this does not show as an icon.
I assume there is some sort of encoding going on, how can I get around this? thanks
Alan Mosley
Top achievements
Rank 1
 answered on 11 Feb 2015
1 answer
110 views
I'm trying to enable the ShowLineImages property for ASP.NET MVC TreeView.

How can I do this?
Iliana Dyankova
Telerik team
 answered on 11 Feb 2015
1 answer
196 views
I am implementing Kendo Editor with image and file browser capabilities.

I have followed the example in demos, and have run into a problem.

Image browser works fine when I use gif or jpeg files, but if I try to use a bmp file, I get a 403 error.

For file browser, I am unable to get a simple xls file to upload without a 403 error.

I know the code is working, as I can upload gif and xls files.  Is there another configuration change or other piece of code that is not included in the Demo that needs to be added for me to change the file types accepted by the browser?

I tried the following:
                   .FileTypes(".bmp,.jpg,.jpeg,.gif,.png")

While that does restrict what the user can attempt, it doesn't allow me to use the file types I need.
Abradax
Top achievements
Rank 1
 answered on 09 Feb 2015
2 answers
294 views
The objects that are enumerated in my Kendo MVC Grid are of type dynamic:

@(Html.Kendo().Grid<dynamic>()
...

I am using InLine editing.  I am able to specify the editor for each of my fields as described here:

http://www.telerik.com/forums/inline-editing-mode-and-dynamic-object
http://docs.telerik.com/kendo-ui/aspnet-mvc/helpers/grid/editor-templates

I won't reiterate the approach that is described above, but in summary it involves adding a UIHint attribute to fields in the model, and then using EditorTemplateName to identify an editor template for the field (and that editor template refers to the field via the Name() method).  This works.

The problem that I have is that many of my fields need to appear in non-editable columns.  My hope was that I could get the grid to render those fields as is (no editor) by:

a. Omit the UIHint attribute from model properties that would not be editable
b. Not specify an EditorTemplateName for non-editable bound columns
c. Set Editable(false) when defining the model (as below):

.DataSource(d =>
{
     d.Ajax()
        .Model(m =>
         {
             m.Id("Id");
             m.Field("Name", typeof(string)).Editable(false);

However, when I do this the grid fails to load and I see an exception in Fiddler:

[RuntimeBinderException: 'object' does not contain a definition for 'Name']
   CallSite.Target(Closure , CallSite , Object ) +152
   System.Dynamic.UpdateDelegates.UpdateAndExecute1(CallSite site, T0 arg0) +662
   lambda_method(Closure , Object ) +133
   Kendo.Mvc.UI.Html.GridDataCellBuilder`2.AppendCellContent(IHtmlNode td, Object dataItem) +131
   Kendo.Mvc.UI.Html.GridDataCellBuilderBase.CreateCell(Object dataItem) +230

I have many fields and most of them wil be non-editable, so I would rather not, for example, create editor templates for each of them that contain disabled controls.

What is the best way to configure all my non-editable columns in an InLine grid that is bound to dynamic objects?

thanks,
Derek
Derek
Top achievements
Rank 1
 answered on 06 Feb 2015
1 answer
291 views
Hi,

I'm binding my grid to a DataTable for displaying dynamic search results. I've followed the example on how to do binding with DataTable, but I was wondering if there is a way to reference a different column in the Template / ClientTemplate. I've tried what I regularly do when bound to a Model/ViewModel, but it doesn't seem to work for DataTables. I've tried both

This is what my grid looks like:

@(Html.Kendo().Grid(Model.Result.Data)
    .Name("gridSearchResults")
    .Columns(columns =>
    {
        foreach (System.Data.DataColumn column in Model.Result.Data.Columns)
        {
            if (column.ColumnName != "Id")
            {
                if (column.ColumnName == "Name")
                {
                    columns.Bound("Name").Template(@<text><a href='" + Url.Action("Details", Model.Result.DataSource) + "/#= Id #'" + ">#= Name #</a></text>);
                }
                else
                {
                    columns.Bound(column.ColumnName);
                }
            }
        }
    })
    .DataSource(d => d
        .Server()
        .Model(m => {
            m.Id("Id");
            foreach (System.Data.DataColumn column in Model.Result.Data.Columns)
            {
                m.Field(column.ColumnName, column.DataType);
            }
        })
    )
)

Model.Result.Data is of type DataTable. It renders all the columns fine, but I'd like the name column to be a hyperlink to the details page.. Any suggestions?

Thank you 
Katia
Top achievements
Rank 1
 answered on 06 Feb 2015
4 answers
196 views
All, 

Please see the following video: http://www.screencast.com/t/9UbonHDdPK0 . 

In this video it shows that the Drop Down list will close after the scroll bar has been clicked in order to go to a hidden portion of the list.  at just past halfway in the video I changed focus to the Kendo.textarea that contains "asdf" and then went back to the drop down list and it works as expected.   the exact same page will work fine in Chrome, Firefox, and IE 9.   If I select the text area first and then select the dropdown list it works as expected.

Thoughts?


Regards,
Jimm
Aaron
Top achievements
Rank 1
 answered on 05 Feb 2015
1 answer
778 views
How do you add a DropDownlist to Grid Toolbar that is already showing the built in Excel toolbar button.

@(Html.Kendo().Grid<Reports.ReportRow>()
    .Name("grdReport")
    .DataSource(dataSource => dataSource
        .Ajax()
        .Read(read => read
                .Action("AJAX", "Report")
                .Data("GetReportParms")
        )
    )
    .ToolBar(tools => {
        tools.Excel();
        tools.Template(@<text>
           <div class="toolbar">
                <label class="category-label" for="category">Version:</label>
                    @(Html.Kendo().DropDownList()
                        .Name("ddlField")
                        .DataTextField("Text")
                        .DataValueField("Value")
                        .AutoBind(true)
                        .Events(e => e.Change("fieldChange"))
                        .DataSource(ds =>
                        {
                            ds.Read("FieldType", "Common");
                        })
                    )
            </div>
        </text>);
    })

All the examples I can find show either a DropDownList in a Toolbar Template OR the built in Excel toolbar button.  I need both.

Thanks
Dimiter Madjarov
Telerik team
 answered on 05 Feb 2015
2 answers
779 views
I have a bunch of buttons that each bring up the same context menu.  I need the context menu to position itself at the mouse click on the button.

In ASP.NET this is accomplished by using code like this.

function OpenAddRowMenu(event) {
    var contextMenu =  $("#AddRowMenu");
    if ((!event.relatedTarget) || (!$telerik.isDescendantOrSelf(contextMenu.get_element(), event.relatedTarget))) {
        contextMenu.show(event);
    }
    else {
        alert("Event error");
    }
}

The button

<button class="btn btn-primary" onclick="OpenAddRowMenu(event); return false;">Add Row</button>
 
I cannot find anything on positioning a context menu or any possible parameters to show().  The MVC documentation is really thin and the examples only show so much.
George
Top achievements
Rank 2
 answered on 05 Feb 2015
1 answer
412 views
Hi there

We are using Kendo Charts in our application. We can successfully export the charts using the following jQuery.
$("#exportASPBarChart").click(function () {
    var chart = $("#ASPBarChart").data("kendoChart");
    var image = chart.imageDataURL();
    var a = $("<a>").attr("href", image).attr("download", "ASPBarChart.png").appendTo("body");
    a[0].click();
});
Is there a way to export the data to a Excel file?

Thank you.
Iliana Dyankova
Telerik team
 answered on 05 Feb 2015
1 answer
350 views
Hi,

I am trying to maintain state of kendo grid like Page Number,Page Size using session. I have referenced below example from your forum

http://www.telerik.com/support/code-library/save-grid-state-in-session-on-server-side

Problem is I don't have any button to Save or Load the grid state like above exmaple. 

I am saving the grid state on DataBound event of Grid and Loading the sate back from session in Document.ready function.

But its not working for me as  Index_Read function for Ajax binding of Grid  is always getting called first before LoadGridState function and thus session object is getting overridden with defualt values for pagesize, pageno etc.

Can you please help me on this.

Thanks
Aarti



Daniel
Telerik team
 answered on 05 Feb 2015
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
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
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?