Telerik Forums
Kendo UI for jQuery Forum
6 answers
531 views
if I bind to a nullable integer which has an initial value of null, the combobox always returns a null value value to the controller, even if a value has been selected. if I change it to work with a  standard integer, it returns the correct value, but it also sets an initial value in the list which I do not want.

thoughts?

no initial value, but not updating either: public int? QuoteId { get; set; } 
returning values as expected, but populating 0: public int QuoteId { get; set; } 

@(Html.Kendo().ComboBoxFor(m => m.QuoteId)
                  .DataSource(dataSource => dataSource
                                                .Read(read => read.Action("GetQuoteList", "Payment")))
                  .DataTextField("Text")
                  .DataValueField("Value")
                  )
Josiah
Top achievements
Rank 1
Veteran
 answered on 15 Feb 2013
3 answers
132 views
Hi,

I have a similar code as your sample (http://demos.kendoui.com/web/grid/editing.html)

@(Html.Kendo().Grid<Kendo.Mvc.Examples.Models.ProductViewModel>()    
    .Name("Grid")    
    .Columns(columns => {        
        columns.Bound(p => p.ProductName);
        columns.Bound(p => p.UnitPrice).Width(140);
        columns.Bound(p => p.UnitsInStock).Width(140);
        columns.Bound(p => p.Discontinued).Width(100);
        columns.Command(command => command.Destroy()).Width(110);
    })
    .ToolBar(toolbar => {
        toolbar.Create();
        toolbar.Save();        
    })
    .Editable(editable => editable.Mode(GridEditMode.InCell))
    .Pageable()
    .Sortable()
    .Scrollable()
    .DataSource(dataSource => dataSource        
        .Ajax()         
        .Batch(true)
        .ServerOperation(false)
        .Events(events => events.Error("error_handler"))
        .Model(model => model.Id(p => p.ProductID))
        .Create("Editing_Create", "Grid")
        .Read("Editing_Read", "Grid")
        .Update("Editing_Update", "Grid")
        .Destroy("Editing_Destroy", "Grid")
    )
)
When I tried to add a new record, the count is incremented (say from 6 to 7), but once I hit the Save button, the count goes back to 6. If I refresh the page, the count will be correct (7). Any idea on how to fix this? Thank you so much.
Rosen
Telerik team
 answered on 15 Feb 2013
2 answers
36 views
The ComboBox binding to remote data demo is broken.  When it tries to bind the combobox, it throws the error "Uncaught SyntaxError: Unexpected token > ".  This happens in both Chrome 26 and IE8.

I tried to submit a bug report about this, but kept getting server errors when I tried to submit.
Richardsonke
Top achievements
Rank 1
 answered on 15 Feb 2013
3 answers
136 views

I have this situation:

I have some Views and by default they have assigned a Layout for them. The problem is that in some specific cases, I need to change the Layout of some of these Views in the Javascript file.

I am using this way:

$("#tabstrip-dash").setAttribute('data-layout', 'mobile-tabstrip-layout2');

This solution works only if I reload the application, but I want to change it instantly.

Is there any way to set the new Layout?

Thanks!

Alexander Valchev
Telerik team
 answered on 15 Feb 2013
1 answer
155 views
Hi,

I encountered a problem with listview endless scrolling.
The endless scrolling stops working after refesh the datasource.

I made a jsFiddle http://jsbin.com/amifov/3/edit

Try to make an endless scroll action and then hit the refresh button.

Thanks,
Martin
Georgi Krustev
Telerik team
 answered on 15 Feb 2013
1 answer
130 views
Hi All,

Just wondering if there is an out of the box solution for my small but frustrating issue: 

I am plotting bubbles on a chart, that has a y-axis of, say, min 0 and max 200. If I plot a bubble at y-0 the bubble will naturally cover the x-axis, which is correct. However, the way my chart has been designed (drop shadow involved!), I do not want the bubble to cover the x-axis line, I need some sort of buffering so min y-axis value appears higher up, therefore the whole bubble can fit into the chart, within the x-axis.

Any advice would be appreciated!

Cheers
Chris
Alexander Valchev
Telerik team
 answered on 15 Feb 2013
2 answers
91 views
So I have a scenario which I believe should be do-able in some form however I can't seem to figure out how to do it. Take for example the batch editing on the demo page: Batch Demo

Now imagine I've added another column which is now "Total Cost". What I'd like to do is trap on either a change in "Unit Price", or change in "Unit Stock" and be able to update the "Total Cost" field, and mark that as dirty.

I can go into the datasource and alter the value, but it seems when I refresh the grid, the dirty statuses are cleared. Is there a nicer way to do this that I'm missing?
Brian
Top achievements
Rank 1
 answered on 15 Feb 2013
4 answers
396 views
I'm just evaluating the Kendo grid for an upcoming project and I'm hunting for demos for the functionality that I need.

I have created a grid in an asp.net razor view that takes a viewmodel.  A couple of the model properties are enums which display nicely but when clicking into the cell just render a text box with the enum value (1,2,3,etc).

Does anyone have a demo where the edit field is an appropriate dropdown rather than the raw value of the enum?

Thanks in advance :)

=================================================================================

For reference the model and view I'm using are:
public class HomeMonitorViewModel {
 
  public int Id { get; set; }
  [Required, StringLength(255)]
  public string Name { get; set; }
  [Required, StringLength(128)]
  public string HostSystem { get; set; }
  public string Description { get; set; }
  public Data.MonitorClassification Classification { get; set; }
  public DateTime DateAdded { get; set; }
  public bool HasBeenAdministered { get; set; }
  public Data.MonitorSource Source { get; set; }
  public int MonitorAliasId { get; set; }
  public string MonitorAliasName { get; set; }
 
}
 
public enum MonitorClassification {
  Default = 1,
  Standard = 2,
  Bespoke = 3
}
 
public enum MonitorSource {
  Policy = 1,
  Adhoc = 2,
  Unknown = 3
}
@(Html.Kendo().Grid<ProjectBlackSun.Models.Home.HomeMonitorViewModel>()
  .Name("MonitorGrid")
  .Columns(c => {
    c.Bound(m => m.Name);
    c.Bound(m=>m.MonitorAliasName);
    c.Bound(m=>m.Description);
    c.Bound(m=>m.HostSystem);
    c.Bound(m=>m.Classification);
    c.Bound(m=>m.Source);
  })
  .ToolBar(t => {
    t.Create();
    t.Save();
  })
  .Editable(e => e.Mode(GridEditMode.InCell))
  .Pageable()
  .Sortable()
  .DataSource(d => d
    .Ajax()
    .Batch(true)
    .ServerOperation(false)
    .Events(e => e.Error("error_handler"))
    .Model(model => model.Id(monitor => monitor.Id))
    .Create("MonitorGridCreate", "Home")
    .Read("MonitorGridRead", "Home")
    .Update("MonitorGridUpdate", "Home")
    .Destroy("MonitorGridDestroy", "Home")
  )
)
 
<script type="text/javascript">
    function error_handler(e) {   
        if (e.errors) {
            var message = "Errors:\n";
            $.each(e.errors, function (key, value) {
                if ('errors' in value) {
                    $.each(value.errors, function() {
                        message += this + "\n";
                    });
                }
            });       
            alert(message);
        }
    }
</script>



Nick
Top achievements
Rank 1
 answered on 15 Feb 2013
1 answer
181 views
Hello,

I have added an example of the problem, see:
http://jsbin.com/edamuj/427/edit

I have an editable grid and want to connect it with an editable datasource. This works if I create the grid with the datasouce available. However in my solution I am not sure when the js for the datasource is rendered but if it is rendered I register it in a kendo observable array. A function to set the the grids datasource is bound the change event of the observable array. After this function fires I would like the grid to show the data. Unfortunately this is not working. I simplified the problem and added it as an example. Can someone explain to me what I am doing wrong here?

Marcel
Rosen
Telerik team
 answered on 15 Feb 2013
1 answer
114 views
Hello, I need to fill TreeView Object from asmx webservice.
The data must be:
Main
    DepA
         A
             A1
    DepB
        B
          B1
..............................................................
I don't need to get all data for tree creation for the first time.
I need append the nodes, from the webservice and 'refresh' the tree
The node must include the ID & Name.
How I must organize the WebServise? What format of data must be returned?
How I could append new node and recreate tree?
Petur Subev
Telerik team
 answered on 15 Feb 2013
Narrow your results
Selected tags
Tags
+? 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?