Telerik Forums
Kendo UI for jQuery Forum
2 answers
1.6K+ views
Hello,

I'm using (and loving) the KendoUI Complete for ASP.NET MVC.  I am trying to pass parameters to a page to indicate the filters, sorts, groups, etc. for the grid via the querystring; e.g., http://localhost/MyPage?sort=DatePlaced-desc&page=1&pageSize=15&group=&filter=Id~gte~1719300~and~Id~lte~1800000~and~UserFirstName~eq~'Edward'

When these parameters are passed, I'm wanting the grid on the page to reflect these parameters when it gets created; i.e., the grid should be initially filtered by Id and UserFirstName in accordance with the filters passed to the page.

I'm hoping for something as simple as:

    .DataSource(dataSource => dataSource
        .Ajax()
        .Read(read => read.Action("MyAction", "MyController"))
        .Filter(Request.QueryString["filter"])
        .Sort(Request.QueryString["sort"])
        .PageSize(Request.QueryString["pageSize"])
    )

I assume you get the idea of what I'm going for.  The motivation for this is as follows:  I'd like to give the user a few buttons, each to a different "canned" report, which is nothing more than the same grid with different filters, sorts, groups, etc.  So if the user clicked one of the buttons, they'd be taken to the page containing the grid, and the filters, sorts, etc. would be passed in as QueryString parameters.

Your assistance on this would be much appreciated.

Thank you,
Billy McCafferty
Chanaka
Top achievements
Rank 2
 answered on 01 Jan 2013
5 answers
277 views
Hello,

I have the following client template:
<script id="questionsTemplate" type="text/kendo-tmpl">
  
    @(Html.Kendo().Grid<AssignedQuestionViewModel>()
          .Name("Questions_#=QuestionGroupTemplateId#")
          .Columns(columns =>
                       {
                           columns.Bound(i => i.QuestionTemplateId).Hidden();
                           columns.Bound(i => i.QuestionGroupTemplateId).Hidden();
                           columns.Bound(i => i.Required);
                           columns.Bound(i => i.QuestionText);
                       }
          )
          .ToolBar(toolBar => toolBar.Save())
          .Editable(editable => editable.Mode(GridEditMode.InCell))
          .DataSource(dataSource => dataSource
                                        .Ajax()
                                        .Batch(true)
                                        .ServerOperation(true)
                                        .Model(model =>
                                                   {
                                                       model.Id(m => m.QuestionTemplateId);
                                                       model.Field(m => m.QuestionTemplateId).Editable(false);
                                                       model.Field(m => m.QuestionGroupTemplateId).Editable(false);
                                                   })
                                        .Read(read => read.Action("ReadAssignedQuestions", "QuestionManagement", new { p = "#=QuestionGroupTemplateId"})
                                                          .Type(HttpVerbs.Post)                                                         
                                        )
                                        .Update(update => update.Action("SaveAssignedQuestions", "QuestionManagement"))
          )
          .ToClientTemplate()
          )
        </script>

When the code breaks on the 'Invalid Template Error", Here is what is in the output from the Dynamic Code page in VS2012:

<script id="questionsTemplate" type="text/kendo-tmpl">
  
    <div class="k-widget k-grid" id="Questions_#=QuestionGroupTemplateId#"><div class="k-toolbar k-grid-toolbar k-grid-top"><a class="k-button k-button-icontext k-grid-save-changes" href="#"><span class="k-icon k-update"></span>Save changes</a><a class="k-button k-button-icontext k-grid-cancel-changes" href="#"><span class="k-icon k-cancel"></span>Cancel changes</a></div><table cellspacing="0"><colgroup><col /><col /></colgroup><thead class="k-grid-header"><tr><th class="k-header" data-field="QuestionTemplateId" data-title="[en-US: QuestionTemplateId]" scope="col" style="display:none"><span class="k-link">[en-US: QuestionTemplateId]</span></th><th class="k-header" data-field="QuestionGroupTemplateId" data-title="[en-US: QuestionGroupTemplateId]" scope="col" style="display:none"><span class="k-link">[en-US: QuestionGroupTemplateId]</span></th><th class="k-header" data-field="Required" data-title="Required" scope="col"><span class="k-link">Required</span></th><th class="k-header" data-field="QuestionText" data-title="Question Text" scope="col"><span class="k-link">Question Text</span></th></tr></thead><tbody><tr class="t-no-data"><td colspan="2"></td></tr></tbody></table></div><script>
    jQuery(function(){jQuery("\#Questions_#=QuestionGroupTemplateId#").kendoGrid({"columns":[{"title":"[en-US: QuestionTemplateId]","hidden":true,"field":"QuestionTemplateId","encoded":true},{"title":"[en-US: QuestionGroupTemplateId]","hidden":true,"field":"QuestionGroupTemplateId","encoded":true},{"title":"Required","field":"Required","encoded":true,"editor":"\u003cdiv class=\"baseEditorTemplate\" style=\"\"\u003e\u003cdiv\u003e    \u003c/div\u003e        \u003cdiv\u003e        \u003clabel for=\"Required\" title=\"Required\"\u003eRequired\u003c/label\u003e\u0026nbsp;\u003cinput class=\"checkBoxes\" data-val=\"true\" data-val-required=\"The Required field is required!!.\" id=\"Required\" name=\"Required\" title=\"Required\" type=\"checkbox\" value=\"true\" /\u003e\u003cinput name=\"Required\" type=\"hidden\" value=\"false\" /\u003e    \u003c/div\u003e    \u003cdiv id=\"errorMsg\"\u003e\u003cspan class=\"field-validation-valid\" data-valmsg-for=\"Required\" data-valmsg-replace=\"true\"\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cspan class=\"field-validation-valid\" data-valmsg-for=\"Required\" data-valmsg-replace=\"true\"\u003e\u003c/span\u003e"},{"title":"Question Text","field":"QuestionText","encoded":true,"editor":"\u003cdiv class=\"baseEditorTemplate\"\u003e\u003cdiv\u003e    \u003clabel for=\"QuestionText\" title=\"Question Text\"\u003eQuestion Text\u003c/label\u003e\u003c/div\u003e\u003cdiv\u003e\u003cinput class=\"k-textbox\" data-val=\"true\" data-val-required=\"The Question Text field is required!!.\" id=\"QuestionText\" name=\"QuestionText\" title=\"Question Text\" type=\"text\" value=\"\" /\u003e    \u003cdiv id=\"errorMsg\"\u003e\u003cspan class=\"field-validation-valid\" data-valmsg-for=\"QuestionText\" data-valmsg-replace=\"true\"\u003e\u003c/span\u003e\u003c/div\u003e      \u003c/div\u003e\u003c/div\u003e\u003cspan class=\"field-validation-valid\" data-valmsg-for=\"QuestionText\" data-valmsg-replace=\"true\"\u003e\u003c/span\u003e"}],"scrollable":false,"editable":{"confirmation":"Are you sure you want to delete this item?","mode":"incell","template":null,"create":true,"update":true,"destroy":true},"toolbar":{"command":[{"name":null,"buttonType":"ImageAndText"}]},"dataSource":{"transport":{"read":{"url":"/Administration/QuestionManagement/ReadAssignedQuestions/#=QuestionGroupTemplateId","type":"POST"},"update":{"url":"/Administration/QuestionManagement/SaveAssignedQuestions"}},"serverPaging":true,"serverSorting":true,"serverFiltering":true,"serverGrouping":true,"serverAggregates":true,"type":"aspnetmvc-ajax","filter":[],"schema":{"data":"Data","total":"Total","errors":"Errors","model":{"id":"QuestionTemplateId","fields":{"QuestionTemplateId":{"editable":false,"type":"number"},"QuestionGroupTemplateId":{"editable":false,"type":"number"},"QuestionText":{"type":"string"},"Required":{"type":"boolean"}}}},"batch":true}});});
<\/script>
        </script>
If I make the template grid 'non editable', it works fine.  Also, if I take the client grid and use it stand-alone, it works fine. It is only when I try to use it as a sub-grid in the hierarchical grid that it fails.

Thanks you!
Danny Green



Michael
Top achievements
Rank 1
 answered on 31 Dec 2012
2 answers
98 views
any plans for handling multiple pointers in the radial guage?
Marcin Butlak
Top achievements
Rank 2
 answered on 31 Dec 2012
1 answer
110 views
We use KendoUI TreeView controls for editing huge amounts of data (~ 10K of nodes). After adding a custom multi-selection and drag-n-drop functionalities we found that the control performs slowly when a user moves large number of nodes. Primary reason for this is that since TreeView and HierarchicalDataSource don't have methods for adding or removing multiple nodes. Each node has to be removed and added individually which causes a very large overhead on state refresh after each operation. Is there any ways to avoid such overhead?
Petur Subev
Telerik team
 answered on 31 Dec 2012
1 answer
417 views
Hi:
On my first mobile site I got the above problem in the following mobile js code:
for (var i = 0; i < CAPTURE_EVENTS.length; i ++) {
    that.container[0].addEventListener(CAPTURE_EVENTS[i], capture, true);
}
The problem only occurs with IE browser, use Chrome browser and the problem disappears.

Phil
Atanas Korchev
Telerik team
 answered on 31 Dec 2012
1 answer
94 views
I am trying to create a dynamic set of href items in a list view from json.  The sample json is below.
[
{"DayOfWorkOut":"<li><a href='#DayFive' data-role='button'  style='display: block; margin: .25em; text-align: left;' data-transition='slide'>12/5/2012</a></li>"},
{"DayOfWorkOut":"<li><a href='#DayFive' data-role='button'  style='display: block; margin: .25em; text-align: left;' data-transition='slide'>12/5/2012</a></li>"},
{"DayOfWorkOut":"<li><a href='#DayFive' data-role='button'  style='display: block; margin: .25em; text-align: left;' data-transition='slide'>12/5/2012</a></li>"},
{"DayOfWorkOut":"<li><a href='#DayFive' data-role='button'  style='display: block; margin: .25em; text-align: left;' data-transition='slide'>12/5/2012</a></li>"},
{"DayOfWorkOut":"<li><a href='#DayFive' data-role='button'  style='display: block; margin: .25em; text-align: left;' data-transition='slide'>12/5/2012</a></li>"}
]

The items appear in the list view, but they appear as just text. I am using a template to bound the field.
I have searched the documentation and forums and have not found a potential solution.
How can this be accomplished?


Atanas Korchev
Telerik team
 answered on 31 Dec 2012
1 answer
270 views
Hi,
Bug.

1. When the grid editing mode is Popup.

The following test cases are based on 'Add new item' function.
For the Required Validation:
Case 1:
Step 1: (Normal)
Delete all default in textbox and leave this textbox(use mouse to leave textbox), then show a tips. The means this textbox cannot be null.

Step 2:(Bug)
Input a value in textbox,
If Step1 use mouse to leave this textbox, then both use mouse and press tab to leave textbox are the tips disappeared.
But Step1 use Tab to leave this textbox, then only press Tab to leave textbox the tips is can be disappeared at this step.
In actually, whether I leave this textbox use anyway at step1, that can not to impact the tips' appear/disappear.

Step 3:(Bug)
Delete the value in this textbox again.
If Step2 use mouse to leave this textbox, then both use mouse and press tab to leave textbox are the tips appeared.
But Step2 use Tab to leave this textbox, then only press Tab to leave textbox the tips is can be appeared at this step.

Step4:(Bug)
Input a value in this textbox again and leave this textbox(use mouse / press tab), but the tips can not disappeared.

For data type Validation:
The field's definition:
public decimal Tonnage { get; set; }

Case1:
Step1:(Normal)
Change this textbox value from default value '0' into a character(eg:'f'), and leave this textbox(mouse/tab), the tips is appeared.

Step2:(Bug)
Change this textbox value from 'f' into a number.
If use mouse to leave textbox at step1. Then both use mouse and tab to leave textbox are the tips disappeared.
But if use tab to leave textbox at step1. Then only use tab to leave textbox, the tips is can be disappeared.

Step3:(Bug)
Change this textbox value from a number into 'f'.
About leave textbox has same problem with Step2.
The tips is appeared.

Step4:(Bug)
Change this textbox's value from 'f' into a number.
Both use mouse and tab to leave this textbox are the tips can not be disappeared.

Case2:
I had assignment the UI-Culture to the 'zh-CN' (Chinese).
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<CarryingCapacityMD>"
    UICulture="zh-CN" %>

But the tips can not be localized.

About Input:
If double click to select all text in the textbox, I can't to input any value.
I must Click the textbox first and double click to select all text in the textbox, that can input value.

Atanas Korchev
Telerik team
 answered on 31 Dec 2012
1 answer
104 views
Hello Experts
I am creating a crud application using KendoUI Grid in Asp.net MVC3 of VS-2012. But It doesn't work properly. For your kind consideration I am giving my code samples as attachment.

please help me to fix my problem.

Thanks in advance
Md. Mojammel Haque
Atanas Korchev
Telerik team
 answered on 31 Dec 2012
1 answer
92 views
Hi, 

How can I save some user data locally  in mobiles ?  I could not find any example so far. Thanks in advance..
Atanas Korchev
Telerik team
 answered on 31 Dec 2012
1 answer
104 views
Team,
 We are evaluating your product for one of our client project. We are stuck in one problem and wondering like how to resolve.

Please see the steps below:

1. I am using grid and I am doing grid edit event .
  
Please see the code for grid event below:

.Events(e => e.Edit(@<text>
    function(e) {
      var row = e.container;
 row.find("#txtboxvalue1").bind("blur", function(e) 
    {                               
        var test=  $("#txtboxvalue1").val();
           var finalresult=  $("#txtboxvalue2").val(test*0.643);
 });
      row.find("#txtboxvalue2").bind("blur", function(e) 
    {                               
 var test=  $("#txtboxvalue2").val();
 var finalresult=  $("#txtboxvalue1").val(test*1.555);
 });
            }
 </text>))

2. The value what I am giving in event function its coming perfectly fine but I am facing the problem while updating with database because the value is only coming for UI .

3.I want the value to update from data source also.

Please suggest me how I can achieve this .

Thanks ,
Raina
Atanas Korchev
Telerik team
 answered on 31 Dec 2012
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
Date/Time Pickers
Spreadsheet
Upload
ListView (Mobile)
ComboBox
TabStrip
MultiSelect
AutoComplete
ListView
Menu
Templates
Gantt
Validation
TreeList
Diagram
NumericTextBox
Splitter
PanelBar
Application
Map
Drag and Drop
ToolTip
Calendar
PivotGrid
ScrollView (Mobile)
Toolbar
TabStrip (Mobile)
Slider
Button (Mobile)
SPA
Filter
Drawing API
Drawer (Mobile)
Globalization
Gauges
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
MultiColumnComboBox
Chat
DateRangePicker
Dialog
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
OrgChart
TextBox
Effects
Accessibility
ScrollView
PivotGridV2
BulletChart
Licensing
QRCode
ResponsivePanel
Switch
Wizard
CheckBoxGroup
TextArea
Barcode
Collapsible
Localization
MultiViewCalendar
Touch
Breadcrumb
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
Popover
DockManager
FloatingActionButton
TaskBoard
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
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?