Telerik Forums
Kendo UI for jQuery Forum
4 answers
1.3K+ views
How to get the row value on Kendo grid row selection change.  I used a ajax method to bind the Kendo grid. 

@(Html.Kendo().Grid<OnlineAB.Models.GoodsServiceModel>()
            .Name("GSSrcGrid")
            .Columns(columns =>
            {
                columns.Bound(gs => gs.ID).Visible(false);
                columns.Bound(gs => gs.GSPrice).Groupable(false).Width(100);
                columns.Bound(gs => gs.GSTime).Width(100);
                columns.Bound(gs => gs.GSDescription).Width(200);
                columns.Bound(gs => gs.GSTitle).Width(150);
                columns.Bound(gs => gs.GSCode).Width(120);
            })
            .DataSource(dataSource => dataSource
                .Ajax()
                .Read(read => read.Action("GetGoodsandService", "GS")
                    .Data("GetParam"))
                .ServerOperation(false)
            )
            .Sortable()
            .Scrollable()
            .Filterable()
            .RowAction(row => row.HtmlAttributes.Add("data-id", row.DataItem.ID))
            .Selectable(s => s.Mode(GridSelectionMode.Single))
            .Events(events => events.Change("GSSelectionChange"))
    )

and js code snippet

function GSSelectionChange() {
         var gsgrid = $('#GSSrcGrid').data('kendoGrid');
        var goods = gsgrid.select();
        var goodsID = goods.data("id");
        alert(goodsID);
}

goodsID always return undefined.  Whats the wrong with this.


thanks
Santhosh
Ravi
Top achievements
Rank 1
 answered on 22 Oct 2012
0 answers
122 views
Hello
I iframe in my page in the   iframe i have a button i want when click on the button open window in center of the my page.
Mohammad
Top achievements
Rank 1
 asked on 21 Oct 2012
0 answers
148 views
Hello guys

I'm having a problem with the NumericTextBox. Here is a jsfiddle example http://jsfiddle.net/Ns6sd/16/

The validation fails on almost every occasion: 
- go one level up, and validate
- write your own number, ex. 2.3 and validate

The validation passes if you: 
- go one level down and press validate (now if you go up and validate it will work, but if you enter your own number it fails again)

Please help me solve this problem

Best Regards

Igor
Top achievements
Rank 1
 asked on 20 Oct 2012
1 answer
445 views
Ok so I have a WCF ODATA service hosted locally for testing purposes. Then I have a Kendo Grid trying to query the service using a Kendo Datasource configured for ODATA exactly like the demo!

On the deployed service, I also implemented the "JSONPSupportBehavior" attribute and class that everyone is talking about!

Still I get this in Fiddler : A supported MIME type could not be found that matches the acceptable MIME types for the request. The supported type(s) 'application/atom+xml;type=feed, application/atom+xml, application/json;odata=verbose' do not match any of the acceptable MIME types 'application/json'


Is this IIS issue now or something else? This is driving me crazy!



////UPDATE///

FIxed!!!!
Nils C.
Top achievements
Rank 1
 answered on 20 Oct 2012
1 answer
225 views

<script type="text/javascript">
 
  
 
  
 
    $(document).ready(function () {
 
  
 
        var validator = $("#tickets").kendoValidator({
 
            rules: {
 
                upload: function (input) {
 
                    if (input[0].type == "file") {
 
                        return input.closest(".k-upload").find(".k-file").length;
 
                    }
 
                    return true;
 
                }
 
            }
 
        }).data("kendoValidator");
 
  
 
  
 
        $("button").click(function (e) {
 
  
 
            if (!validator.validate()) {
 
                e.preventDefault();
 
            }
 
        });
 
    });
 
  
 
   
 
  
 
    $("#fuActivitySheet").kendoUpload({
 
        multiple: false
 
    });
 
  
 
</script>






<div id="tickets">
    @using (Html.BeginForm("UploadNewActivitySheet", "Vendor", FormMethod.Post, new { id = "UploadActivitySheet", enctype = "multipart/form-data", @class = "clearfix padding_t25" }))
{
     
            @Html.TextBoxFor(model => model.UploadedFile, new { id = "fuActivitySheet", name="fuActivitySheet" , type = "file" })
 
               @Html.ValidationMessageFor(m => m.UploadedFile)
        
       <button class="k-button" type="submit">Submit</button>
    
    
}
 
</section>
</div>





[Display(Name = "Activity Sheet: ")]
[Required(ErrorMessage = "Please Select Activity sheet to upload")]
public System.Web.HttpPostedFileBase UploadedFile { get; set; }

Thanks,
J

Jayesh Goyani
Top achievements
Rank 2
 answered on 20 Oct 2012
1 answer
516 views
Hello,

JS
$(document).ready(function () {
 
       var validator = $("#tickets").kendoValidator({
           rules: {
               upload: function (input) {
                   if (input[0].type == "file") {
                       return input.closest(".k-upload").find(".k-file").length;
                   }
                   return true;
               }
           }
       }).data("kendoValidator");
 
 
       $("button").click(function (e) {
 
           if (!validator.validate()) {
               e.preventDefault();
           }
       });
   });
$("#fuActivitySheet").kendoUpload({
       multiple: false
   });


Cshtml
<div id="tickets">
@using (Html.BeginForm("UploadNewSheet", "Vendor", FormMethod.Post, new { id = "UploadSheet", enctype = "multipart/form-data" }))
{
        @Html.TextBoxFor(model => model.UploadedFile, new { id = "fuActivitySheet", name="fuActivitySheet" , type = "file" })
 
<br />
 
<button class="k-button" type="submit">Submit</button>
}
</div>

Model
[Display(Name = "Sheet: ")]
      [Required(ErrorMessage = "Please Select sheet to upload")]
      public System.Web.HttpPostedFileBase UploadedFile { get; set; }




Thanks,
Jeet bhatt
Jayesh Goyani
Top achievements
Rank 2
 answered on 20 Oct 2012
6 answers
1.0K+ views
I have following code (default from mvc application)
@using (this.Html.BeginForm(new { this.ViewBag.ReturnUrl }))
{
    @Html.AntiForgeryToken()
 
       <div class="l-editor-label">
        @this.Html.LabelFor(m => m.UserName)
    </div>
    <div class="l-editor-field">
        @this.Html.TextBoxFor(m => m.UserName, new { @class = "k-textbox" })
        @this.Html.ValidationMessageFor(m => m.UserName)
    </div>
 
    <div class="l-editor-label">
        @this.Html.LabelFor(m => m.Password)
    </div>
    <div class="l-editor-field">
        @this.Html.PasswordFor(m => m.Password, new { @class = "k-textbox" })
        @this.Html.ValidationMessageFor(m => m.Password)
    </div>
 
    <div class="l-editor-label">
        @this.Html.CheckBoxFor(m => m.RememberMe, new { @class = "k-checkbox" })
        @this.Html.LabelFor(m => m.RememberMe)
    </div>
 
    <p class="button">
        <button class="k-button"> Log in</button>
    </p>
 
    <p>@this.Html.ValidationSummary(true, "Login was unsuccessful. Please correct the errors and try again.")</p>  
}
 
<script src="@this.Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"> </script>
<script src="@this.Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"> </script>     
<script src="@this.Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"> </script>

I tried to replace jquery validation by replacing scripts according with suggestion from other post:

$("form").kendoValidator();

But this is not working. Could anybody tell me what is the quickest way to do that?
Marcin
Top achievements
Rank 1
Veteran
 answered on 20 Oct 2012
0 answers
109 views
Hello. How solve this problem? kendoWindow default draggable "true" when maximize kendoWindow must be not draggable and when it's minimizet it must be draggable again. Thanks for help)
mizza
Top achievements
Rank 1
 asked on 19 Oct 2012
2 answers
251 views
Issue when including the expanded value in model for datasource the treeview icon changes to plus but does not expand. The selected property works as expected when included in model.

Model:
[{"Name":"Test1","Id":15,"hasChildren":true,"expanded":true,"items":[{"Id":8,"Name":"level2a","hasChildren":false,"selected":false},
{"Id":10,"Name":"level2b","hasChildren":false,"selected":false}],
{"Name":"Test2","Id":14,"hasChildren":true,"expanded":true,"items":[{"Id":9,"Name":"level3a","hasChildren":false,"selected":false}],
{"Name":"Test3","Id":11,"hasChildren":true,"expanded":true,"items":[{"Id":7,"Name":"level3a","hasChildren":false,"selected":false}}]}]
Martin
Top achievements
Rank 1
 answered on 19 Oct 2012
3 answers
346 views
Using asp.net MVC 3, is it possible to bind a collection of interfaces to a Kendo Grid instead of a concrete class? For example:

Controller
IEnumerable<IFoo> items = repo.GetFoo();
return View( items );

View
@model IEnumerable<IFoo>
 
@Html.Kendo().Grid(Model).Name("Grid").Columns(column =>
{
    column.Bound(c => c.Name).Title("Foo Name");
    column.Bound(c => c.Key).Title("Foo Key");
}).DataSource(dataSource => dataSource.Ajax().ServerOperation(false))


When binding directly to IEnumerable<IFoo>, the following exception is raised:
Exception Details: System.MissingMethodException: Cannot create an instance of an interface.
 
Source Error:
Line 7:  @Html.Kendo().Grid(Model).Name("Grid").Columns(column =>

Using the Kendo Grid, are we constrained to using concrete types for everything? Or is there a way to use an interfaces?

Thanks!
nCubed
Top achievements
Rank 1
 answered on 19 Oct 2012
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
DatePicker
Spreadsheet
Upload
ListView (Mobile)
ComboBox
TabStrip
MultiSelect
AutoComplete
ListView
Menu
Templates
Gantt
Validation
TreeList
Diagram
NumericTextBox
Splitter
PanelBar
Drag and Drop
Application
Map
ToolTip
Calendar
PivotGrid
ScrollView (Mobile)
Toolbar
TabStrip (Mobile)
Slider
Button (Mobile)
Filter
SPA
Drawing API
Drawer (Mobile)
Globalization
LinearGauge
Sortable
ModalView
Hierarchical Data Source
Button
FileManager
MaskedTextBox
View
Form
NavBar
Notification
Switch (Mobile)
SplitView
ListBox
DropDownTree
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
ColorPicker
Pager
Styling
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
PivotGridV2
Licensing
ScrollView
Switch
TextArea
BulletChart
QRCode
ResponsivePanel
Wizard
CheckBoxGroup
Localization
Barcode
Breadcrumb
Collapsible
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
TimePicker
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
BottomNavigation
Ripple
SkeletonContainer
Avatar
Circular ProgressBar
FlatColorPicker
SplitButton
Signature
Chip
ChipList
VS Code Extension
AIPrompt
PropertyGrid
Sankey
Chart Wizard
OTP Input
SpeechToTextButton
InlineAIPrompt
StockChart
ContextMenu
DateTimePicker
RadialGauge
ArcGauge
AICodingAssistant
SmartPasteButton
PromptBox
SegmentedControl
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?