Telerik Forums
UI for ASP.NET MVC Forum
20 answers
1.2K+ views
Hi,

Using a simple ClientTemplate for a details url in a grid which worked in Telerik.MVC product the same cannot be said for Kendo UI.

@(Html.Kendo().Grid<VehicleGroupGridRow>()
    .Name("VehicleGroupGrid")
    .Columns(column =>
    {
        column.Bound(p => p.Title).ClientTemplate("<a href='/VehicleGroup/Details/#= Id #'>#= Title #</a>");
        column.Command(command => { command.Edit(); command.Destroy(); });
    })
    .ToolBar(commands => commands.Create())
    .Editable(editable => editable.Mode(Kendo.Mvc.UI.GridEditMode.InLine))
    .Sortable()
    .DataSource(dataSource => dataSource
            .Ajax()
            .Events(events => events.Error("error_handler"))
            .Model(model => model.Id(p => p.Id))
            .Create(create => create.Action("CreateVehicleGroup", "VehicleGroup"))
            .Read(read => read.Action("GetVehicleGroups", "VehicleGroup"))
            .Update(update => update.Action("UpdateVehicleGroup", "VehicleGroup"))
            .Destroy(destroy => destroy.Action("DestroyVehicleGroup", "VehicleGroup"))
    )
     
)

When I attempt to add a new item I get a Microsoft JScript runtime error 'Id' is undefined.

If I don't use a ClientTemplate then the grid works fine.

Thanks in advance
Philip
Top achievements
Rank 1
 answered on 02 Nov 2012
2 answers
579 views
If you add the class k-textbox to a TextArea, in firefox the text wraps as it should. However, in chrome it thinks its a TextBox and does not wrap.
nathan
Top achievements
Rank 1
 answered on 02 Nov 2012
0 answers
125 views
So I've spent the better part of my afternoon trying to find documentation or examples on how .Toolbar should work with a Kendo MVC grid and I've come up empty.  I've found its easy enough for a predefined command type (command.Create for example) but I'm trying to find documentation on how commands.Custom is supposed to work.  Does anyone have any documentation?  There was no mention of the Toolbar method at all in the API documentation.
Dan
Top achievements
Rank 1
 asked on 01 Nov 2012
2 answers
263 views
Hi,

I would like to know if someone had the same problem than me and if possible give me some help.
I was trying the grid component with a ForeingKey column and it works ok when I use the Visual Studio Compilation, but when I published the application it did not work very well. The column comboBox do not works.
I put all the .dll files in the project and had the same problem.
Have any idea?

I'm using visual studio 2010 with SP1
I published the application in IIS 7

Images to show my problem

IIS Publish [erro]
http://postimage.org/image/xjb3mlvfl/

Visual Studio Compilation [ok]
http://postimage.org/image/hz3pw2lb5/


Felipe
Top achievements
Rank 1
 answered on 01 Nov 2012
6 answers
354 views
I have a grid with a checkbox in each row to select the row
How can I highlight the checked rows?

I used the following codes in the Change event
var grid = $("#grid").data("kendoGrid");
grid.select($("tr[data-uid]").has("input[name=checkboxName]:checked"));

However, when I unselect a row, the unselected row is still highlight
Can I disable user to select a row, but only select row by javascript?
Richard
Top achievements
Rank 1
 answered on 01 Nov 2012
0 answers
113 views
Can you point me to documentation for using the Entity Data Framework to source data with Kendo MVC widgets (preferably GRID)?
Thank you
Aron
Top achievements
Rank 1
 asked on 01 Nov 2012
1 answer
1.4K+ views
I am using custom commands and trying to get the selected dataitem. I am getting an error inside 
the javascript call on this.dataitem
By debugging in chrome i can see that the this.data is not populated on binding directly to a model. 
Where as in the telerik examples it is populated.
This is my code:
@using Kendo.Mvc.UI
  @{
     var addressList = Model.DataList as List<Intelli.Data.Parties.EFDAL.Entity.GeoAddress>;
   }
 
<script type="text/javascript">
  function viewgeoaddress(e) {
         //prevent the request which will be made by default
         e.preventDefault();
 
        //error occurs here!!
         var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
          
 
         }
     };
</script>
 
 
 @(Html.Kendo().Grid(addressList)
    .Name("GridPartyGeoAddresses")
    .Columns(columns =>
            {
                columns.Bound(p => p.ID).Title("ID").Hidden(true);
                columns.Bound(p => p.Address).Title("Address").Width(160);
                columns.Bound(p => p.Region).Title("Region").Width(80);
 
                columns.Bound(p => p.Zipcode).Title("Zipcode").Width(80);
                columns.Command(commands => commands
                                                .Custom("btnviewgeoaddress")
                                                .Text("View")
                                                .Click("viewgeoaddress")
                                                .HtmlAttributes(new { style = "text-align: center" }));
                columns.Command(commands => commands
                                                .Custom("btndeletegeoaddress")
                                                .Text("Remove")
                                                .Click("deletegeoaddress")
                                                .HtmlAttributes(new { style = "text-align: center" }));               
                 
 
            })
 
    .Scrollable(scr => scr.Enabled(true).Height(300))
    .Sortable(builder => builder.Enabled(true))
    .Resizable(resizing => resizing.Columns(true))
    //.Selectable()
    //                .DataSource(dataSource => dataSource
    //                                              .Ajax()
    //                                               .ServerOperation(false)
 
    //                    )
     
    )
 
 
Vladimir Iliev
Telerik team
 answered on 01 Nov 2012
1 answer
829 views
Hi,

I'm trying to have a simple event that will execute on grid's databound but the grid doesn't seem to locate it.

The error is my script method is not define based on firebug

Here's my code..

@(Html.Kendo().Grid<Model>()    
    .Name("Grid")
    .Columns(columns =>
                 {
                     columns.Bound(p => p.Name);
                     columns.Bound(p => p.Allow);
                     columns.Bound(p => p.Category);
                 })
    .DataSource(dataSource => dataSource
        .Ajax()
        .Group(group => group.Add(p => p.Category))
        .Read(read => read.Action("Data""Method"))     )     .Selectable(selectable => selectable.Mode(GridSelectionMode.Single))     .Events(events => events.DataBound("GridOnDataBound"))          )

<script type="text/javascript">
    function GridOnDataBound() {
        alert("I'm in");
    }
</script>


Jayesh Goyani
Top achievements
Rank 2
 answered on 01 Nov 2012
1 answer
107 views
Hi all,

I'm using the grid with pop-up editing and the function to delete the selection.

Everything goes well. Deleting multiple rows, inserting new rows, no problem. However, when I select all the rows of the current page and delete them, the rows get deleted but when I insert a new row, strange behavior occurs.

Sometimes the popup opens and closes and sometimes I am able to fill in the fields but when I click on update, the grid hangs. It only occurs when deleting all the rows on the page.

Is there something I can do to fix this?

Kind regards,

JS
Petur Subev
Telerik team
 answered on 01 Nov 2012
1 answer
170 views
Hello!

I am curious what's new in the latest version update released for 2012.2.1029, as in any new additions or fixes ?

I have noticed the latest version update reported on kendo website is for Q2 2012 SP1 (version 2012.2.913) and wondering why there is no mention of the newer update released through Visual Studio telerik manager.

Cheers,
JS


Kamen Bundev
Telerik team
 answered on 01 Nov 2012
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
ComboBox
Upload
MultiSelect
ListView
Window
TabStrip
Menu
Installer and VS Extensions
Spreadsheet
AutoComplete
TreeList
Gantt
PanelBar
NumericTextBox
Filter
ToolTip
Map
Diagram
Button
PivotGrid
Form
ListBox
Splitter
Application
FileManager
Sortable
Calendar
View
MaskedTextBox
PDFViewer
TextBox
Toolbar
Dialog
MultiColumnComboBox
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
ColorPicker
DateRangePicker
Security
Wizard
Styling
Chat
DateInput
MediaPlayer
TileLayout
Drawer
SplitView
Template
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Badge
LinearGauge
ModalView
ResponsivePanel
TextArea
Breadcrumb
ExpansionPanel
Licensing
Rating
ScrollView
ButtonGroup
CheckBoxGroup
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
DateTimePicker
AppBar
BottomNavigation
Card
FloatingActionButton
Localization
MultiViewCalendar
PopOver (Mobile)
Ripple
ScrollView (Mobile)
Switch (Mobile)
PivotGridV2
FlatColorPicker
ColorPalette
DropDownButton
AIPrompt
PropertyGrid
ActionSheet (Mobile)
BulletGraph
Button (Mobile)
Collapsible
Loader
CircularGauge
SkeletonContainer
Popover
HeatMap
Avatar
ColorGradient
CircularProgressBar
SplitButton
StackLayout
TimeDurationPicker
Chip
ChipList
DockManager
ToggleButton
Sankey
OTPInput
ChartWizard
SpeechToTextButton
InlineAIPrompt
TimePicker
StockChart
RadialGauge
ContextMenu
ArcGauge
AICodingAssistant
SmartPasteButton
PromptBox
SegmentedControl
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?