Telerik Forums
UI for ASP.NET MVC Forum
3 answers
108 views
Hi,

I  am working on a prototype for our new project, after the approval of this prototype we will move ahead and buy the license.

I want to load the grid with data from xml file, display it with all features (sorting, paging, filtering, etc.)

Below is the code I use in Controller and Razor

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

        private static IEnumerable<TmpQueueModel> GetQueueItems()
        {
            IList<TmpQueueModel> ieTmpQueueModel = null;
            TmpQueueModel tmpQueueModel = null;
            try
            {
                DataSet dsQueue = new DataSet();
                dsQueue.ReadXml("\\App_Data\\Queue.xml");

                if (dsQueue.Tables[0].Rows.Count > 0)
                {
                    ieTmpQueueModel = new List<TmpQueueModel>();
                    foreach (DataRow dr in dsQueue.Tables[0].Rows)
                    {
                        tmpQueueModel = new TmpQueueModel();
                        tmpQueueModel.Action = dr["Action"].ToString();
                        //tmpQueueModel.AssignedDate = dr["AssignedDate"].ToString();
                        //tmpQueueModel.AssignedTo = dr["AssignedTo"].ToString();
                       // tmpQueueModel.Comment = dr["Comment"].ToString();
                        tmpQueueModel.ConsumerFirstName = dr["ConsumerFirstName"].ToString();
                        tmpQueueModel.ConsumerId = dr["ConsumerId"].ToString();
                        tmpQueueModel.ConsumerLastName = dr["ConsumerLastName"].ToString();
                        tmpQueueModel.ExternalReferenceID = dr["ExternalReferenceID"].ToString();
                        tmpQueueModel.First_Name = dr["First_Name"].ToString();
                        //tmpQueueModel.IsReserved = (bool)dr["IsReserved"];
                        tmpQueueModel.Last_Modified_Date_and_Time = dr["Last_Modified_Date_and_Time"].ToString();
                        tmpQueueModel.Last_Name = dr["Last_Name"].ToString();
                        tmpQueueModel.LastModifiedBy = dr["LastModifiedBy"].ToString();
                        tmpQueueModel.Medicaid_No_ = dr["Medicaid_No_"].ToString();
                        tmpQueueModel.No_ = dr["No_"].ToString();
                        tmpQueueModel.PacketReceivedDate = dr["PacketReceivedDate"].ToString();
                        //tmpQueueModel.QueueHistoryDate = Convert.ToDateTime(dr["QueueHistoryDate"]);
                        tmpQueueModel.QueueId = Convert.ToInt32( dr["QueueId"]);
                        //tmpQueueModel.QueueStatus = dr["QueueStatusId"].ToString();
                        ieTmpQueueModel.Add(tmpQueueModel);
                    }
                }
                return ieTmpQueueModel;
            }
            catch
            {
                return null;
            }
        }

        public ActionResult QueueItems_Read([DataSourceRequest] DataSourceRequest request)
        {
            return Json(GetQueueItems().ToDataSourceResult(request));
        }


----------XXXXXXXXXXX------------
@model IEnumerable<GenericQueue.Models.TmpQueueModel>

@(Html.Kendo().Grid(Model)    
    .Name("Grid")
    .Columns(columns =>
    {
        columns.Bound(p => p.ConsumerId).Groupable(false);      
        columns.Bound(p => p.PacketReceivedDate);
        columns.Bound(p => p.First_Name );
        columns.Bound(p => p.Last_Name);        
    })
    .Groupable()
    .Pageable()
    .Sortable()
    .Scrollable()
    .Filterable()
    .DataSource(dataSource => dataSource
        .Ajax()   
        .PageSize(5)
        .Read(read => read.Action("QueueItems_Read", "Grid"))    
    )
)


Thanks in advance.

Regards,
Ravi
Ravi
Top achievements
Rank 1
 answered on 10 Oct 2013
9 answers
765 views
I have a project working fine in ASP.Net MVC 4 with kendo UI 2012.2.710 developed in VS2010.

I have recently installed VS2012 and there I have Kendo 2012.3.1114. I just copied all the code from the VS2010 to VS2012 and it all just worked except for one small point. I have a nested grid and I use a template for the detail. That template is shown below. It works fine in the 2010 project but 2012 always says "Uncaught Error: Invalid template:" and the template is identical. If I comment out the .ClientTemplateId statement, the main grid displays just fine. If I paste the template into its own Partial View and display it separately, it displays just fine but it always errors as a template.

I have tried commenting out parts of the template, even getting to the point where it o nly has the Name and ToClientTemplate calls and it STILL errors. So I just wonder if something is broken with templates in the latest version of Kendo or the latest version of VS. The template is below:
<script id="paneTemplate" type="text/kendo-tmpl">
    @(Html.Kendo().Grid<AWSQBCC.Models.Pane>()
    .Name("Panes_#=LiteId#")
    .Columns(columns =>
    {
        //columns.Bound(p => p.PaneId);
        columns.Bound(p => p.Sequence);
        columns.Bound(p => p.LiteId).Hidden();
        columns.ForeignKey(p => p.GlassId, (System.Collections.IEnumerable)ViewData["glasses"], "GlassId", "GlassType").Title("Glass Type");
        columns.Command(command => { command.Edit(); command.Destroy(); });
    })
    .DataSource(dataSource => dataSource
        .Ajax()
        .Sort(sort =>
        {
            sort.Add(p => p.Sequence);
        })
        .Read(read => read.Action("Pane_Read", "Lite", new { id = "#=LiteId#" }))
        .Destroy(destroy => destroy.Action("Pane_Delete", "Lite"))
        .Update(update => update.Action("Pane_Update", "Lite"))
        .Create(create => create.Action("Pane_Create", "Lite", new { id = "#=LiteId#" }))
        .Model(model =>
        {
            model.Id(p => p.PaneId);
            model.Field(p => p.PaneId).Editable(false);
            model.Field(p => p.LiteId).Editable(false);
            model.Field(p => p.GlassId);
        })
        .Events(events => { events.Error("error"); })
    )
    .ToolBar(commands => commands.Create())
    .Editable(editable => editable.Mode(GridEditMode.InLine))
    //.Events(events => events.DataBound("refresh"))
    .ToClientTemplate())
</script>
Any help much appreciated.
Daniel
Telerik team
 answered on 10 Oct 2013
3 answers
602 views
How can I force the grid detail/template datasource to refresh in the detailExpand event handler?

function detailExpand(e) {
try { 
     var dataItem = e.sender.dataItem(e.masterRow);
     if ($.inArray(dataItem.Key, expanded) == -1) {
      expanded.push(dataItem.Key);
}
} catch (ex) {
expanded = [];
}
}
Vladimir Iliev
Telerik team
 answered on 10 Oct 2013
1 answer
421 views
Hello -

I have created a POCO class (called User) which I decorated some properties with a custom Editor Template. The custom Editor Template (called WorkflowUsers) simply prints the text "HI". I have a grid set up, which displays all of the Users. It has a button which launches the editor pop-up, allowing you to create a new User. The "Domain" property properly uses the custom Editor which I have specified using the UIHInt, however the Roles property does not even show (no display label nor custom editor) on the popup.  I have tried making it  a List, making it non-virtual. I am confused.

Note: I am using the Trial version, as my full-version won't be purchased until the end of the week due to my company's billing process.

[Required]
[DisplayName("Domain")]
[MaxLength(100)]
[UIHint("WorkflowRoles")]
public string Domain { get; set; }
 
 
[DisplayName("Roles")]
[UIHint("WorkflowRoles")]
[Required]
public virtual ICollection<Role> Roles { get; set; }
Petur Subev
Telerik team
 answered on 10 Oct 2013
4 answers
189 views
Hi,

I am migrating my application from MVC Extensions to Kendo. I have a Combobox whose width (in the closed state) is 250px. But when it is open, the width of the dropdown is 400px. Please have a look at the attached screenshot.
I achieve it with something like

@(Html.Telerik().ComboBox().Name("CbPlants")
        ...
        ...
       .HtmlAttributes(new { style = "z-index: 20; width: 250px;" })
       .DropDownHtmlAttributes(new { style = "width: 400px;" })       
       )
       

  When I migrate it to Kendo, I couldn't find an equivalent to have a DropDownHtmlAttributes for customizing the width. Any idea how I can achieve this effect ?

Thanks & Regards

Achilles
Alexander Valchev
Telerik team
 answered on 10 Oct 2013
2 answers
210 views
I am working with the grid view popup editor using MVC. I was able to widen the Default popup editor Default window to Size 700px. The Update and Cancel button is currently still in the Default location. How is it possible to get them to move.
CC
Top achievements
Rank 2
 answered on 09 Oct 2013
3 answers
347 views
I have my popup editor working great until I add in a grid to the editor.

My editor template consists of a tab control and the second tab has a grid embedded in it.
As soon as I put the grid in, the popup window no longer pops up but rather displays inline with the host grid and the tabs are not clickable. I remove the grid from the second tab in the popup and popup pops up again and works as expected.

Is there a specific design pattern to be adhered to when using a customer popup editor the contains a grid?
Alexander Popov
Telerik team
 answered on 09 Oct 2013
4 answers
99 views
Hi,

I am thinking about buying Kendo UI Complete for ASP.NET MVC . But there's a absolute no-go:

When using KendoUI Grid (Inline Editing demo: http://demos.kendoui.com/web/grid/editing-inline.html) with an Entity that has a lot of properties, KendoUI is serializing ALL properties (even EntityKey and EntityState) into the HTML source (inside a <script>-Tag).
When providing the data via the constructor, - even worse! - ALL values are rendered into the HTML code. 

I am about to display 10 out of 20 properties. The remaining 10 properties shouldn't be visible in ANY WAY to the user because
1. The User doesn't have to know the full database table structure
2. Some data depend on the user's rights, but being rendered into the html source, it would be possible for everyone to see everything.

Is there a way to tell Html.Kendo().Grid() just to touch the properties needed?!

Regards,

AncientGrief

Additional Info:
Kendo UI version => 2013.2.918
OS => Windows 7/8
exact browser version => Chrome latest
AncientGrief
Top achievements
Rank 1
 answered on 09 Oct 2013
3 answers
388 views
I have installed this VSExtension through the Extension Manager in VS2010.  When I attempt to create a new Kendo Project the dialog box doesn't allow me to select an assembly or a theme, and therefore doesn't enable the next button to continue.

Nathan Manning
Huntsville, AL
eren
Top achievements
Rank 1
 answered on 09 Oct 2013
1 answer
73 views
Hi,

I'm trying to run your demo application on Mono but I have inconsistencies with the various assembly version. Before looking further into this, two questions.

1. Is it correct that the Kendo UI MVC Extension should run on Mono? If yes, which version on Mono is required? Should Mono 3.0.3, the version by default installed with openSuse 12.3 be a correct version to use?

2. At the moment, I just want to have a demo running on Mono of some MVC extension (Grid, Menu) to be able to prove the useablity of this solution to the decision makers. So if you have any running demo on Mono, this can for sure already helps me a lot,

Thanks

Thierry Van Schoote

Alexander Popov
Telerik team
 answered on 09 Oct 2013
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
Upload
ComboBox
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
ListView (Mobile)
Pager
Accessibility
ColorPicker
DateRangePicker
Wizard
Security
Styling
Chat
MediaPlayer
TileLayout
DateInput
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
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?