Telerik Forums
Kendo UI for jQuery Forum
3 answers
285 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
2 answers
250 views
Hi,

I'm having trouble trying to make a Scroller component work. Basically, what i want to do is a scrollable table with fixed headers at the top and left (fixed in the sense that they are always visible, but they follow the table content as it scrolls). The problem is that when i initialize the Scroller using kendoMobileScroller the table only scrolls horizontally; the vertical scrolling doesn't work. Here's a simplified example showing this behaviour (it doesn't have the fixed headers on the table.. it's just a scrollable table).

I guess i'm doing something wrong here, as it's a very simple example, but i haven't figured it out.

Thanks in advance :)

Edit: i've found a previous thread that discusses a similar problem, but it was from an older version of Kendo (i'm using 2012.2.913).
John Willey
Top achievements
Rank 1
 answered on 19 Oct 2012
0 answers
86 views
I'm wondering how to set the grid editable property from false to true from a button to toggle the grid from readonly to r/w mode. Thanks
Chris
Top achievements
Rank 1
 asked on 19 Oct 2012
0 answers
190 views
Hello,
I am using the Kendo UI ComboBox with an external, XML DataSource. Here's the DataSource code:

    try
        {
            var csDataSrc = new kendo.data.DataSource(
            {
                transport:
            {
                read: "Data/StateList.xml",
                dataType: "xml",
                create: { cache: true }
            },
            schema:
            {
                type: "xml",
                data: "/States/State",
                model:
                {
                    fields:
                    {
                        id: "id/text()",
                        name: "name/text()"
                    }
                }
            }
        });
        csDataSrc.read();
    }
    catch (err)
    {
        log.error(err.message);
    }


That creates the data source, here's the code that creates the kendo combobox:


    $("#stateList").kendoComboBox(
    {
   index: 0,
   placeholder: "Begin typing Coverage State...",
   dataTextField: "name",
   dataValueField: "id",
   filter: "contains",
   dataSource: csDataSrc,
   text: $("#hdnStateName").val(),
   value: $("#hdnStateKey").val(),
   change: function(e)
   {
   $("#hdnStateKey").val(this.value());
   $("#hdnStateName").val(this.text());
   }
    });


This works really well but the data for the real list is enormous and I'd like to store it in local storage with something like this:
    localStorage.setItem("state_key", csDataSrc);
Then when the page loads instead of building and reading from the server side xml all the time, I'd like for it to be something like this:


    var csDataSrc = localStorage.getItem("state_key");
    if(csDataSrc === null)
    {
        // create the data source with the above code
        // and store it in localStorage.
    }
Then bind it here...


    ...kendoComboBox(
    {
        ...,
        .dataSource: csDataSrc,
        ...
    });


I create the data source fine, it seems to store correctly in localStorage but when you leave the page and come back the data source is always null.  I can see it using the resources tab of the Chrome developer tools but it won't bind to the combo box correctly.
Any help or if I need to elaborate on anything to make this clearer please let me know


Thanks
-s

Sean
Top achievements
Rank 1
 asked on 19 Oct 2012
0 answers
133 views
I have a grid that has one column with checkbox.It uses batch editing to save the changes. I need to make cells editable/uneditable  in the row when checkbox in that row is checked/unchecked.

Thanks,
Sanjeev
Sanjeev
Top achievements
Rank 1
 asked on 19 Oct 2012
0 answers
76 views
Unable to get value of the property 'get': object is null or undefined

A very similar issue is reproduceable on IE9 with this example http://jsfiddle.net/rniemeyer/UgUVK/


 IE9 version 9.0.8112.XX
niall
Top achievements
Rank 1
 asked on 19 Oct 2012
3 answers
276 views
Hi,
I can't print grid with css style.
I need print a information and haven't positive result.
Helpme Please!

Thanks.
Dimo
Telerik team
 answered on 19 Oct 2012
0 answers
90 views
I am using the mobile button widget, but tweaking the style. Running in Chrome on the desktop (w/ iPad user agent) the button does not draw a box shadow, which is what I want. Running on the iPad simulator or actual device, there is a border around the button. If I use the remote inspector in Safari to play with styles, I can turn the box-shadow off, as shown/defined here, and it looks and works fine:

.km-ios .km-button {
    ...
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.3);
    -webkit-box-shadow: inset 0 0 0 1px rgba(0,0,0,0.3);
}

So when I define a custom style to override this, it removes the border but I lose the highlight feedback on touch/tap of the button. I've defined the custom style like this:

#tasklist .km-button {
    box-shadow: none;
    -webkit-box-shadow: none;
}

I've also tried redefining it as the same box-shadow values except not "inset". Same result. Any ideas?
Dennis
Top achievements
Rank 1
 asked on 19 Oct 2012
1 answer
998 views
If I have a <th> element that has text where the first character is a numeric value (e.g. '1 Title'), the attempt to create a KendoGrid from the table fails.  For example, the following code fails, but if I replace '1 Title' with something like 'A1 Title', it works.  Is it suppose to work that way?

<
table id='OneTable'>
  <thead>
    <tr>
      <th>One Title</th>
      <th>1 Title</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>One Data</td>
      <td>1 Data</td>
    </tr>               
  </tbody>
</table>
 
<script type="text/javascript">
    $(document).ready(function () {
        $('#OneTable').kendoGrid();
    });
</script>
Dimo
Telerik team
 answered on 19 Oct 2012
4 answers
441 views
Maybe I missed this in the documentation but can I declare the absolute width for the legend? It does not seem to work well with my defined width of the chart and items get cut off. How does the legend decide when to drop items to another line? Can I control this?
Oscar
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
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
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
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
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
Iron
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?