Telerik Forums
UI for ASP.NET MVC Forum
1 answer
129 views
Hi all,
I'm building a grid where I group my data by 3 columns, but I show the sum of another column as ClientGroupFooterTemplate. Here some code snippet
Inside data source:
                .Group(gr =>
                    {
                        gr.Add(p=> p.Finality);
                        gr.Add(p=> p.Task);
                        gr.Add(p=> p.Session);
                    }
                )
                .Aggregates(aggr =>
                    {
                        aggr.Add(p => p.Duration).Sum();
                    })

Inside .Columns
//previous columns code
columns.Bound(c => c.Duration).Title("Duration (h)").Width(150).ClientGroupFooterTemplate("Sum: #=sum#");
//following columns code

but when grid displays the data it shows the Sum at the end of every grouping (Finality, Task and Session)
I want to diplay it only for Session, how can I accomplish that?

Daniel
Telerik team
 answered on 13 Jan 2015
4 answers
116 views
Hello,

I want to develop a feature to my application which recognizes what I type and if the typed word is a name then it should take me to link of that person name.

Here is login of my application:
URL: http://shrirangtest3.azurewebsites.net/
login: peter
psswd: erp

Steps:
1. login to above url
2. Go to "Messages" tab under "Home" tab
3.Click on "Add New Message"
4. There is currently html text area called "Content"
5. Now say, I change this html text are to kendo editor and when I type sentence with word like "Peter", then it should show a link and if I click on the link then link should open "http://shrirangtest3.azurewebsites.net/People/Peoples/Edit/4"  (It's in "People" tab)
How can feature given in point# 5 be accomplished?
Will kendo editor help me or should there be any other solution... ?
Your technical inputs will help me

Thanks




Kiril Nikolov
Telerik team
 answered on 12 Jan 2015
1 answer
236 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
219 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
271 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
88 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
106 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
60 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
298 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
963 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?