Telerik Forums
UI for ASP.NET MVC Forum
4 answers
390 views
Hello,

I need to use Autcomplete and the field associate with it in my model have a Required attribute.

So in my view despite I have a value in the Autocomplete, I got the message "Required field".  I keep the  @Html.ValidationMessageFor under my @(Html.Telerik().AutoCompleteFor...

How I can keep this validation and avoid "Required field" when I have a value?

Have nice Holidays.
Louis
Top achievements
Rank 1
Iron
Iron
Iron
 answered on 28 Dec 2012
1 answer
228 views
Hello there. I am using kendo cascade dropdownlist. My requirement is that, when a user selects a value from Country dropdown, the State dropdown is being filtered from my controller. What I want is that, when a country has no state, the state dropdown should be replaced to a text box, so that, the user can stores his state name. 
If I am using normal dropdowns then I can manage through the ajax request that i suppose to make. but I am not able to figure it out how to handle it on the Kendo dropdowns.? 

Here is my code sample for what I am usning now.

<tr>
                <td valign="top" colspan="2">
                    <div style="float: left">
                        <em>*</em> @Html.LabelFor(model => model.CountryId)
                    <br />
                        @Html.Kendo().DropDownListFor(model => model.CountryId).BindTo(Model.AvailableCountries).Animation(true).HtmlAttributes(new { onchange = "populateState(this)", style = "width:250px;" })
 
                        <span id="states-loading-progress" style="display: none;">Wait...
                <img src='@Url.Content("~/Content/Images/ajax_loader_small.gif")' alt="Wait..." />
                        </span>
                    </div>
                    <div style="float: right">
                        @Html.LabelFor(model => model.PostalCode)
                        <br />
                        @Html.TextBoxFor(model => model.PostalCode, new { @class = "k-textbox", style = "width:100px;" })
                    </div>
                </td>
 
 
            </tr>
            <tr>
                <td valign="top">@Html.LabelFor(model => model.State)
                    <br />
                    <div id="ddlStates">
                        @(Html.Kendo().DropDownList()
      .Name("State")
                                // .OptionLabel("Select state...")
      .DataTextField("name")
      .DataValueField("id")
      .DataSource(source =>
      {
          source.Read(read =>
          {
              read.Route("GetStatesByCountryId")
                  .Data("CountryId")
                  .Type(HttpVerbs.Post); // This line serves to accept POST requests
          })
          .ServerFiltering(true);
      })
      .Enable(false)
      .AutoBind(false)
      .CascadeFrom("CountryId")
      )
Atanas Korchev
Telerik team
 answered on 28 Dec 2012
6 answers
188 views
Hi,

I am referring to the example shown at the location - http://demos.kendoui.com/web/grid/column-menu.html and looks like there is a bug.

Open this page and you will see initially four columns are displayed.
Now click on OrderId menu column > and select Columns > and check Ship Country.

Doing above steps , ship country column gets removed from the grid but ideally in the menu column the checkbox should get unchecked.
now If you try to click on Ship Country checkbox again , then it will get unchecked but now Ship Country column gets added to the grid.

What I think is , this is working fine but the checkbox behavior should be exactly opposite as of now.
When you don't want to see any column in the grid - check box should show as unchecked and vise versa.

Please let me know If this makes sense.
Atanas Korchev
Telerik team
 answered on 28 Dec 2012
7 answers
795 views
Hello,



Last week, Microsoft put out an OData media formatter for WebApi, meaning that you should be able to both use built-in WebApi support for OData query methods, AND produce OData format output.



I have my feed, I have a Razor-produced MVC Grid on the page, and I have it making the request through .Read(read => read.Url(TheUrlToMyApi)). Now I just need to get it to understand OData. How do I go about settings the Transport, as there doesn't appear to be an option in the GridHelper.



Thanks!
Atanas Korchev
Telerik team
 answered on 28 Dec 2012
2 answers
478 views
Hi!

I have a serverbound (ajax) grid and want to add a custom argument when fetching data.

After some searching I found the option to alter the parameterMap function. However, when I try to extend that function I extend the original functionality, not the one provided by kendo.aspnetmvc.js. This means that my custom argument works, but sort/filter/... does not anymore. When I remove my code sort/filter/... works but of course my custom data does not get through.

Is there any way to add my custom argument? Below is the code I tried for reference:
$("#myGrid").data("kendoGrid")
    .dataSource.transport.parameterMap = function (data, operation) {
        return $.extend(data, {
            myCustomData: true  //Actually client-side calculated data, not static
        });
    };



Thanks
/Victor
Victor
Top achievements
Rank 1
 answered on 26 Dec 2012
1 answer
231 views
Hello, I'd like to trigger a databind/search of the MVC AutoComplete programmatically instead of in reaction to a user typing. Is this possible?
Alexander Valchev
Telerik team
 answered on 25 Dec 2012
1 answer
207 views
I have a question regarding to Date format for Calendar controls inside ColumnMenu filter for Column with Date type. As you can see here, on attached screenshot I use a Denmark (<globalization culture="da-DK" uiCulture="da-DK" />) localization defined in Web.config. And all is ok except Calendar date format, that is US. All other calendars that I used out of this filter are configured to format "dd-MM-yyyy". But how to configurate this one, inside a filter?
Petur Subev
Telerik team
 answered on 25 Dec 2012
1 answer
160 views
Hello,
how can i execute an action from the controller,on clicking a menu item?

Also,the menu can be align vertically?or for that is the other control,the panel bar?

Thanks in advance
Dimo
Telerik team
 answered on 25 Dec 2012
2 answers
528 views
Hello,

  We are evaluating KendoUI to use in our company. One of the primary requirement for us is to have custom column filter only with a single textbox on each column without any menus, operators and buttons. When the user types something on the textbox I have to execute 'Contains' filter in server side. What is easiest way to do this? Please check the attached picture.
Atanas Korchev
Telerik team
 answered on 24 Dec 2012
1 answer
256 views
I am trying to use a dropdownlist as an editor template (using MVC Complete) and having several issues/questions.

1.) The binding works on Save, but not on Read: i.e. when I select an option and save the model, the correctly selected item's value is saved to the database, but then when pulling up that record again, the DDL is not reflecting that saved value. I have verified that value is in the Database and is in the view model.

2.) Can you bind to the View's model instead of the ViewData? i.e. .BindTo(Model.DDLOptions.CustomerOptions). When I try this I get an error "

'int' does not contain a definition for 'DDLOptions'


3.) Should the .Name value match the Property Name or the name as it is in the model. i.e. since my model has multiple sub-classes, it seems that I need to use a .Name that corresponds to the way the model references that field. In the view, I'd reference the OwnerId field as @Html.EditorFor(model => model.Item.OwnerId). As such I am using a .Name("Item.OwnerId"). This results in the issues listed in item 1...only 1 way binding. If I change it to .Name("OwnerId"), the base classes property name, no binding occurs at all.

Property decorated with UIHint in MetaData class for Base Class: This is for the Item class
[Display(Name = "Owner Id")]
[UIHint("CustomersAllDDLEditor")]
public Nullable<int> OwnerId { get; set; }
View Model
public class ItemViewModel
    {
        public Item Item { get; set; }
        public ItemOptionsViewModel DDLOptions { get; set; }
        public AuditStampsViewModel AuditStamps { get; set; }
    }
EditorTemplate
@(Html.Kendo().DropDownList()
    .Name("Item.OwnerId")
    .DataValueField("Id")
    .DataTextField("DisplayName")
    //.BindTo(Model.DDLOptions.CustomerOptions)
    .BindTo((System.Collections.IEnumerable)ViewData["customers"])
    .OptionLabel(" ")
    .Template("#= data.DisplayName.replace(' ', ' ') #")
)
How this property is reference in the View
@Html.EditorFor(model => model.Item.OwnerId)
If I place the Kendo DDL directly in the view, without using the editortemplate, here is the HTML output for Input element:
<input data-val="true" data-val-number="The field Owner Id must be a number." id="Item_OwnerId" name="Item.OwnerId" type="text" value="3" class="k-input valid" data-role="dropdownlist" style="display: none;">
When the Kendo DDL is displayed via the EditorTemplate, here is the resulting HTML
<input id="Item_OwnerId" name="Item.OwnerId" type="text" class="k-input valid" data-role="dropdownlist" style="display: none;">
Note in the latter it is missing the Value=3 attribute as well as the validation attributes.

Any help is appreciated.
Chad

Atanas Korchev
Telerik team
 answered on 24 Dec 2012
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
ComboBox
Upload
MultiSelect
ListView
Window
TabStrip
Menu
Installer and VS Extensions
Spreadsheet
AutoComplete
TreeList
Gantt
PanelBar
NumericTextBox
Filter
ToolTip
Map
Diagram
Button
PivotGrid
Form
ListBox
Splitter
Application
FileManager
Sortable
Calendar
View
MaskedTextBox
PDFViewer
TextBox
Toolbar
Dialog
MultiColumnComboBox
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
Security
ColorPicker
DateRangePicker
Wizard
Styling
Chat
DateInput
MediaPlayer
TileLayout
Drawer
SplitView
Template
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Badge
LinearGauge
ModalView
ResponsivePanel
TextArea
Breadcrumb
ExpansionPanel
Licensing
Rating
ScrollView
ButtonGroup
CheckBoxGroup
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
DateTimePicker
AppBar
BottomNavigation
Card
FloatingActionButton
Localization
MultiViewCalendar
PopOver (Mobile)
Ripple
ScrollView (Mobile)
Switch (Mobile)
PivotGridV2
FlatColorPicker
ColorPalette
DropDownButton
AIPrompt
PropertyGrid
ActionSheet (Mobile)
BulletGraph
Button (Mobile)
Collapsible
Loader
CircularGauge
SkeletonContainer
Popover
HeatMap
Avatar
ColorGradient
CircularProgressBar
SplitButton
StackLayout
TimeDurationPicker
Chip
ChipList
DockManager
ToggleButton
Sankey
OTPInput
ChartWizard
SpeechToTextButton
InlineAIPrompt
TimePicker
StockChart
RadialGauge
ContextMenu
ArcGauge
AICodingAssistant
SmartPasteButton
PromptBox
SegmentedControl
LLM Kit
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?