Telerik Forums
Kendo UI for jQuery Forum
1 answer
213 views
I have this code:
@(Html.Kendo().MobileView()
    .Name("MobileViewOrderOverview")       
    .Title("Order overview")
    .Layout("LayoutOrderOverview")
    .Content(obj =>        
        Html.Kendo().MobileListView()
            .Events(e => 
                e.Click("MobileViewCreditor_Clicked")
            )
            .Name("MobileListOrderOverview")                
            .TemplateId("TemplateOrderOverview")                
            .DataSource(dataSource => 
                dataSource
                    .Model(x => x.Id("No"))
                    .Read("Orders", "Json")
            )
            .Filterable(filter =>
                filter.Field("BuyFromVendorName")
                .Operator("contains")
            ))        
)

Which works. But I would like to add additional fields to the filter. So that I can search in the "No" and "BuyFromVendorName" fields at the same time.

Can this be accomplished without adding a search-property to the results?
Kiril Nikolov
Telerik team
 answered on 18 Dec 2013
6 answers
157 views
Hi.  The key values in the JSON I am getting back have spaces in them.  this, I am not able to use the #: keyNameHere # notation in my template.  Additionally, the keys here are custom and will not be the same from customer to customer so I would like to be able to reference them with something like subscript values.  Is this possible?
Kiril Nikolov
Telerik team
 answered on 18 Dec 2013
1 answer
103 views
Hi guys,

I would like to implement a export solution and so far I can't find a solution that would suit our needs

I looked on this 2 examples provided by the Kendo Support Team:
http://www.kendoui.com/code-library/mvc/grid/export-grid-to-excel.aspx
http://www.kendoui.com/blogs/teamblog/posts/13-03-12/exporting_the_kendo_ui_grid_data_to_excel.aspx

We are licensed Kendo UI Complete so we can't use this solution:
http://www.kendoui.com/code-library/mvc/grid/export-grid-to-excel.aspx

This solution actually sends all the export data to the server (and to us that is not acceptable):
http://www.kendoui.com/blogs/teamblog/posts/13-03-12/exporting_the_kendo_ui_grid_data_to_excel.aspx

What we would really like is to define a new button on the grid header and to make a call to a WebApi specifying a different Http Verb or a different call parameter.
The main problem that we currently face is how to convert the filters / paging to an Odata Query String:

We tried something like this:
kendo.data.transports["odata"].parameterMap($("#grid").data("kendoGrid").dataSource._filter, 'json')
But this serialization does not provide the required result -  the filters formatted as an odata querystring. Eg:
"{"filters":[{"field":"Code","operator":"contains","value":"f"}],"logic":"and"}"
So could you please tell us how to serialize the datasource (filters, sort, etc.) as an odata querystring ?

**sorry about the thread name - i don't know how to change it to Kendo Grid Export
Atanas Korchev
Telerik team
 answered on 18 Dec 2013
1 answer
211 views
I have the following requirement:

* User Types 25.316  and tabs out ->  Control shows 25.316
* User Types -5 and tabs out -> Control shows -5
* User Types 16.4241 and tabs out -> Control shows 16.4241

How can I get the numeric textbox to meet this simple requirement?   It seems to always want to format or massage the data, but this is undesirable as I'm trying to use it to allow the user to enter latitude / longitude coordinates which can have a variable number of decimal places.

Am I missing something?

Thanks,
Shaun
Shaun
Top achievements
Rank 1
 answered on 17 Dec 2013
1 answer
90 views
I am creating an MVC 4 website.  Does the UIFramework and MVVM work WITH MVC or is it a replacement for MVC?
In other words, should I be using one or the other? Or both?

For example, I have a number of TextBoxs that I need to bind to create a Form.  Should I being using the Kendo Templates for this?  Or just use @Razor syntax.

I would prefer to just use Razor syntax, but I thought maybe I am mixing up the two technologies.
Greg Gum
Top achievements
Rank 1
 answered on 17 Dec 2013
9 answers
194 views
Hello,

I'm using the Kendo UI trial version and have been able to get the grid working correctly, however I'm seeing some weird behavior when the grid is rendered ( see attached ). Any idea what's causing this problem and how can I fix this?

Thanks.
Andrew
Top achievements
Rank 1
 answered on 17 Dec 2013
1 answer
766 views
Hi,
I am trying to use kendo datepicker inside a grid using editor template but when a select a date from date picker, it doesn't bind that selected date value to the grid and value remains the same as it was earlier. So I am not able to update the value for a particular field using datepicker inside kendogrid.
Here is my code:

This is my View part:


  @(Html.Kendo().Grid<PricePoint.Model.PriceSheet.PriceSheetHeader>()
                  .Name("Grid")
                  .Columns(columns =>
                  {

  columns.Bound(p => p.stateid).Title("[[[State]]]").Width(50);
                      columns.Bound(p => p.distributor).Title("[[[Distributor]]]").Width(100);
                      columns.Bound(p => p.whare_house_code).Title("[[[Warehouse Code]]]").Width(120);
                      columns.Bound(p => p.brand).Title("[[[Brand]]]").Width(100);
                      columns.Bound(p => p.item).Title("[[[Item]]]").Width(100);
                      columns.Bound(p => p.fob).Title("[[[FOB]]]").Width(50).Format("{0:" + ViewBag.GetAllFormat.currencyFormat + "}");
                      columns.Bound(p => p.pricesheetform_version_no).Title("[[[Form Version]]]").Width(50);
                      columns.Bound(p => p.startdate).Title("[[[Start Date]]]").Width(50).Format("{0:dd/MM/yyyy}").EditorTemplateName("DateTime");
                      columns.Bound(p => p.enddate).Title("[[[End Date]]]").Width(200).Format("{0:dd/MM/yyyy}").Width(170).EditorTemplateName("EditrTemp");
                     columns.Bound(p => p.createdate).Title("[[[Created On]]]").Width(50).Format("{0:" + ViewBag.GetAllFormat.dateFormat + "}");
                      columns.Bound(p => p.modifydate).Title("[[[Modified On]]]").Width(50).Format("{0:" + ViewBag.GetAllFormat.dateFormat + "}");
                      columns.Bound(p => p.createby).Title("[[[Created By]]]").Width(50);
                      columns.Bound(p => p.modifyby).Title("[[[Modified By]]]").Width(50);
                  }).ToolBar(toolBar =>
                                    {
                                      
                                        toolBar.Save();
                                        toolBar.Custom().Text("[[[Export To Excel]]]").HtmlAttributes(new { onclick = "javascript:ExportToExcel(event);", @class = "k-button" });
                                    })
                                        .Editable(editable => editable.Mode(GridEditMode.InCell))
                 .Events(ev=>ev.DataBound("db"))  
                  .Pageable(pageable =>
                  {
                      pageable.Refresh(true);
                      pageable.PageSizes(new int[] { 25, 50, 100, 200 });  
                      pageable.Messages(messages => messages.Empty("[[[No form found]]]"));
                  })
                  .Sortable()
                  .Filterable(f => f.Operators(o => o.ForString(fs =>
                              { fs.Clear().Contains("Contains");
                                fs.DoesNotContain("Does not contain");
                                fs.IsEqualTo("Equal to");
                                fs.IsNotEqualTo("Not equal to");
                                fs.StartsWith("Starts with");
                                fs.EndsWith("Ends with"); })))
                  .HtmlAttributes(new { style = "min-width: 1250px;" })
                  .DataSource(dataSource => dataSource
                      .Ajax()
                      .ServerOperation(false) // paging, sorting, filtering and grouping will be applied client-side
                      .Batch(true)
                      .Model(model =>
                      {
                          model.Id(p => p.pricesheetid);                                  
                      })
                
                      .Read("GetAllModifyPriceSheetAjax", "PriceSheet")
                      .Update(update => update.Action("UpdatePriceEntry", "PriceSheet"))
                        .PageSize(25)
                      .Events(events => events.Error("error_handler"))
                
                
                  )
                  )


This is the EditrTemp i am using for datepicker:

@model DateTime?

@(Html.Kendo().DatePickerFor
(m => m)
.Name("EditrTemp")
.Format("dd/MM/yyyy")
      )









Alexander Popov
Telerik team
 answered on 17 Dec 2013
7 answers
555 views
Hi Kendo Team:

Documentation says that kendo validator has a validate event that triggers when validation completes, but there's no sample in your demos.
Could you please provide any sample showing this?
Kind regards.
Oscar.
Kiril Nikolov
Telerik team
 answered on 17 Dec 2013
1 answer
46 views
I have created a Combobox that allows a user to search through a series of "Code - Description" options in order to select the "Code"...  The Code is what we wnat to have the user select but sometimes they need the description in order to pick the correct one.  I've set up the combobox so that they can start typing any three characters from the code or description and the dropdown list is then filtered to show options that match accordingly.

THis works most of the time, however sometimes the users just know the "Code", which is a 4 digit number.  If they just type in "1234" it doesn't actually "select" it in the combobox...  How can I get it to select the code if they type it into the box?

Thanks,
Jason
Kiril Nikolov
Telerik team
 answered on 17 Dec 2013
7 answers
2.0K+ views
I'm new to asp.net mvc as well as kendoui so this question may seem trivial (for both kendo and mvc).  But any help/explanation would be greatly appreciated.

I'm building a grid using the kendo ui mvc helper.  And there are many situations where I want to access item data.  I've figured out how to access it when created a template for a given cell as seen below.  

As you can, I've created a function to create a data attribute, and I would like to read that attribute from the database rather than hardcoding it.  Here is the code that I currently have.

    @functions
    {
        public static Dictionary<string, object> BuildGroupNameAttributes(string value)
        {
            var attributes = new Dictionary<string, object> { { "data-groupname", value } };
            return attributes;
        }
    }
    <div id="dotComDiv">
        @(Html.Kendo().Grid(Model)
              .Name("DotComGrid")
              
              .Columns(columns =>
              {                  
                  columns.Bound(p => p.GrossDemand.ThisYear).Title("TY").HeaderHtmlAttributes(BuildGroupNameAttributes("Gross Demand"));
                  columns.Bound(p => p.GrossDemand.ThisYear).Title("TY").HeaderHtmlAttributes(BuildGroupNameAttributes("Gross Demand")).Template(@<text>@string.Format("{0:0,0}", @item.GrossDemand.ThisYear)</text>);
   
              }).Scrollable(src => src.Height(500))
    
    
              )
    </div>

The line that I can't seem to work out is

    columns.Bound(p => p.GrossDemand.ThisYear).Title("TY").HeaderHtmlAttributes(BuildGroupNameAttributes("Gross Demand"));

Instead of hardcoding "Gross Demand" I want to read that from the bound item.  So like,


    columns.Bound(p => p.GrossDemand.ThisYear).Title("TY").HeaderHtmlAttributes(BuildGroupNameAttributes(@item.GroupName));

However, I can't access the item object like this.  But if you look at the template above, I'm able to access `@item` if it's wrapped in `@<text>`

Why is that, and how can I pass the item value to the function?

Thanks!


Vladimir Iliev
Telerik team
 answered on 17 Dec 2013
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
Application
Map
Drag and Drop
ToolTip
Calendar
PivotGrid
ScrollView (Mobile)
Toolbar
TabStrip (Mobile)
Slider
Button (Mobile)
SPA
Filter
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
MultiColumnComboBox
Chat
DateRangePicker
Dialog
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
OrgChart
TextBox
Effects
Accessibility
PivotGridV2
ScrollView
BulletChart
Licensing
QRCode
ResponsivePanel
Switch
Wizard
CheckBoxGroup
TextArea
Barcode
Breadcrumb
Collapsible
Localization
MultiViewCalendar
Touch
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
StockChart
ContextMenu
TimePicker
DateTimePicker
RadialGauge
ArcGauge
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?