Telerik Forums
UI for ASP.NET MVC Forum
1 answer
326 views
Dear Telerik Support Team,

I would like to know if it is possible to batch delete and update of selected rows by the external buttons. 
If yes, Could you please provide the sample code?  

Scenario is

I have a multiple rows selectable grid, "Delete Selected Items" button and "Assign DataOwner" button in my View.

If User click on "Delete Selected Items" button then the selected rows will get deleted
If User click on "Assign DataOwner" button then the selected rows Owner column will get updated as DataOwner. 
Calvin
Top achievements
Rank 1
 answered on 09 Sep 2014
1 answer
288 views
I'm getting an javascript error when trying to filter the scheduler using a Guid from a dropdownlist.  I had a very similar error when filtering by an int.  That was fixed by using parseInt(this.value)  instead of using this.value and then assigning the parseInt to  the filter value like:
var filter = {
                logic: "or",
                filters: [
                    {
                        operator: "eq",
                        field: "AssetID",
                        value: parseInt(this.value())
                    }
                ]
            };
 
Now I'm having the same type of error when the DataValueField of the dropdownlist is a Guid.

I'm doing this:
<div style="margin-left: 30px; margin-bottom: 20px">
    Choose Owner:
    @(Html.Kendo().DropDownList()
          .Name("Owner")
          .DataTextField("DisplayName")
          .DataValueField("UserID")
          .DataSource(ds => ds.Read("TaskUsers", "Users"))
          .Events(events => events.Change("userChange"))
    )
</div>
function userChange() {
 
    var scheduler = $("#scheduler").data("kendoScheduler");
 
    var selection = this.value();
     
    if (selection == "00000000-0000-0000-0000-000000000000") {
        scheduler.dataSource.filter([]);
    }
    else {
        var filter = {
            logic: "or",
            filters: [
                {
                    operator: "eq",
                    field: "AssetID",
                    value: selection
                }
            ]
        };
        scheduler.dataSource.filter(filter);
    }
}

I placed a break point in the code and 'selection' is a valid guid string and it is the guid that I expected it to be.
Can you filter by a Guid?
Edward
Top achievements
Rank 1
 answered on 08 Sep 2014
14 answers
583 views
In your examples,i noticed that the column has a big width,but when editing the column,the texbox is much smaller,so it doesn't rich the end of column limits.how can i do that?

Regards,
Daniel

Dimiter Madjarov
Telerik team
 answered on 08 Sep 2014
1 answer
76 views
Hi All,

Does anyone know if it's possible to check/uncheck the check box elements of the ColumnMenu in the kendo grid from the onDataBound event.
I have a specific requirement when I can't use the columnHide() 

Any help would be greatly appreciated.

Cheers,
Michael
Dimiter Madjarov
Telerik team
 answered on 08 Sep 2014
5 answers
229 views
Hy,

I have implemented js code to expand all child items under the selected NODE item.   And This Works FINE.

Is there a build in way in KEDO Treeview do this ? a better way...I mean.


OnRClickTreeNode()
{
var node = getTreeView().findByUid(getRightClickedItem().uid);
var treeView = getTreeView();
expandNodeChildItemsRecursive(treeView, node);
}

function expandNodeChildItemsRecursive(treeView, node) {
treeView.expand(node);
var childNodes = $(".k-item", node);
for (var i = 0; i < childNodes.length; i++) {
expandNodeChildItemsRecursive(treeView, childNodes[i]);
}
}
Rick Nguyen
Top achievements
Rank 1
 answered on 06 Sep 2014
2 answers
112 views
I am using a NumericTextBox control for entering a credit card number. However, there is a strange bug when this is used in combination with IE11 (I'm unable to test other versions of IE at the moment so I don't know if this is an issue with IE versions > 11).

If I enter 5415240007992185 and tab away from the control it changes to 5415240007992186.
If I enter 5415240007992187 and tab away from the control it changes to 5415240007992188.
If I enter 5415240007992189 and tab away from the control it changes to 5415240007992190.

There is some upper limit where, for whatever reason, all numbers are changed to the next even number when the control loses focus. Here is the markup I'm using for the control:

@(Html.Kendo().NumericTextBox()
    .Name("ccAccountNumber")
    .Decimals(0)
    .Format("{0:#}")
    .Spinners(false)
)
Darryl
Top achievements
Rank 1
 answered on 05 Sep 2014
13 answers
209 views
I have upgraded to Q2 2014 and the install appears to work successfully. When I open my solution in visual studio and try and upgrade my project I get the following error show in attachment 1 when doing from the Telerik Menu option. And when right clicking on the project in the solution explorer there is no longer a telerik menu option to upgrade the kendo in the project.

A fix for would be greatly appreciated.
Momchil
Telerik team
 answered on 05 Sep 2014
7 answers
707 views
Is there a way to configure a combobox and a datasource using MVVM to have an initial value, but if the user starts typing in the box to go to the server and fetch all the remaining items from an MVC controller action that returns a JSON result?

I've tried doing an add to the datasource for the initial item, but that just keeps it from retrieving stuff from the server.  There also doesn't seem to be a built in event that would let me know that the user is trying to search (open doesn't fire if the user tabs in and starts typing unless the text is ALREADY in the data source).  I've also played with serverFiltering, but I just don't seem to have the right combination get what I'm after.  It would seem this is a common scenario where you put some data in a combobox, but avoid bringing down a list of things till a user really needs them.  Considering the number of look ups on  my screen, I do not want to load data for look ups that aren't going to be used by the user. 

In view:
<input id="assetCategoryId" name="assetCategoryId" elite-remaining-field="AssetCategory"
  data-role="combobox"
  data-auto-bind="false"
  data-placeholder="Select a status"
  data-value-primitive="true"
  data-text-field="text"
  data-value-field="id"
  data-bind="value: assetCategoryId, source: assetCategoryList" />

In the viewmodel:
assetCategoryId : 1,
assetCagetoryList:  null;

intialize : function(data) {
    viewModel.set('assetCategoryId', data.assetCategoryId);

    var ds = new kendo.data.DataSource({
           //serverFiltering: true,
           transport: {
          read: {
                url: "/dropdown/AssetCategory",
                dataType: "json"
           }
        }
    }); 

   // ds.add({ id: data.assetCategoryId,, text: data.assetCategoryText});
   viewModel.set('assetCategoryList', ds);
},


I fear that I'm going to have to wire all this up myself:
-- Ditch the datasource and use an array
-- Populate the array with my initial data
-- Tie into the keydown event of the combobox
-- Upon getting a keydown, check the length of the array, if it is 1 or less, go get the rest of my data; otherwise, do nothing.


d




Georgi Krustev
Telerik team
 answered on 05 Sep 2014
1 answer
125 views
Hi,

I am using telerik grid for mvc and I configured it for inline editing



Model Properties:
.......
 public string ErrorText { get; set; }
        public int Order { get; set; }
        public String Operator { get; set; }
..........

For the operator column in the above grid I want to use dropdown list with set of values coming from an enum list. User will select from list of operators and update the row. Could anyone guide me on implementing this.


Kiril Nikolov
Telerik team
 answered on 05 Sep 2014
1 answer
127 views
I have a grid that has multiple DropDownLists.   All of the DropDownLists are populated using the ViewData object.    In this case, I have a DropDownList that I would actually like it to populate multiple other columns in the Grid.    I am not sure how I can access the other information in the ViewData object.   So the Project_Key and the NameDesc columns in the model are for the dropdown.   But, the other columns Mgt_Unit_Key, Program_Key and Zone_Key are columns in the ViewData that I want to use to populate (default) other columns in the grid to.    How can I access these other columns in the ViewData and assign them to columns in the grid?

Here is the basics of my controller:
    public ActionResult TimecardIndex()
        {
            ViewData["Projects"] = this.projectservice.GetDropDownList();
            return View();
        }

The grid looks like:
@(Html.Kendo().Grid<IRISWeb.Models.CAS.Timecard>()
    .Name("Grid")
    .Columns(c =>
    {
        c.Command(command => { command.Destroy(); }).Width(120).Lockable(true).Locked(true);
        c.Bound(p => p.Task_Date).Width(120).Lockable(true).Locked(true).EditorTemplateName("IRISDate");
        c.ForeignKey(p => p.Activity_Key, (System.Collections.IEnumerable)ViewData["Activities"], "Activity_Key", "NameDesc").Width(350).Lockable(true);
        
        c.ForeignKey(p => p.Project_Key, (System.Collections.IEnumerable)ViewData["Projects"], "Project_Key", "NameDesc").Width(350);
        c.ForeignKey(p => p.ProjectSub_Key, (System.Collections.IEnumerable)ViewData["ProjectSubs"], "ProjectSub_Key", "NameDesc").EditorTemplateName("ProjectSub").Width(200);
        
        c.ForeignKey(p => p.Mgt_Unit_Key, (System.Collections.IEnumerable)ViewData["Mgt_Units"], "Mgt_Unit_Key", "NameDesc").Width(350);
        c.ForeignKey(p => p.Program_Key, (System.Collections.IEnumerable)ViewData["Programs"], "Program_Key", "NameDesc").Width(350);
        c.ForeignKey(p => p.Zone_Key, (System.Collections.IEnumerable)ViewData["Zones"], "Zone_Key", "NameDesc").Width(350);
        c.ForeignKey(p => p.Road_Key, (System.Collections.IEnumerable)ViewData["Roads"], "Road_Key", "FullRoadNumber").Width(200);
.....

The model for the ProjectDropDown returned by the GetDropDownList() is:
 public class ProjectDropDown
    {
        [Key]
        [ScaffoldColumn(false)]
        public string Project_Key { get; set; }

        [MaxLength(70)]
        [Display(Name = "Name")]
        public string NameDesc { get; set; }

        [MaxLength(10)]
        [Display(Name = "Mgt. Unit")]
        public string Mgt_Unit_Key { get; set; }

        [MaxLength(10)]
        [Display(Name = "Program")]
        public string Program_Key { get; set; }

        [MaxLength(10)]
        [Display(Name = "Zone")]
        public string Zone_Key { get; set; }

        [MaxLength(10)]
        [Display(Name = "Road")]
        public string Road_Key { get; set; }
    }





























































Alexander Popov
Telerik team
 answered on 05 Sep 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?