Telerik Forums
UI for ASP.NET MVC Forum
6 answers
181 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
779 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
463 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
222 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
200 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
153 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
519 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
245 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
2 answers
344 views
We are currently evaluating the various different ways of binding our Backend code to the Kendo UI Grid control.

We have a Ajax enabled Controller and View which successfully uses a EditorTemplate to display a dropdown thus :


    @(Html.Kendo().Grid(Model)
                      .Name("EmployeesGrid")
                      .Columns(columns =>
                                   {
                                       columns.Bound(e => e.PersonFirstName).Width(230).Title("First Name");
                                       columns.Bound(e => e.PersonLastName).Width(230).Title("Last Name");
                                       columns.Bound(e => e.DOB).Width(120).Title("D.O.B");
                                       columns.Bound(e => e.Gender).Width(100).Title("Gender").EditorTemplateName("GenderDropDown");
                                       columns.Bound(e => e.SSN).Width(230).Title("SSN");
                                       columns.Command(command =>
                                                           {
                                                               if (ClaimsAuthorize.CheckAccess(Constants.Actions.Delete, Resources.Employee))
                                                               {
                                                                   command.Destroy();
                                                               }
                                                               if (ClaimsAuthorize.CheckAccess(Constants.Actions.Update, Resources.Employee))
                                                               {
                                                                   command.Edit();
                                                                   command.Custom("ViewDetails").Click("EmployeeDetails");
                                                               }
                                                           }).Width(260).Title("Commands");
                                   })
                      .Editable(editable => editable.Mode(GridEditMode.InLine))
                      .DataSource(datasource => datasource
                                                    .Ajax()
                                                    .ServerOperation(false)
                                                    .Model(model => model.Id(e => e.Id))
                                                    .Events(events => events.Error("error_handler"))
                                                    .Create(create => create.Action("CreateEmployee", "EmployeeAjax"))
                                                    .Read(read => read.Action("ReadEmployees", "EmployeeAjax"))
                                                    .Update(update => update.Action("EditEmployee", "EmployeeAjax"))
                                                    .Destroy(delete => delete.Action("DeleteEmployee", "EmployeeAjax"))
                      )
                      .ToolBar(tb =>
                                   {
                                       if (ClaimsAuthorize.CheckAccess(Constants.Actions.Create, Resources.Employee))
                                       {
                                           tb.Create();
                                       }
                                   })
                           .Pageable()
                      .Sortable()
                      .Scrollable()
                      .Filterable()
                      .Resizable(c => c.Columns(true))
                      .Reorderable(c => c.Columns(true))
                      .ColumnMenu()
                      .Groupable())


And the GendorDropDown partial view looks like:


    @(Html.Kendo().DropDownListFor(m => m)
      .Name("Gender")
      .DataTextField("Text")
      .DataValueField("Value")
      .BindTo(new List<SelectListItem>
                  {
                      new SelectListItem {Text = "Male", Value = "M"},
                      new SelectListItem {Text = "Female", Value = "F"}
                  }))


However if I try to setup a Server Bound View using the same template it fails to render the dropdown at all. The column appears but with a value but this disappears completely when attempting to edit the line.


The code for the failing view is below:


    @(Html.Kendo().Grid(Model)
                      .Name("EmployeesGrid")
                      .Columns(columns =>
                                   {
                                       columns.Bound(e => e.PersonFirstName).Width(230).Title("First Name");
                                       columns.Bound(e => e.PersonLastName).Width(230).Title("Last Name");
                                       columns.Bound(e => e.DOB).Width(120).Title("D.O.B");
                                       columns.Bound(e => e.Gender).Width(100).Title("Gender").EditorTemplateName("GenderDropDown");
                                       //columns.ForeignKey(e => e.Gender, new List<SelectListItem>
                                       //                                      {
                                       //                                          new SelectListItem {Text = "Male", Value = "M"},
                                       //                                          new SelectListItem {Text = "Female", Value = "F"}
                                       //                                      }, "Value", "Text").Width(100).Title("Gender");
                                       columns.Bound(e => e.SSN).Width(230).Title("SSN");
                                       columns.Command(command =>
                                                           {
                                                               if (ClaimsAuthorize.CheckAccess(Constants.Actions.Delete, Resources.Employee))
                                                               {
                                                                   command.Destroy();
                                                               }
                                                               if (ClaimsAuthorize.CheckAccess(Constants.Actions.Update, Resources.Employee))
                                                               {
                                                                   command.Edit();
                                                                   command.Custom("ViewDetails").Action("Details", "Employee").Text("Details");
                                                               }
                                                           }).Width(260).Title("Commands");
                                   })
                      .Editable(editable => editable.Mode(GridEditMode.InCell))
                      .DataSource(datasource => datasource
                      .Server()
                      
                              .Model(model => { model.Id(e => e.Id);
                                                  model.Field(e => e.DOB).DefaultValue(null);
                              })
                      .Create(create => create.Action("Create","Employee"))
                      .Read(read => read.Action("Index","Employee"))
                      .Update(update => update.Action("Edit","Employee"))
                      .Destroy(delete => delete.Action("Delete","Employee"))
                      )
                      .ToolBar(tb =>
                                   {
                                       if (ClaimsAuthorize.CheckAccess(Constants.Actions.Create, Resources.Employee))
                                       {
                                           tb.Create();
                                       }
                                   })
                      .Pageable()
                      .Sortable()
                      .Scrollable()
                      .Filterable()
                      .Resizable(c => c.Columns(true))
                      .Reorderable(c => c.Columns(true))
                      .ColumnMenu()
                      .Groupable())


It unclear to me reading the documentation to see if this is even supported or whether the partial view for the template needs to look different. Any help with this would be greatly appreciated and sorry for the masses of cut and paste code.
Atanas Korchev
Telerik team
 answered on 24 Dec 2012
1 answer
144 views
Hello again,
In the local examples for kendo ui with mvc there is no example with popup editing,and online is only in html/jquery.
is there a example you can send me for mvc,because as i saw,in the grid for Editable parameter there is a value for Mode,Popup and i would like to know how can i use it.

Thank you
Dimo
Telerik team
 answered on 21 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
ColorPicker
DateRangePicker
Security
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
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?