Telerik Forums
UI for ASP.NET MVC Forum
1 answer
350 views
Hi everyone,
I am using Kendo Grid Hierarchy in my ASP.Net MVC application.

For each row in my parent table, i have an option to add a child table.

My parent table is associated with a model. Each row in this parent table has several columns:
- ID
- Name
- Amount
- Button
Every time i add a parent row, all values are empty (ID and Name).

Now, here is my problem:

When my parent row has a child table filled with rows, e need to hide the button in the parent row. 
When i remove my child table, i need to show the buttons again.
I also need to fill a hidden column in the child table, which indicates me who is the parent row.

How can i do this, only in the client side (using javascript)? I want to edit my information inline, and i would like to make a post only after my editing is completed, serializing my table to JSON and sending it to the server.

Thanks in advance.

Best regards
Atanas Korchev
Telerik team
 answered on 12 Aug 2013
2 answers
281 views
My data structure consists of groups and users with a link table between them.  I have setup an OData data source, where I can do either of the following:

/api/Users?$expand=USERGROUPS
or 
/api/UserGroups?$expand=USERS

I want to display a grid with user groups, and the details row to be a grid of users.

Setting up the grid, I use /api/UserGroups in the data source, and I get all my groups to appear.  Where I am experiencing a problem is displaying the users for a selected group.

At first glance, the data source method to use seems to be /api/Users?$expand=USERGROUPS.  I wrote a function that takes in the value of the selected group from detailInit(e), where e is the USERGROUP.data value, and the group's properties can be accessed:

function userDataSource(groupData) {
    console.log("group data");
    console.log(groupData);
    var userDS = new kendo.data.DataSource({
        type: "odata",
        transport: {
            read: {
                //url: "/api/UserGroups?$expand=USERS",
                url: "/api/Users?$expand=USERGROUPS",           // only need to expand users for the selected group
                dataType: "json"                                // the default result type is JSONP, but WebAPI does not support JSONP
            },
            parameterMap: function (options, type) {
                // this is optional - if we need to remove any parameters (due to partial OData support in WebAPI
                var parameterMap = kendo.data.transports.odata.parameterMap(options);
                return parameterMap;
            }
        },
        schema: {
            data: function (data) {
                console.log("USERS");
                console.log(data.value);
                return data.value;
            }
            ,
            total: function (data) {
                console.log("user count: " + data["odata.count"]);
                return data["odata.count"];
            },
            model: {
                fields: {
                    ITEMID: { type: "string" },
                    USERNAME: { type: "string" },
                    FIRSTNAME: { type: "string" },
                    LASTNAME: { type: "string" },
                    EMAIL: { type: "string" }
                }
            }
        },
        pageSize: 10,
        //filter: { field: "odata.value.USERGROUPS.ID", operator: "eq", value: groupData.ID },                     // filter where the the user.group nav prop ID = group id
        serverPaging: true,
        serverFiltering: true,
        serverSorting: true
    });
 
    return userDS;
 
}

function detailInit(e) {
 
    $("<div/>").appendTo(e.detailCell).kendoGrid({
        dataSource: userDataSource(e.data),
        scrollable: false,
        sortable: true,
        pageable: true,
        columns: [
            { field: "USERNAME", title: "User Name", width: "130px" },
            { field: "EMAIL", title: "Email", width: "130px" },
            { field: "NETWORKID", title: "Network ID" }
        ]
    });
 
 
    //var detailRow = e.detailRow;
 
    //detailRow.find(".tabstrip").kendoTabStrip({
    //    animation: {
    //        open: { effects: "fadeIn" } 
    //    }
    //});
}

userDataSource(groupData) returns an array of USERS[], and due to the pageSize attribute, limited to 10.  USERS.  Each USERS element contains a USERGROUPS[] (array) element.

What I would like to return is a list of users where USERS.USERGROUPS.ID == groupData.ID, and have these all displayed in the details grid.

I considered using api/UserGroups?$expand=USERS as the datasource.  In that case I would have to return the array of users within a given group.

Regardless, the filter option I am trying on the data set is not working:
filter: { field: "odata.value.USERGROUPS.ID", operator: "eq", value: groupData.ID },                     // filter where the the user.group nav prop ID = group id

I realize that I could write another data source API that only spits out a list of users (which maybe much simpler), but I would like to know how to use this expanded, navigation content data.

Assistance on this would be appreciated.



B
Top achievements
Rank 1
 answered on 09 Aug 2013
1 answer
134 views
I have tried to add an item to treeview when user click expand icon.  But it doesn't work.

Please help.

function onExpand(e) {
  var expandedNode = e.node;
 if (expandedNode.length == 0) {
      expandedNode = null;
}
treeview.append({
text: 'newNode'
}, expandedNode);

}
Yingyi
Top achievements
Rank 1
 answered on 09 Aug 2013
2 answers
263 views
I need to determine whether an item has children or not.
Any easy way to do it?

Thanks.

Yingyi
Yingyi
Top achievements
Rank 1
 answered on 09 Aug 2013
5 answers
225 views
Hi there,

I am currently mocking up a demo of a chart. I have attached an image.

I need to replace the numbers on the right axis with labels.

For example,
0 will be Nil
5 will be Bronze
10 will be Silver
15 will be Gold
20 will be Platinum
25 will be Diamond

How can I show labels for that right axis instead of the numbers?

Regards,
Tony
Iliana Dyankova
Telerik team
 answered on 09 Aug 2013
1 answer
239 views
Hello,
after some initial test with Kendo UI and the reading  a book of Freeman about MVC I've decided to put struff toghether... but I've still some hiden point I've to finish analyzing...

First : Does Kendo UI supports Entity Framework (in the specific case IdeaBlade's Devforce implementation)? I've tried with a single Entity and it was ok, added a relational one and the view doesn't load data anymore...

Second: I've read I can use the Async ActionResult for MVC ...beign a fan of It I was wondering how should I load the data with KendoUI , consider for example this ActionResult

    public async Task<ActionResult>  GetClientiAsync([DataSourceRequest]DataSourceRequest request)
        {
            IQueryable<I_CLIENTI> dataResult = await  clientiRepository.GetAllClientiAsync();
            DataSourceResult res = dataResult.ToDataSourceResult(request);

            return Json(res, JsonRequestBehavior.AllowGet);
        }
Third : On the book I've seen it uses the View(<model>)  returned... in some of your example you use Json to return data passing [DataSourceRequest] and as far I've understood it's in order to bind the kendo object on the View... What have I to use so?

Thanks
Petur Subev
Telerik team
 answered on 09 Aug 2013
4 answers
439 views
hi

i have some specific requiremnet for client... i have to diplay company name on top of ther page and detail in below portion.

i use normal html control on top page and Kendo grid in detail portion. but i don't know how to pass whole model on controller on save.
my model is like below...

public class Company 
     {
        public string Company { get; set; }
        public IEnumerable<Person> Clients { get; set; }
    }

  public class Person
    {
        [UIHint("Integer")]
        public int PersonID { get; set; }
        [Required]
        public string Name { get; set; }
    }


on view page i declare model like this
@model  MyData.Company 
////////
//
@using (Html.BeginForm())
{  
    @Html.EditorFor(x => x.Company);

////

Kendo grid

 @(
        Html.kenogrid(Model.Person)///////

can you please help me or give sample working application based on my this model.


it will vary help full me to develop my mvc application with this control



thanks




javal patel
Top achievements
Rank 1
 answered on 09 Aug 2013
1 answer
379 views
Hi,

I have just installed the Kendo UI for ASP.NET MVC extensions into my VS 2012 and have a small issue.  It seems in general to have installed ok but when I try to create a Kendo project and I'm shown the Project Configuration Wizard, the drop down box directly underneath the Kendo UI for ASP.NET MVC Project Settings title is empty.  When I click on the download button I get a dialogue box saying "Error retrieving latest version information. Please, try again or contact the Telerik team."

Have I done something wrong?  I'm a bit of a newb at this so any pointers would be greatly appreciated.

Thanks.
Jonathan.
Vesko
Telerik team
 answered on 09 Aug 2013
3 answers
120 views
I have 12 calendar on 2 <TR> in my view (6 calendars/TR)
I need the calendar smaller so they all have the style :     .calendar {width: 150px;   height: 200px;}

@(Html.Kendo().Calendar().Name("YearCalendarMay")
.Min(new DateTime(Model.Year.Year,5,1)).Max(new DateTime(Model.Year.Year,5,31))      
 .Footer(" ").MonthTemplateId("cellTemplate").HtmlAttributes(new { @class = "calendar" })                             
        )


I have the problems shown in the picture,probably because I set the Min and Max properties  :

http://img825.imageshack.us/img825/5164/iud2.png


And I try as you suggested to disable the click on title navigation but I'm missing something

$(document).ready(function () {
        $("YearCalendarMay.k-nav-fast").off("click").css("cursor", "default");
        $("#YearCalendarMay.k-nav-fast").on("click", false);
    }); 

I will appreciate some if you can help me please ..
Dimo
Telerik team
 answered on 09 Aug 2013
2 answers
214 views
Hello again,
Can i add checkbox as a column header ,and also as a column in the grid?
and when i check that header column,it checks every row,something like delete all in the yahoo mail,or hotmail?

Thanks in advance for any suggestion,
Regards Daniel
Daniel
Top achievements
Rank 1
 answered on 09 Aug 2013
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
Dialog
MultiColumnComboBox
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
SmartPasteButton
PromptBox
SegmentedControl
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?