Telerik Forums
UI for ASP.NET MVC Forum
2 answers
738 views
Hello,

I need some help to complete below functionality.

I am trying to bind/create a template column, so when the grid loads it can call an html helper or controller action to get the value/text for that column. Which means, i am trying to bind a non modal or datasource property  to one of the grid columns.

Goal: Bind one of the columns in kendo grid with external text.

My grid looks something like this,

 @(Html.Kendo().Grid<Model>()
          .Name("Grid")
          .AutoBind(false)
          .Columns(columns =>
              {
                  columns.Bound(row => row.Id).Hidden(true);
                  columns.Bound(row => row.Name);

                 columns.Template(@<text>@Html.GetSomeText("SomeContext")</text>).Title("title");

                 columns.Template(@<text>@Html.Action("GetSomeText", "controller", new {ctx = SomeContext})</text>);
               }

As you can see above, I tried couple of ways to get the text for the column - Html helper and Action Method, but in both the cases, server side code is not even being triggerd and column remains empty in the grid.

Any help is much appreciated.

Thanks,
Balwant
Petur Subev
Telerik team
 answered on 18 Mar 2013
5 answers
424 views
Hi, 

during evaluation of the KEndo library, I am now facing the next problem which I spent a lot time with now...

I try to create a listview. My viewmodel contains references to other classes, let's say I have a model class Person, which contains a property Address of type Address, which again has properties "Street" and "City".

So, I defined my template like this (also my editor template):
<script type="text/x-kendo-tmpl" id="template">
     <div>
       <dl>
         <dt>Street</dt> <dd>${Address.Street}</dd>
         <dt>City</dt> <dd>${Address.City}</dd>
       </dl>
     </div>
 </script>
But this leads to JavaScript exceptions, saying that the property is undefined. How can I handle this? Any idea is welcome, but this really a serious problem with complex data models. I cannot reduce my viewmodel to only have primitive properties, that woud cause too much effort...

Thanks!
Petur Subev
Telerik team
 answered on 18 Mar 2013
1 answer
684 views
I have an ASP MVC 4, .Net 4.5 project.  I am using the new EmailAddressAttribute validation data annotation attribute on my view models to validate a correct email format is posted.

The attribute is correctly rendered on the input element as <input type="text" ... data-val-email="Email address format is incorrect" .../>.

If I use the kendo validator to validate my form before post to server, the email rule seems to be ignored.  I believe I have included all the necessary js files to support unobstrusive validation.  All my other data annotation rules are applied correctly.

When I look at kendo.aspnetmvc.min.js, it appears as though the kendo "email" rule is never mapped to the data-val-email rule pattern?

If I write my input element from scratch <input type="email" required .../> obviously my email rule is applied correctly by the kendo validator.  This is not an ideal solution though because I am trying to standardise on using the data annotation attributes for my view models.

Can you please tell me if I have done something wrong?  I rechecked the 2012 q3 beta and it appears to have the same limitation.

Thanks





Shiva
Top achievements
Rank 1
 answered on 16 Mar 2013
1 answer
224 views
Maybe I'm going about this the wrong way but the model populating the AutoComplete has an Id and a Name.  I display the Name but when the form is submitted I need to return the Id since it will bind to the property on the model.

Presently the AutoComplete is populated correctly when I start entering data, but when I submit the form, the widget has the red border meaning that it's not returning the int property type but the string type.

These are two of the AutoComplete properties on my model that I need to bind to:
[DisplayName("Vendor")]
public int? VendorId { get; set; }
 
[DisplayName("Category")]
public int CategoryId { get; set; }
Here is my Vendor AutoComplete widget:
@(Html.Kendo().AutoComplete().Name("Expense.VendorId")
    .DataTextField("VendorName")
    .Filter(FilterType.StartsWith)
    .Placeholder("Type in a Vendor...")
    .DataSource(dataSource =>
    {
        dataSource.Read(read => read.Action("_GetVendors", "Expense"));
    })
    )
Bottom line: I need to bind the Id of the selected value back to the controller, so I need to know how to return the Id from the AutoComplete widget and include it with the response.

Any help on this is appreciated.

Thanks.
King Wilder
Top achievements
Rank 2
 answered on 15 Mar 2013
1 answer
111 views
I have a Db table that has a SiteKey, SiteValue, Description columns. No Id's.
For example,
SiteKey    SiteValue
ACode     ABC
BCode     XYZ
CCode    123
I want to display this in a View
--------------------------
A Code: ABC
B Code: XYZ
C Code: 123
---------------------------
| EDIT |
----------------------------
And a Button to Edit. On click, make the display boxes for values to Inline Editing with the option to Save or Cancel.
Can you show me a sample to do this with Kendo? I am able to do this as a separate Edit View but want to use kendo widgets if possible. Since the data is unrelated, not sure what to use or if this is possible.

Annie

Dimiter Madjarov
Telerik team
 answered on 15 Mar 2013
4 answers
132 views
Hi everyone,

I'm a database engineer new to the ASP.NET MVC world, and recently purchased the Telerik Kendo UI tool kit for ASP.NET MVC in order to transition away from Silverlight. While I appreciate the thoroughness of the examples provided by Telerik, what I would have preferred is individual projects for the various tools. I'm sure those accustomed to working with MVC in general are able to cut through all the chaff and get to what they need, but all I really want is to understand how to use a basic grid for now; I'll build on that understanding later. A project/solution with just a basic grid implementation would save me a lot of time.

Does anyone know if there is a project repository on Telerik or KendoUI.com that would suit my needs? I've looked through the forums, but figured I'd start asking here before submitting a support ticket.

Thanks in advance for any help for this novice!
Nate
Top achievements
Rank 1
 answered on 15 Mar 2013
1 answer
100 views
It appears that the DEMO version for MVC, only has binary's for MVC 3.

Does the full production version ship with MVC 4 support?

I get this error:

Could not load file or assembly 'System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

My Project is MVC 4.
Atanas Korchev
Telerik team
 answered on 15 Mar 2013
2 answers
418 views
Hi,
I'm trying to use custom validation and figured out that it works not in the same way as standard one.

When I use required validation the value is validated and it is impossible to change active cell.
In case of custom validation it is possible to change current active cell. And the validation message become hidden.

For me it is important to have custom validation with the same behavior as required.

I've added example http://jsfiddle.net/ax37h/4/.
I've added required validation for the first field and add 'specialDate' validation. So both validate but the way of validation is different.

I use HtmlHelper for kendo grid creation, so I need to add validation after initialization.

Validator as below:
$('#grid').kendoValidator({
    rules: {
        specialDate: function (input) {
                    input.attr("data-specialDate-msg", "The date should be 2013-01-02");
                    return input.val() == '2013-01-02';
                }
            },
        messages: {specialDate: "The date should be 2013-01-02"}
});

Thank you.
Joakim Karlsson
Top achievements
Rank 1
 answered on 15 Mar 2013
1 answer
131 views
Hello,

We are putting together a proof-of-concept with KendoUI and ASP.NET MVC before purchasing. The specific issue I am running into is with embedding a multi-select picklist inside of a grid column. I have searched the forum and haven't found any examples of any controls embedded within another, and would greatly appreciate any examples or pointers that would speed up solving this issue.

Thanks for any responses
Petur Subev
Telerik team
 answered on 15 Mar 2013
1 answer
256 views
Hello,

We are putting together a proof-of-concept with KendoUI and ASP.NET MVC before purchasing. The specific issue I am running into is with embedding a multi-select picklist inside of a grid column. I have searched the forum and haven't found any examples of any controls embedded within another, and would greatly appreciate any examples or pointers that would speed up solving this issue.

Thanks for any responses
Georgi Krustev
Telerik team
 answered on 14 Mar 2013
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
MultiColumnComboBox
Dialog
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
SegmentedControl
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?