Telerik Forums
UI for ASP.NET MVC Forum
4 answers
813 views
HI,

   I am working on exploring the grid features of the Kendo UI. I am working on binding the data table to the grid and populating  the data's.
   
I got the sample solution to work on the data table with the grid from the below URL.

URL: http://www.kendoui.com/code-library/mvc/grid/binding-to-datatable.aspx

I am pretty impressed with the Grid View, but when to try to create the  the edit view  mode as INLINE (or ) INCEL in the grid  i am getting the below error.when i try to give the popup in the gridview, I am not getting anything from the data table in popup.

Please suggest me that whether am I trying anything wrong or Kendo UI dosen't support the below functionality.if kendo UI supports this functionality,
 could you please give me the working example ???????

Error:

"Templates can be used only with field access, property access, single-dimension array index, or single-parameter custom indexer expressions."


Code Used:

@model System.Data.DataTable

@(Html.Kendo().Grid(Model)
    .Name("Grid")    
    .Columns(columns => {
        columns.Command(command => { command.Edit(); }).Width(100).Title("Edit");
        columns.Command(command => { command.Destroy(); }).Width(100).Title("Delete");
        foreach (System.Data.DataColumn column in Model.Columns)
        {
            columns.Bound(column.DataType, column.ColumnName);     
        }
    })    
   .Editable(ed => ed.Mode(GridEditMode.InCell))
   .ToolBar(toolbar =>
            {
                toolbar.Create();               
                toolbar.Save(); 

            })
   .Pageable()
    .Sortable()
    .Scrollable()
    .DataSource(dataSource => dataSource        
        .Ajax()
        .Batch(true)
        .Model(model =>{model.Id(OP => OP.Row[0]);
            model.Field(pd => pd.Row[0]).Editable(false);})
        .Create(update => update.Action("EditingInline_Create", "ModelsView"))
        .Read(read => read.Action("Read", "Home"))
        .Update(update => update.Action("EditingInline_Update", "ModelsView"))
        .Destroy(update => update.Action("EditingInline_Destroy", "ModelsView"))    
    )
)

Raju
Top achievements
Rank 1
 answered on 05 Apr 2013
0 answers
254 views
I'm using the Table Per Concrete type where I have all my models inherit from one base class which has common properties. Since the Get, Insert, Update, and Delete methods do the same thing for each model I'm using, I want to make these methods reusable for each of these models.

Here is the code that I currently have:

PhoenixDB ctx = new PhoenixDB();

public ActionResult Index()
{
return View();
}

public ActionResult Get([DataSourceRequest] DataSourceRequest request)
{
return Json(GetViewModels().ToDataSourceResult(request));
}

public ActionResult Update([DataSourceRequest] DataSourceRequest request, Parameter parameter)
{
var parameterToUpdate = ctx.Parameter.First(param => param.ParameterID == parameter.ParameterID);
TryUpdateModel(parameterToUpdate);

ctx.SaveChanges();

return Json(ModelState.ToDataSourceResult());
}

public ActionResult Insert([DataSourceRequest] DataSourceRequest request, Parameter parameterToAdd)
{
if (ModelState.IsValid)
{
ctx.Parameter.Add(parameterToAdd);
ctx.SaveChanges();
}

return Json(new[] { parameterToAdd }.ToDataSourceResult(request));
}

public ActionResult Delete([DataSourceRequest] DataSourceRequest request, Parameter parameter)
{
var parameterToDelete = ctx.Parameter.First(param => param.ParameterID == parameter.ParameterID);

if (parameterToDelete != null)
{
ctx.Parameter.Remove(parameterToDelete);
ctx.SaveChanges();
}

return Json(new[] { parameterToDelete }.ToDataSourceResult(request));
}

private IQueryable<Parameter> GetViewModels()
{
return (from parameter in ctx.Parameter select parameter);
}

Here is something I would like to do to make it generic, but not sure how:

public ActionResult Update([DataSourceRequest] DataSourceRequest request, Base base)
{
var baseToUpdate = ctx.Base.First(param => param.ParameterID == base.ParameterID);
TryUpdateModel(baseToUpdate);

ctx.SaveChanges();

return Json(ModelState.ToDataSourceResult());
}

Any help with this would be greatly appreciated.
Greg
Top achievements
Rank 1
 asked on 05 Apr 2013
1 answer
1.3K+ views
In Kendo Grid, How to automatically adjust the column width on the basis of the column data length and browser window width
Dimiter Madjarov
Telerik team
 answered on 05 Apr 2013
0 answers
376 views
I am starting a new project and was going to use KendoUI for it.
But there it does not have any docking functionality.
Whereas the telerik ASP.NET Ajax controls do.

Now i am wondering if i should not just use those instead.
But before i make a decision i would love some input on this.
What are the advantages and disadvantages of both?

In what cases would one work better over the other?
Andrew
Top achievements
Rank 1
 asked on 05 Apr 2013
2 answers
110 views
Hi Guys,
I was trying to follow your instructions, downloaded couple test projects from this forum, but I cannot make ComboBox show up without error unfortunately. The error is attached as image.  

Unfortunately I cannot attach project archive here, its 3.2 MB. You can find the archive here:
https://mega.co.nz/#!iVBERZBS!GxynyTs87MJHuzOub4VoBw4iSSUmDv7cOxP3ml0kp

Can you please take a look, I was just trying to show simple ComboBox on /Home/Index.cshtml

Thank you in advance!
sta
Top achievements
Rank 1
 answered on 05 Apr 2013
1 answer
133 views
On this page.

http://docs.kendoui.com/getting-started/framework/globalization/overview

The first link with the name "this help topic" points to a blank page.

http://docs.kendoui.com/getting-started/framework/globalization/formatting
Dimiter Madjarov
Telerik team
 answered on 04 Apr 2013
1 answer
185 views
I need to preserve the filter, page, sort of my grid after moving off the page and coming back to it.  I found using a cookie to preserve grid state in the code library: http://www.kendoui.com/code-library/web/grid/preserve-grid-state-in-a-cookie.aspx. I have an MVC application, so I am having some difficulty understanding what is going on in the example, and what I would need to do to make this work with MVC.  Can someone explain how to make this logic work with MVC?
Dimiter Madjarov
Telerik team
 answered on 04 Apr 2013
5 answers
142 views
I have just updated to the latest build this morning.

2 issues with the grid:

a) when I click insert (toolbar) - it works the first time - the 2nd time - i have to refresh the browser.

b) when on the 2nd or higher page of a grid, clicking the insert does not have the popup appear.  By the looks of it, the shadow record is added to the grid on insert ... and since it's on another grid page - causes the grid to refresh and the popup edit window does not appear.

Update:  It seems like the edit popup edit window will open the first time (editing grid row) - but after that - the attached image shows what's breaking.
Rene
Top achievements
Rank 1
 answered on 04 Apr 2013
2 answers
202 views
If you have a menu and add a item like the line below. All menu items after the line show up even if the authorize say they should not. The menu work as expected if the line is  the last line. (1q 2013)
items.Add()
       .Text("Användare").Action("Index", "Dashboard", new { area = "SecurityGuard" });
Jan Olsmar
Top achievements
Rank 1
 answered on 04 Apr 2013
5 answers
456 views
DropDownLists (or ComboBoxes) for numeric members on the model do not post their value when used in a grid. I have attached a sample project. Is there anything I am doing wrong or need to do differently in order to accomplish this?
Daniel
Telerik team
 answered on 04 Apr 2013
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
Security
ColorPicker
DateRangePicker
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
LLM Kit
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?