Telerik Forums
UI for ASP.NET MVC Forum
8 answers
2.6K+ views
After several hours of trying, and googling, I realised, in order for my model (in the controller, after a postback) to register the value of my dropdownlist, the .Name property has to actually match the name of my model property.

This is how my dropdownlist looks like

@(Html.Kendo().DropDownListFor(m => m.EventTrigger.EventType)
                                      .Name("EventTrigger.EventType")
                                      .DataTextField("EventType")
                                      .DataValueField("EventType")
                                      .BindTo(Model.EventDefs))


Shouldn't this:
(m => m.EventTrigger.EventType)

be sufficient to bind the dropdownlist selected value to my model? Why is the following .Name("") necessary?

What is the purpose of (m => m.EventTrigger.EventType)?
Don
Top achievements
Rank 1
 answered on 26 Aug 2013
4 answers
145 views
Not quite sure if I'm going about this wrong or it's the widget that has a bug in it.
Whenever I use the .Event() in my code, the controller does not work properly. It transforms back to a textbox, and does not display the elements at all. I've even tried this with your code, found here:
http://docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/helpers/multiselect/overview

This is your code:
@(Html.Kendo().MultiSelect()
  .Name("multiselect")
  .BindTo(new string[] { "Item1", "Item2", "Item3" })
  .Events(e => e
        .Select("multiselect_select")
        .Change("multiselect_change")
  )
)
<script>
function multiselect_select() {
    //Handle the select event
}
 
function multiselect_change() {
    //Handle the change event
}
</script>
This is my code:
@(Html.Kendo().MultiSelect()
  .Name("tags")
  .Placeholder("No tags selected for this unit")
  .BindTo(new SelectList(Model.TagNames))
  .Value(Model.TagNames)
  .Events(e => e
            .Select("tags_select")
            .Change("tags_change")
         )
  )
<script>
...
</script>
Doing this results in the widget breaking, somehow. See attached images. I should also mention that the widget, when initialized without the .Event(), works. Allthough, it flickers before the initialization is completed and the inputbox, textbox or whatever it is before the css-styling is applied to it, appears.
Daniel
Telerik team
 answered on 26 Aug 2013
2 answers
293 views
Hello,

Is it possible to build a panel bar where the content is a grid of items retrieved by an ajax call ?
it could come from loading a view. How would you go about building something like this ?
Petur Subev
Telerik team
 answered on 26 Aug 2013
1 answer
81 views
I have a grid with another grid inside the client detail.  Each grid gets it data using ajax calls.

 In the second grid I need to display various buttons against each row based on a value in a status field (let's call that StatusID)
The number of buttons varies from none to 5.  I was thinking to put them all inside 1 column.
How can I achieve this ? 

I am using the fluent grid declaration

After playing with it for a while I noticed this :

In my second grid ( aka the grid inside  the ClientDetailTemplateID, i cannot use the bound values whatever I do

My column looks like this :

columns.Bound(p => p.PublishStatusID).ClientTemplate("#= PublishStatusID #");
As you can see this is just a test to get the value to display before I move on to building a button. I am getting an error  telling me that PublishStatusID  does not exist. In fact none of the bound properties can be accessed at all except for the one which is basically the key passed by the parent grid.
The data in the grid itself displays fine, but I cannot access it whatever I do in a ClientTemplate

The controller is setup to return data for the grid : 
public JsonResult GetSomeData([DataSourceRequest] DataSourceRequest request, int someID)
 and it returns this.Json(model.ToDataSourceResult(request), JsonRequestBehavior.AllowGet);

What's going on ?





Petur Subev
Telerik team
 answered on 26 Aug 2013
11 answers
653 views
I'm trying to create an implementation of the imagebrowser where the images are read from a database table. 

It reads the images correctly from the database, but they are being treated as folders for some reason. So it never calls the Thumbnail controller method, it just displays the default folder thumbnail. The same thing happens when I try to select an image. It doesn't call the Image method, but instead another call to the Read method.

Any ideas?

I've attached some snippets from my code. We are currently usin gKendoUI 213.1.514.


Regards,
Jan Erik
Rosen
Telerik team
 answered on 26 Aug 2013
5 answers
99 views
Hello all,

I'm experiencing an issue with keyboard navigation and saving for grids with batch editing enabled.  I'm using the Kendo editor templates for Number and Currency in my grids where appropriate based on the model.  When using the tab key to navigate through and edit the cells, the values typed in to the numeric textbox columns never get saved.  I dug into this a little more and noticed that the grid's Save event is not being fired.  Is there something special I need to do to get this to work?  Or is it not supported to use the NumericTextBox control inside a grid cell?  Thanks for the help!

To reproduce this with the Kendo Demo project, just add the .Navigatable() property to the editing.cshtml file in the grid folder.

Regards,
Brian
Amol
Top achievements
Rank 1
 answered on 26 Aug 2013
1 answer
167 views
Hi,

I'm noticing a weird issue when I try to use "@using (Ajax.BeginForm(...)) { }" within Items' Contents. All of the form elements that end up inside of each PanelBar item are all being rendered outside of the PanelBar (placed right before the rendered PanelBar's ul element). For example, this code:

@(Html.Kendo().PanelBar()
    .Name("accordion")
    .Items(bar =>
        {
            bar.Add().Text("One")
                .Content(@<div>
                           @using (Ajax.BeginForm("OneSuccess", "Custom", new AjaxOptions {UpdateTargetId = "resultOne"}))
                            {
                                @Html.DemoPartial("Partial")
                                <div id="resultOne"></div>
                            }
                        </div>);
            bar.Add().Text("Two")
                .Content(@<div>
                           @using (Ajax.BeginForm("TwoSuccess", "Custom", new AjaxOptions {UpdateTargetId = "resultTwo"}))
                            {
                                @Html.DemoPartial("Partial")
                                <div id="resultOne"></div>
                            }
                        </div>);
            bar.Add().Text("Three")
                .Content(@<div>
                           @using (Ajax.BeginForm("OneSuccess", "Custom", new AjaxOptions {UpdateTargetId = "resultThree"}))
                            {
                                @Html.DemoPartial("Partial")
                                <div id="resultThree"></div>
                            }
                        </div>);
         }))
Results in:
<form ...></form>
<form ...></form>
<form ...></form>
<ul class="k-widget k-panelbar k-reset k-header" id="accordion" data-role="panelbar" tabindex="0" role="menu">
... No forms in here ...
</ul>

Is there something incorrect about how I'm setting up the PanelBar or is there a workaround I can use to get the functionality I need?

Thanks,
Zach







Petur Subev
Telerik team
 answered on 26 Aug 2013
0 answers
166 views
Found my answer here

I have declared the following in my Login.cshtml file.  Everything displays and accepts user input correctly.  However, the form submit button does nothing.  Is there a way to get it to work?

@model LoginModel

@{
    ViewBag.Title = "Login";
}

@(Html.Kendo().MobileView()
    .Name("view-login")
    .Title("Login")
    .Header(obj =>
        (Html.Kendo().MobileNavBar()
                .Name("nav")
                .Content(navbar =>
                    @<text>
                    @navbar.ViewTitle("")
                    </text>
                )
            )
        )
    .Content(
        @<text>
        @LoginForm()
        </text>
    )
    )
)

@helper LoginForm()
    {
    <section id="loginForm">
    @using (Html.BeginForm())
    {
        @Html.AntiForgeryToken()
        @Html.ValidationSummary(true)

        <fieldset>
            <legend>Log in Form</legend>
            <ol>
                <li>
                    @Html.LabelFor(m => m.UserName)
                    @Html.TextBoxFor(m => m.UserName)
                    @Html.ValidationMessageFor(m => m.UserName)
                </li>
                <li>
                    @Html.LabelFor(m => m.CompanyCode)
                    @Html.TextBoxFor(m => m.CompanyCode)
                    @Html.ValidationMessageFor(m => m.CompanyCode)
                </li>
                <li>
                    @Html.LabelFor(m => m.Password)
                    @Html.PasswordFor(m => m.Password)
                    @Html.ValidationMessageFor(m => m.Password)
                </li>
                <li>
                    @Html.CheckBoxFor(m => m.RememberMe)
                    @Html.LabelFor(m => m.RememberMe, new { @class = "checkbox" })
                </li>
            </ol>
            <input type="submit" value="Log in" />
        </fieldset>
    }
    </section>
}

@(Html.Kendo().MobileApplication()
    .ServerNavigation(true)
)

ADDITIONAL NOTES:

I determined that the cause of the malfunctioning Login button is the fact that the form produced by BeginForm is empty and reads as such:

<form action="/Account/Login" method="post"></form>

Any ideas why the form is coming up empty?
Steven
Top achievements
Rank 1
 asked on 26 Aug 2013
4 answers
302 views
Hi,

As a part of a report I have a chart that displays both negative and positive values (see attachment), which seems to work fine :) However, I need to place the axis labels at the bottom, and not in the center (0) as they are right now. I came across an older post saying that this was not possible at that time (around mid to late 2012), but I was hoping this was sorted by now?

Here's my chart code:
@(Html.Kendo().Chart()
      .Name("chart")
      .Theme("silver")
      .Legend(legend => legend.Visible(false))
      .ChartArea(chartArea => chartArea
                                  .Background("transparent")
      )
      .Series(series =>
          {
              series.Area(@Model.Weight).Name("Weight");
          })
      .ValueAxis(axis => axis
                             .Numeric("depth")
                             .Labels(labels => labels.Format("{0}kN"))
                             .AxisCrossingValue(0)
                             .Line(line => line.Visible(false))
                              
      )
      .CategoryAxis(axis => axis
                                .AxisCrossingValue(0,0,0,10)
                                .Categories(@Model.Depth)
                                .MajorGridLines(lines => lines.Visible(true))
      )
      .Tooltip(tooltip => tooltip
                              .Visible(true)
                              .Format("{0}%")
                              .Template("#= series.name #: #= value #")
      )
      )
If this is still not supported, I'd greatly appreciate a possible workaround as this is much needed functionality :)
Thanks in advance!
Ian
Top achievements
Rank 2
 answered on 23 Aug 2013
1 answer
163 views
Uncaught Error: Syntax error, unrecognized expression: input:hidden[name='Sections\[0\']\.Settings\[0\]\.Value] jquery.min.js:4

The HTML it's failing on is as follows:

<input data-val="true" data-val-required="The Boolean field is required." id="Sections_0__Settings_0__Value" name="Sections[0].Settings[0].Value" type="checkbox" value="true" />
<input name="Sections[0].Settings[0].Value" type="hidden" value="false" /> 
<span class="field-validation-valid" data-valmsg-for="Sections[0].Settings[0].Value" data-valmsg-replace="true"></span>

Can this be fixed ASAP
Rosen
Telerik team
 answered on 23 Aug 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?