Telerik Forums
UI for ASP.NET MVC Forum
1 answer
255 views
Hello,


I'm new to Kendo UI, so this may turn out to be pretty trivial. I have an ajax bound grid that's initially bound to a set of records. I'm planning on having a form within the same page which the user will fill out to add new records, I'm not using inline or popup editing because the data needed to generate a new record won't necessarily have a 1:1 correspondence with the grid model's fields and because of interface design requirements. My question is, after adding a new record to the set via ajax, how can I refresh the grid to reflect the changes made to the set? I provide a test solution I tinkered with, I tried to hook into the dataSource's change event and refreshing the grid after I successfully call .read() on it, but to no avail, I have an html button I call to add a mock random record server side. Any suggestions? Am I missing something?
Rosen
Telerik team
 answered on 13 Sep 2012
1 answer
165 views
Here is the scenario. I have a Kendo grid of a VIEW(3 joined tables) not of a table. I have created a checkbox that is bound to the primary key field. After hours of searching I figured out how to select and deselect all of the checkboxes by clicking the header.  I cannot however figure out how to send multibple ID's to the controller so that I can validate and update the records.

My idea is to have javasciprt iterate through the list and compile a delimited string of ID's which would be stored in a hidden field. Easy peasy right? No  of course not. I have tried and searched high and low and nothing works. Very frustrating.

I did find some javascript code that doesnt do what I want but I tried to modify it and make it work. Can't do it. Can anybody help me out there? The code I found is below... I don't need the last part of it because I am not doing any updating on the client side. I just need to get the values to the controller... any help is appreciated.

<script>    
    $(document).ready(function () {
        $("#update").click(function() {
            var grid = $("#Grid").data("kendoGrid");
            var value = $("#Name").data("kendoDropDownList").value();
            var models = [];

            //find the selected models
            grid.tbody
                .find(":checked")
                .closest("tr")                
                .each(function () {
                    models.push(grid.dataItem(this));
                });

            //update the models value
            for (var i = 0, length = models.length; i < length; i++) {
                models[i].set("Name", value);
            }

            //submit the value to the server
            grid.dataSource.sync();
        });
    });
</script>
Rosen
Telerik team
 answered on 13 Sep 2012
1 answer
87 views
Hi have implemented a Grid using Open Access as the ORM.

The data displays fine as does completing updates. However if you add an item and save it, then every subsequent edit on existing items creates a new entry as each edit is behaving as a newly added Item.

The only way to stop this is to manually refresh the page.

Rob
Robert
Top achievements
Rank 1
 answered on 12 Sep 2012
0 answers
145 views
Hi,

I am using Asp.Net MVC Grid. Facing the issue in chrome, when i group the data on the basis of a single hidden column it shows that column even if the column header is hidden and not visible. Other browser has no issue in that. Kindly, guide me about it. 

Your earliest response will be highly appreciated.

Regards,
Muhammad Kamran

P.S. Attached is the snapsot of Chrome n firefox.
Muhammad
Top achievements
Rank 1
 asked on 12 Sep 2012
1 answer
152 views
Hi, 

I put input text inside splitter makes input text read-only...

Here's my code snippet...
Index VIEW:
@helper RenderContentSplitter()
    {
        @(Html.Kendo().Splitter()
            .Name("contentSplitter")
            .Orientation(SplitterOrientation.Vertical)
            .Panes(contentPanes =>
            {
                contentPanes.Add()
                    .Collapsible(true)
                    .HtmlAttributes(new { style = "height: 100%; width: 100%;", id = "pane1" })
                    .Resizable(true)
                    .Content(
                       Html.Action("RowDesignPartial").ToHtmlString()
                    );
            })
                )
    }


RowDesignPartial VIEW:

<input type="text" id="txtRowName" name="txtRowName" class="k-textbox" value="" />

Thanks.......
Dimo
Telerik team
 answered on 12 Sep 2012
6 answers
1.0K+ views
Hi,

How can I set focus on my added new row?
In my case, I insert new row at the bottom..

Thanks...
Steve Palm
Top achievements
Rank 1
 answered on 12 Sep 2012
5 answers
261 views
I'm trying to follow the examples that I've found, but I seem to be missing something that prevents my results from sorting or grouping or paging. I'm assuming that the problem is in the controller, probably in GetEducators but I can't figure out what it is that I'm missing!

Index.html
@model LicenseVerification.Models.tc_person
 
@{
    ViewBag.Title = "SearchPerson";
}
 
<h2>Index cshtml</h2>
 
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")"type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")"type="text/javascript"></script>
 
@using (Html.BeginForm("SearchResults", "PersonSearch"))
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>tc_person</legend>
         
        <div class="editor-label">
            @Html.Label("first_name", "First Name")
        </div>
        <div class="editor-field">
            @Html.Editor("first_name", "First Name")
            @Html.ValidationMessageFor(model => model.first_name)
        </div>
 
        <div class="editor-label">
            @Html.Label("last_name", "Last Name")
        </div>
        <div class="editor-field">
            @Html.Editor("last_name", "Last Name")
            @Html.ValidationMessageFor(model => model.last_name)
        </div>
 
        <p>
            <input type="submit" value="Search" />
        </p>
    </fieldset>
}

PersonSearchController.cs
using System.Linq;
using System.Web.Mvc;
using LicenseVerification.Models;
using System.Collections;
 
namespace LicenseVerification.Controllers
{
    public class PersonSearchController : Controller
    {
        private be_cactusEntities db = new be_cactusEntities();
 
        public ActionResult Index()
        {
            return View();
        }
 
        public ActionResult SearchResults(string firstName = ""stringlastName = "")
        {
 
            return View(GetEducators(firstName,lastName));
        }
 
        private IEnumerable GetEducators(string firstName = ""stringlastName = "")
        {
 
            var educators = from e in db.tc_person
                             where e.first_name.Contains(firstName)
                             && e.last_name.Contains(lastName)
                             select e;
            ViewBag.firstName = firstName;
            ViewBag.lastName = lastName;
            return educators;
        }
 
 
        protected override void Dispose(bool disposing)
        {
            db.Dispose();
            base.Dispose(disposing);
        }
    }
}

SearchResults.cshtml
@model IEnumerable<LicenseVerification.Models.tc_person>
 
<h2> Without Partial</h2>
 
@{
    string lastName = "NULL";
    string firstName = "NULL";
    if (ViewBag.lastName != null)
    {
        lastName = ViewBag.lastName;
    }
    if (ViewBag.firstName != null)
    {
        firstName = ViewBag.firstName;
    }
         
}
@(Html.Kendo().Grid(Model)
        .Name("Grid")
        .Columns(cols =>
        {
            cols.Bound(p => p.person_id).Groupable(false);
            cols.Bound(p => p.first_name);
            cols.Bound(p => p.last_name);
        })
        .Pageable(pageable => pageable.PageSizes(true).PageSizes(new int[] { 10, 25 }))
        .Sortable()
)
 
<p />
lastName is @lastName<br />
firstName is @firstName

My model is from a DBContext template and Entity Framework, but it is below in case it's relevant:
tc_person.cs
//------------------------------------------------------------------------------
// <auto-generated>
//    This code was generated from a template.
//
//    Manual changes to this file may cause unexpected behavior in your application.
//    Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
 
using System;
using System.Collections.Generic;
 
namespace LicenseVerification.Models
{
    public partial class tc_person
    {
        public tc_person()
        {
            this.tc_experience = new HashSet<tc_experience>();
            this.tc_license = new HashSet<tc_license>();
            this.tc_certificate = new HashSet<tc_certificate>();
        }
     
        public decimal person_id { getset; }
        public System.DateTime date_record_added { getset; }
        public string prefix { getset; }
        public string last_name { getset; }
        public string first_name { getset; }
        public string middle_name { getset; }
        public string suffix { getset; }
        public string preferred_name { getset; }
        public string maiden_name { getset; }
        public string aka { getset; }
        public string ethnic_code { getset; }
        public string gender { getset; }
        public Nullable<System.DateTime> dob { getset; }
        public Nullable<System.DateTime> deceased_date { getset; }
        public string citizenship { getset; }
        public string nclb_veteran { getset; }
        public Nullable<System.DateTime> ethics_test { getset; }
     
        public virtual ICollection<tc_experience> tc_experience { getset; }
        public virtual ICollection<tc_license> tc_license { getset; }
        public virtual ICollection<tc_certificate> tc_certificate { getset; }
    }
     
}

PersonSearch.Context.cs
//------------------------------------------------------------------------------
// <auto-generated>
//    This code was generated from a template.
//
//    Manual changes to this file may cause unexpected behavior in your application.
//    Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
 
using System;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
 
namespace LicenseVerification.Models
{
    public partial class be_cactusEntities : DbContext
    {
        public be_cactusEntities()
            base("name=be_cactusEntities")
        {
        }
     
        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            throw new UnintentionalCodeFirstException();
        }
     
        public DbSet<tc_assignment> tc_assignment { getset; }
        public DbSet<tc_experience> tc_experience { getset; }
        public DbSet<tc_person> tc_person { getset; }
        public DbSet<tc_license> tc_license { getset; }
        public DbSet<tc_certificate> tc_certificate { getset; }
        public DbSet<tc_endorsement> tc_endorsement { getset; }
        public DbSet<tcc_license_level> tcc_license_level { getset; }
        public DbSet<tcc_license_status> tcc_license_status { getset; }
        public DbSet<tcc_qualified_by> tcc_qualified_by { getset; }
    }
}
Samuel
Top achievements
Rank 2
 answered on 11 Sep 2012
16 answers
210 views
I am trying to use the Kendo grid with an application I have, but I am getting a Just Code (2012.2.815.1) error "Unknown method 'Columns' of 'Kendo.Mvc.UI.Fluent.WidgetBuilderBase<TViewComponent, TBuilder>'. How can I resolve this error?

<%: Html.Kendo().Grid(Model.Registrants)
        .Name("Registrants")
        .Columns(column => 
            {
                column.Bound(i => i.RedemptionCode);
                column.Bound(i => i.FirstName);
                column.Bound(i => i.LastName);
                column.Bound(i => i.Address);
                column.Bound(i => i.Zip);
                
            }%>
<%%>
Zdravko
Telerik team
 answered on 11 Sep 2012
0 answers
121 views
I imagine this is pretty easy, but I'm still trying to get up to speed.  Anyone have an example of how to replicate the NoRecordsTemplate functionality using the Pageable.Message as recommended in the grid migration guide? 
gm
Top achievements
Rank 1
 asked on 10 Sep 2012
0 answers
139 views
Hi,

Can anyone provide me the link to open source MVC controls? 

I downloaded the version available in codeplex and I am unable to run it.. https://telerikaspnetmvc.codeplex.com/ 
Silver
Top achievements
Rank 1
 asked on 10 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
MultiColumnComboBox
Dialog
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
SegmentedControl
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?