Telerik Forums
Kendo UI for jQuery Forum
0 answers
85 views
Hello,

Does Telerik grid for ASP.NET MVC2 (VS2008) exist? if so, please, provide the link to trial version.

We need such a grid with toolbar and other standard options.

Thank you in advance.

Goran
Goran
Top achievements
Rank 1
 asked on 14 Aug 2012
1 answer
188 views
i would like to access the messages of Response which is send by server whether it may be a failure or success message.
//===================================================== DATA SOURCES ==============================================================|
var projectDS = new kendo.data.DataSource({
    transport: {
        create: {
            url: '/api/HomeApi/Add',
            type: 'POST',
            contentType: 'application/json;charset=utf-8'   
        },
        read: {
            url: '/api/HomeApi/Get?projectId=' + $('#UrlProjectId').val(),
            dataType: 'json'
        },
        update: {
            url: '/api/HomeApi/Update',
            type: 'PUT',
            contentType: 'application/json;charset=utf-8',      
            success: function (response) { // this part also not works...
                alert(response.IsSuccess);
            }
        },
        parameterMap: function (options, operation) {
            if (operation !== 'read') {
                return JSON.stringify(options);
            }
            return options;
        }
    },
    schema: {
        model: {
            id: 'Id',
            fields: {
                Id: { type: 'number', editable: false },
                Title: { type: 'string',  },
                Description: { type: 'string' },
                StartDate: { type: 'date' },
                EstimatedEndDate: { type: 'date' }
            }
        }
         
    },
    change: function () {
        projectFormVM.set('currentRecord', this.view()[0]);
    },
    success: function (e) { // how to get this function works
        alert(e);
    }
});
 
//===================================================== VIEW MODELS ===============================================================|
// Add & Update Project View Model
var projectFormVM = kendo.observable({
    currentRecord: null,
    projectDataSource: projectDS,
    projectListUrl: '/Home/Projects',
    hasUpdate: (($('#UrlProjectId').val() != '') ? true : false),
    onStartDateChange: function () {
        var thisStartDate = this.get('currentRecord').StartDate;
        if (thisStartDate) {
            $('#EstimatedEndDate').data('kendoDatePicker').min(thisStartDate);
        }
    },
    onEndDateChange: function () {
        var thisEndDate = this.get('currentRecord').EstimatedEndDate;
        if (thisEndDate) {
            $('#StartDate').data('kendoDatePicker').max(thisEndDate);
        }
    },
    onSave: function () {
        this.projectDataSource.sync(); // -- synchronize the datasource when click the save button..
    }
});

The above code works properly both in add and update.
How to handle the response?...  My response object looks like {Success: true, Message: 'Record successfully updated...' }
Note: I m able to access the response using jquery ajax but i want to access only when datasource sync

Thanks in advance,
Ramesh
Ramesh
Top achievements
Rank 1
 answered on 14 Aug 2012
0 answers
197 views
Hi

I have a grid where I have a column with a custom editor template
{ field: "ShiftDefinitionId", title: "ShiftDefinitionId", format: "{0:n0}", width: "150px", editor: ShiftDefinitionIdEditor }

And also a corresponding editor template javascript function like
  function ShiftDefinitionIdEditor(container, options) {
    var inputField = $('<input data-text-field="ShiftDefinitionId" data-value-field="ShiftDefinitionId" data-bind="shiftDefinitionIdLookup: ShiftDefinitionId"/>')
    inputField.appendTo(container)
};

So now my problem is inside the custom binding
kendo.data.binders.shiftDefinitionIdLookup = kendo.data.Binder.extend({
  init: function () {
    var element = this.element;
  },
  refresh: function () {
    var element = this.element;
  }
});

this.element is undefined, but if i bind somewhere else the custombinding to a control, this.element is set.

How can I fix this problem

Regards
Roland
Roland
Top achievements
Rank 1
 asked on 14 Aug 2012
1 answer
184 views
hello
I'm new to kendo and was testing to see if buy the product while I'm making examples to see if I can use

I have a problem. I'm trying to do the  ForeignKeyColumn example but can´t  get the combobox when running
it show me a textbox (where should be the combo for my foreingkey) and 
I can edit it and change the id and grabs fine the data.    but I need a combo and i know something  is
 missing but can figure what

can you help please? 

My View

@(Html.Kendo().Grid<Kendo.Mvc.Examples.Models.CiudadViewModel>()
    .Name("Grid")    
    .Columns(columns => {        
        columns.Bound(p => p.id);
        columns.ForeignKey(p => p.empresa, (System.Collections.IEnumerable)ViewData["employees"], "id", "descripcion");        
        columns.Bound(p => p.descripcion);      
    })    
    .ToolBar(toolBar => toolBar.Save())
    .Editable(editable => editable.Mode(GridEditMode.InCell))
    .Pageable()
    .Sortable()
    .Scrollable()
    .Filterable()
    .DataSource(dataSource => dataSource        
        .Ajax()         
        .Batch(true)
        .ServerOperation(false)
        .Events(events => events.Error("errorHandler"))
        .Model(model => { 
            model.Id(p => p.id);
            model.Field(p => p.id).Editable(false);                
        })
        .Read(read => read.Action("ForeignKeyColumn_Read", "Home"))
            .Update(update => update.Action("ForeignKeyColumn_Update", "Home"))       
    )
)

MY VIEW MODEL

public class CiudadViewModel
    {
        [Key, DatabaseGenerated(DatabaseGeneratedOption.None)]
        public int id { get; set; }

        public string descripcion { get; set; }

        public int empresa { get; set; }

        [UIHint("Empresas"), Required]
        public EmpresaViewModel Empresa { get; set; }
    }

MY CONTROLLER 

 public ActionResult GridForeingKey()
        {
            PopulateEmployees();
            return View();
        }

        private void PopulateEmployees()
        {
            ViewData["employees"] = new EFDbContext().Empresas
                        .Select(e => new EmpresaViewModel()
                        {
                            id = e.id,
                            descripcion = e.descripcion
                        })
                        .OrderBy(e => e.descripcion);              
        }

        public ActionResult ForeignKeyColumn_Read([DataSourceRequest] DataSourceRequest request)
        {
            return Json(SessionClientOrderRepository.All().ToDataSourceResult(request));
        }

    public class SessionClientOrderRepository
    {
        public static IEnumerable<CiudadViewModel> All()
        {
            IEnumerable<CiudadViewModel> result = HttpContext.Current.Session["ciudad"] as IEnumerable<CiudadViewModel>;
            if (result == null)
            {
               HttpContext.Current.Session["ciudad"] = result = new EFDbContext().Ciudades
                    .Select(o => new CiudadViewModel
                    {
                        id = o.id,
                        descripcion = o.descripcion,
                        
                        empresa = o.Empresa ,
                        Empresa = new EmpresaViewModel
                        {
                            descripcion = o.descripcion,
                            id = o.id
                        }
                    }).ToList();
            }
            return result;
        }
    } 
Emo
Top achievements
Rank 1
 answered on 14 Aug 2012
1 answer
170 views
Hi,

Is it possible to add a different click event on each one of the bar chart categories?

So if I have 

categoryAxis: 
{
	categories: ["Bulgaria", "France", "Germany", "Italy", "Spain", "UK", "US"]
}

Is there any way I could have it so that when someone clicks on "Bulgaria", they are taken to "page.html#Bulgaria" for example?

thank you
Alex
Top achievements
Rank 1
 answered on 14 Aug 2012
3 answers
356 views
I specify a url for the window 'content' property. If a server error occurs on window open then my error handler is invoked as expected.

But how do I access the result of the url request? It's of no use to have a custom error page if I cannot display the message. I havent' been able to find any proper documentation on the error handlers 'e' parameter and I haven't found anything interesting using the debugger.
Alex Gyoshev
Telerik team
 answered on 14 Aug 2012
5 answers
1.1K+ views
Is this the actual implementation of kendo grid?
I wanted to have something like:
@(Html.Kendo().Grid(Model)
      .Name("Foo")
      .Events(e => e.DataBound("server_databound"))
)
and my script:
<script>
function server_databound(){
      alert("hey there!");
}
</script>

when the grid is loaded, the alert isn't fired until I included these:
.DataSource(ds => ds
     .Ajax()
)

is kendo grid's databound event only fired with ajax binding?
what may be a cleaner workaround for this that you might suggest?
Nikolay Rusev
Telerik team
 answered on 14 Aug 2012
1 answer
151 views

1) bar charts showing values like 4000 etc i want to present this value like "4.0 k". is there any way to format like this?
2) line chart labels values and bar chart values are over ride when those are in same position so is there any to show the values on top when the values are over ridden only ,other wise it should be in bottom
3) My X axis values are started from 2 nd line and  i want to start from 1 line

Barbaros Saglamtimur
Top achievements
Rank 1
 answered on 14 Aug 2012
0 answers
93 views
1 answer
136 views
In my grid the dirty flags aren't being removed after a successful update to the server. Does the server need to respond with a specific type of message to enable this to happen? It's currently returning an HTTP 200.
Nikolay Rusev
Telerik team
 answered on 14 Aug 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?