Telerik Forums
UI for ASP.NET MVC Forum
2 answers
268 views
I am hoping you can help me with this problem.

I have been trying to get Batch Editing to work on a grid for line items to an order for a couple of days now. At first I just went with samples I found from the demos online here and got it kind of close but not quite working. So I followed the sample that came with the product to a the letter I thought, and am having issues. Zip file attached. I created a SessionLineItemRepository and a LineItemViewModel  as seemed necessary from the sample. My problems are:

1. Now when I add an item it updates the grid but does not insert into the database. You will see in my controller that I took care of that, but I don't think it is suppose to work that way.

2.  I cannot  get _Update to work because when I edit any records, for some reason it calls the _Create method and inserts every record in the list into the table again when I click Save.

3. _Delete is never fired. At one point I had it deleting from the grid but not from the database.

4. the tab key no longer tabs from field to field when I have  .Batch(true) set for the grid. So when in add new record mode you have to click in each field to edit rather than enter data hit tab and enter data. The sample online seems to work that way.

I am not sure if I am suppose to have a separate controller for the grid or have the code in my LineItemController as I do now. But it surely is not close to working and I have tried all that I can think of. My plan now is to abondon the SessionLineitem and LineitemVeiwModel because I was a whole lot closer before I did that.

I am very new to Kendo and your help is appreciated. Sorry if I am a little slow on this stuff.

Thank you,


Paul
 
Petur Subev
Telerik team
 answered on 28 Sep 2012
0 answers
149 views
Hi. I'm using Kendo Grid with Hierarchy.
And in some cases I need to show expand sign(if there is any info for this row) and in some not.
Or even I can always show this sign, but I need to show different ClientDetailTemplates depending on conditions.
How can I manage this?

Here's code fragment:
 @(Html.Kendo().Grid<AreaModel>()
                                        .Name("AreaModels")
                                        .Columns(columns =>
                                        {
                                            columns.Bound(o => o.AreaName).Width(101);
                                            columns.Bound(o => o.NumberOfActiveItems).Width(101);

                                        })
                                        .DataSource(dataSource => dataSource
                                            .Ajax()
                                            .Read(read => read.Action("HierarchyBinding_Areas", "Home"))
                                        )
                                        .ClientDetailTemplateId("projectsTemplate")
                                        //.Sortable()
                                        //.ToClientTemplate()
                                    
                                        )

 <script id="projectsTemplate" type="text/kendo-tmpl">
@(if("Some condition goes here"))
{
@Html.Label("111")
}
else
{
@Html.Label("2222")
}

</script>
                                           
Vladimir Vyahov
Top achievements
Rank 1
 asked on 28 Sep 2012
1 answer
157 views
I have a grid that is not paging correctly.  When I click on next page nothing happens.

Here is my code.

_layout.cshtml

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <title>@ViewBag.Title - My ASP.NET MVC Application</title>
        <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
        <meta name="viewport" content="width=device-width" />
        @Styles.Render("~/Content/Site.css")




         @Styles.Render("~/Content/kendo/2012.2.710/kendo.common.min.css")
         @Styles.Render("~/Content/kendo/2012.2.710/kendo.default.min.css")


        @Scripts.Render("~/Scripts/jquery-1.7.1.min.js")
         @Scripts.Render("~/Scripts/kendo/2012.2.710/kendo.web.min.js")
            @Scripts.Render("~/Scripts/kendo/kendo.aspnetmvc.min.js")


    </head>
    <body>
          <h2>Benchmarks</h2>
        <header>
             <div id="logindisplay">
                    Hello, @User.Identity.Name!
            </div>
             <nav>
                    <ul id="menu">
                        <li>@Html.ActionLink("Home", "Index", "Home")</li>
                    </ul>
                </nav>
        </header>
        <div id="body">


            <section class="content-wrapper main-content clear-fix">
                @RenderBody()
            </section>
        </div>
       


     
    </body>
</html>
======================================================
index.cshtml

@model IEnumerable<Benchmarks.Models.Benchmark>


<script src="~/Scripts/kendo/2012.2.710/kendo.pager.min.js"></script>






@(Html.Kendo().Grid(Model)            //The grid will be bound to the Model which is the Products table
      .Name("productGrid") //The name of the grid is mandatory. It specifies the "id" attribute of the widget.
      .Columns(columns =>
      {
          columns.Bound(p => p.HydrantNumber);
          columns.Bound(p => p.Street1);
          columns.Bound(p => p.Street2);
          columns.Bound(p => p.Location); 
          columns.Bound(p => p.Quadrant);
          columns.Bound(p => p.Description);
          columns.Bound(p => p.Elevation);
          columns.Bound(p => p.OrderNumber);
          columns.Bound(p => p.RevisionMonth);
          columns.Bound(p => p.RevisionYear);
          columns.Bound(p => p.Remark);
          columns.Command(command => { command.Edit(); command.Destroy(); }).Width(200);


          
          
      })
     .ToolBar(toolbar => toolbar.Create())
    .Editable(editable => editable.Mode(GridEditMode.InLine))
    .Pageable(pageable => pageable.PageSizes(true).PageSizes(new int[] {15,20,25}))
    .Sortable()
    .Scrollable()
    .DataSource(dataSource => dataSource        
        .Ajax()                 
        .Events(events => events.Error("error_handler"))
        .Model(model => model.Id(p => p.Id))
        .Create(update => update.Action("EditingInline_Create", "Grid"))
        .Read(read => read.Action("EditingInline_Read", "Grid"))
        .Update(update => update.Action("EditingInline_Update", "Grid"))
        .Destroy(update => update.Action("EditingInline_Destroy", "Grid"))
        
    )
)



Steve
Top achievements
Rank 1
 answered on 27 Sep 2012
0 answers
137 views
Hi

How correctly to cause Action from Chart

dataSource: {
                transport: {
                    read: {url: ('@Url.Action("ActionName", "ControllerName")'),
                           dataType: "json",
                           data: { fieldName: $("#Field").val()}
                    }
 
                }
                          
            },

David
Top achievements
Rank 1
 asked on 27 Sep 2012
0 answers
154 views
Hi everyone,

I try to use the LayoutChange-Event to get the height of the previous panel. Here is the method I call with the event:
function onMultiLookupWindowSplitterResize(e)
{
    if (e.sender.resizing != undefined && e.sender.resizing.previousPane != undefined)
        $('#lookupGridContainer').height(e.sender.resizing.previousPane.height() - 40);
}

It really works fine. The only problem is. When I collapse a panel it doesn't really work. The previousPane is undefined and so I don't get the height.

If i resize the splitter first and THEN collapse one panel the previousPane is correctly defined. So the problem occurs only if I collapse a panel BEFORE resizing.

Hope you understand what I mean. Is this a bug? Is there any solution for this?

Thanks,
Mathias
Mathias
Top achievements
Rank 1
 asked on 27 Sep 2012
3 answers
238 views
Hi,

In Chrome the dropdownlist becomes unusable once you move to another browser tab then come back.  When you click on the dropdownlist it will expand then close straight away, preventing you from being able to change the selection. You may need to switch tabs once or twice for this to occur.

Chrome version: 20.0.1132.17

Steps to reproduce:

1. With Chrome, goto http://demos.kendoui.com/web/mvvm/widgets.html 
2. Open a new browser tab.
3. Switch to new browser tab.
4. Go back to first tab.
5. Click on dropdownlist.
6. Repeat steps 3, 4, 5 once more if the dropdownlist still works.

Can someone verify this please?
Georgi Krustev
Telerik team
 answered on 27 Sep 2012
18 answers
1,000 views
Hello All,

How to ENABLE the row DELETE confirmation alert "Are you sure you want to delete this record?" when you delete a record from the Grid?

Here is the sample code from the "Examples" folder.
I tried calling editable.DisplayDeleteConfirmation(true);.

But "DisplayDeleteConfirmation" does not work irrespective of true or false.

How to ENABLE the row DELETE confirmation alert?

Thank you.


@(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.LastSupply).Width(140);
        columns.Bound(p => p.Discontinued).Width(100);
        columns.Command(command => { command.Edit(); command.Destroy(); }).Width(200);
    })
    .ToolBar(toolbar => toolbar.Create())
    .Editable(editable => { editable.DisplayDeleteConfirmation(true); editable.Mode(GridEditMode.InLine); })
    .Pageable()
    .Sortable()
    .Scrollable()
    .DataSource(dataSource => dataSource  
        .Ajax()                 
        .Events(events => events.Error("error_handler"))
        .Model(model => model.Id(p => p.ProductID))
        .Create(update => update.Action("EditingInline_Create", "Grid"))
        .Read(read => read.Action("EditingInline_Read", "Grid"))
        .Update(update => update.Action("EditingInline_Update", "Grid"))
        .Destroy(update => update.Action("EditingInline_Destroy", "Grid"))
    )
)
Rosen
Telerik team
 answered on 27 Sep 2012
1 answer
166 views
Hi, Why is this happening ?

http://screencast.com/t/uG2CAhEA 

Thanks.
Georgi Krustev
Telerik team
 answered on 26 Sep 2012
10 answers
3.6K+ views
Hi, 

I am trying to convert my Telerik MVC application to Kendo UI MVC but have hit a problem. 

We have a basic grid on a page that we only want populating after some form values have been entered and a search button pressed. 
I had this working with the Telerik MVC grid by binding the data using javascript after an ajax call to the action. 

var resultsGrid = $('#ResultsGrid').data('tGrid');
resultsGrid.dataBind(json);

Is there a way to have a Kendo grid initially blank and then populated in a similar fashion?

Thanks in advance.
Richard. 
Habib
Top achievements
Rank 1
 answered on 26 Sep 2012
0 answers
117 views
Hello Folks,


I have managed to display the expanded state of treeview after postback. The only thing am stuck with is, i need to set the style for selected node in the treeview using jquery.


Can someone pls help me out here??? 


Thanks in advance.
rajshekar
Top achievements
Rank 1
 asked on 26 Sep 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
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
+? 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?