Telerik Forums
UI for ASP.NET MVC Forum
1 answer
244 views
Despite my best efforts I cannot make the dates returned from the controller appear as dd/mm/yyyy in the edit popup of my kendo grid. I have [DisplayFormat(DataFormatString = "{0:MM/dd/yyyy}", ApplyFormatInEditMode = true)] above the dates in my model and have even doubled my effort by declaring the date format in the HTML Helper itself. I have tried TextBoxFor(), TextAreaFor(), DisplayFor(), and still the date appears as below. Any help would be appreciated.

Tue Dec 23 2014 00:00:00 GMT-0500 (Eastern Standard Time)
Vladimir Iliev
Telerik team
 answered on 12 Jan 2015
1 answer
234 views
Currently, your treeview checkbox demo does not match the source code included on the page.  The source code indicates there should be a "Find Checked Nodes" button, but your demo doesn't have this.  When I do a View Source, I see that there is an onCheck script to report what has been checked.  

In contrast, in my downloaded local demo source code (I am using MVC Q2 2014 SP2), the Find Checked Nodes button exists, but it doesn't do anything.  I am brand new to MVC .NET and jQuery (with some experience with WebForms), so the inconsistencies make things even harder to understand.

What I WANT to happen is to get the checked values in my HTTPPost controller method, so I can do some database work with the results, but I can't figure out how to get the user checked values there. How can I do this?

My simplified model:
public class MyModel
{
    public string OtherStuff {get; set;}
    public IEnumerable<TreeViewItemModel> treeData { get; set; }
}

My simplified view:
@model MyModel
 
<text>@Model.SomethingElse</text>
 
    @(Html.Kendo().TreeView()
            .Name("treeview-left")                       
            .ExpandAll(true)
            .Checkboxes(checkboxes => checkboxes
                           .Name("checkedPubIds")
                           .CheckChildren(true)                     
                            )           
            .BindTo(Model.treeData)                      
    )


My relevant controller methods:
private MyModel GetMyModel() 
{           
    var model = new PubTreeModel
        {
          OtherStuff = "Hello",               
          treeData = GetTreeData() // implementation omitted here
        };
             
    return model;
}
 
[HttpGet]
public ActionResult Index()
{
    var model = GetMyModel();
    return View(model);
}
 
[HttpPost]
public ActionResult Index(MyModel model)
{
   if (ModelState.IsValid)
   
      // Access Violation, because model.treeData is null.  Why?
      foreach (var x in model.treeData)
      {
        if (x.Checked)
        {      
          // do something
         }
      }
    }
     
    // Have to do this or View(model) will break,
    // because there is no treeData in it.    
    model = GetPubTreeModel(model.SelectedUserId);
     
    return View(model);
}

Petur Subev
Telerik team
 answered on 09 Jan 2015
1 answer
277 views
Is any way to hide calculated column in edit mode?
I have age calculated then grid read ajax data
      Age = (human.Dateofbirth > DateTime.Now.AddYears(-(DateTime.Now.Year - human.Dateofbirth.Value.Year))) ? (DateTime.Now.Year - human.Dateofbirth.Value.Year) - 1 : DateTime.Now.Year - human.Dateofbirth.Value.Year
       
Column shows age in grid but also appears in pop up edit mode

I know I can catch event and dynamically hide icon just wander if grid can aware of calculated column

in model:
        [ReadOnly(true)]
        [Editable(false)]
        [DisplayName("Age")]
        public int Age
        {
            get;
            set;
        }
Petur Subev
Telerik team
 answered on 09 Jan 2015
1 answer
93 views
Hello, I want to ask edit popup editor of Grid. Actually i used editor template and its working. I show my own template on Grid view popup but i want to edit whole grid popup editor. Now i don not have any idea how to do that. So can you give my solution?
Georgi Krustev
Telerik team
 answered on 09 Jan 2015
1 answer
113 views
I've read many Telerik and stack overflow responses to this issue that still don't cover the answer to my question. Yes my error event handler is declared as part of my datasource configuration along with my requestEnd and change event handlers and they work. So my question is this, does the error event get canceled when the requestEnd event is declared?

My datasource is defined below for any critique you may have

$(document).ready(function () {

        var dataSource = new kendo.data.DataSource({
            transport: {
                cache: false,
                dataType: 'json',
                contentType: 'application/json; charset=utf-8',
                read: {
                    url: '/Telecom/Read',
                    type: 'POST',
                    complete: function (jqXHR, textStatus) {
                        
                        //$j('#message').text('Successful Read');
                        //$j('#dialog').dialog("option", "title", textStatus);
                        //$j('#dialog').dialog('open');
                    }
                },
                create: {
                    url: '/Telecom/Create',
                    type: 'POST',
                    complete: function (jqXHR, textStatus) {
                        //refreshGrid();
                        //$j('#message').text('Successful Create');
                        //$j('#dialog').dialog("option", "title", textStatus);
                        //$j('#dialog').dialog('open');
                         
                    }
                },
                update: {
                    url: '/Telecom/Update',
                    type: 'POST',
                    complete: function (jqXHR, textStatus) {
                        //refreshGrid();
                        //$j('#message').text('Successful Update');
                        //$j('#dialog').dialog("option", "title", textStatus);
                        //$j('#dialog').dialog('open');
                        
                    }
                },
                destroy: {
                    url: '/Telecom/Destroy',
                    type: 'POST',
                    complete: function (jqXHR, textStatus) {
                        //refreshGrid();
                        //$j('#message').text('Successful Delete');
                        //$j('#dialog').dialog("option", "title", textStatus);
                        //$j('#dialog').dialog('open');
                        
                    }
                },
            },
            error: onError,
            requestEnd: onRequestEnd,
            change: onChange,
            serverPaging: false,
            autoSync: false,
            schema: {
                model: {
                    id: 'Id',
                    fields: {
                        Id: { editable: false },
                        Name: { type: 'string', validation: { required: true } },
                        Category: { type: 'string', validation: { required: true } },
                        EquipmentType: { type: 'string', validation: { required: true } },
                        Description: { type: 'string' },
                        Length: { type: 'number', validation: { required: true } },
                        Height: { type: 'number', validation: { required: true } },
                        Width: { type: 'number', validation: { required: true } },
                        CanEditLength: { type: 'boolean', validation: { required: true } },
                        CanEditHeight: { type: 'boolean', validation: { required: true } },
                        CanEditWidth: { type: 'boolean', validation: { required: true } },
                        IsObsolete: { type: 'boolean', validation: { required: false } },
                        SortOrder: { type: 'number', validation: { required: false } }
                    }
                }
            }
        });    ....   });



Kiril Nikolov
Telerik team
 answered on 08 Jan 2015
1 answer
63 views
Hello:
Using the latest Telerik DevCraft version

I have a user that gets this error when doing an Export from the Grid with the latest Export functionality.

"export repaired records cell information from /xl/worksheets/sheet1.xml"
This error shows up in an Excel dialogue.

Any Ideas

Thanks
Rober
T. Tsonev
Telerik team
 answered on 08 Jan 2015
3 answers
328 views
In my Kendo grid, I am displaying checkboxes for users to select rows. Once the rows are selected, the user clicks on a button to view the selected records in another view for additional processing. How do I pass the selected rows' ids to the controller/another view?
Suresh
Top achievements
Rank 1
 answered on 07 Jan 2015
1 answer
990 views
I'm using the Kendo MVC grid and an Ajax.BeginForm request to query data for rendering in a partial view (that has the grid object). It all works fine, but I'm wondering how to go about letting the user know that a long operation is occurring when the ajax request is started. I haven't been able to find anything specific to Kendo MVC that doesn't use mobile application popups. Are there any good examples of Kendo MVC/Ajax/async and some sort of loading indicator? Thanks!

...k
Dimo
Telerik team
 answered on 07 Jan 2015
1 answer
114 views
Hi there,

I am just transforming my pure ASP.net Application into an angular SPA.

The kendo widgets are defined with MVC wrappers and I use small javascripts i.e for 
--> .Events(e => e.DataBound("onDataBound")) or 
--> .Read(read => read.Action("Index", "Contact").Data("updateGrid")

However the scripts do not work when angular loads the partial. (updateGrid is not defined)

What is the best approach to reference a javascript from within a mvc defined Grid? Can I hand in an angular controller method somehow?


Thank you very much!
Alexander Valchev
Telerik team
 answered on 07 Jan 2015
1 answer
197 views
I have a form using various Kendo widgets (i.e. TextBoxFor, AutocompleteFor, etc) to capture data for my process.  When I submit the form and try to load view with an empty version of my viewmodel, much of the content in the view is from my previous screen when I use both TextBoxFor and AutoCompleteFor.  However, if I switch these to MaskedTextBoxFor everything seems to work fine.  

For example, I have an Address view capturing an address with John Doe 123 Main, NYC, NY and click submit to send it to my controller.  In my controller I create a new Address object and pass it back to the Address View.  When the View loads and I am using TextBoxFor or AutoCompleteFor, the contents to the boxes is still John Doe 123 Main, NYC, NY.  However if I change any of the fields to MaskedTextBoxFor, the correct data is displayed in the field.

Sorry if this is confusing, but I am not sure how to describe this so it makes the most sense.
Georgi Krustev
Telerik team
 answered on 07 Jan 2015
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
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Template
Badge
LinearGauge
ModalView
ResponsivePanel
TextArea
Breadcrumb
ExpansionPanel
Rating
ScrollView
ButtonGroup
CheckBoxGroup
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
DateTimePicker
AppBar
BottomNavigation
Card
FloatingActionButton
Licensing
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
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?