Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
186 views
I am trying to find the right way to build a hierarchical grid. I will present a case much like what I want, showing all of the cases that my application will need.

Checklist One
|
+- What is your age?
   |
   +- Age : Under 40
   |  |
   |  +- Do you like cake? (Available answers : Yes, no) (Score: 3)
   |  |
   |  +- Do you like pie? (Available answers : Yes, no) (Score: 3)
   |  |
   |  +- Do you like cake more than pie? (Available answers : Yes, no, equally) (Score: 2)
   |
   +- Age : At or Over 40
      |
      +- Do you like cake? (Available answers : Yes, no) (Score: 3)
      |
      +- Do you like pie? (Available answers : Yes, no) (Score: 3)
      |
      +- Do you like cake more than pie? (Available answers : Yes, no, equally) (Score: 2)
      |
      +- Do you diet often?
         |
         +- Answer : More or less, yes.
         |  |
         |  +- Does your love of cake and/or pie interfere with your dieting? (Available answers : Yes, no) (Score: 1)
         |  |
         |  +- Do you wish you loved cake and/or pie less?
         |     |
         |     +- Answer : It would help, yes.
         |     |  |
         |     |  +- Would you rather love cake or pie less? (Available answers : Cake, pie, both) (Score: 1)
         |     |
         |     +- Answer : No. Dieting is the price I pay to enjoy cake and/or pie.
         |     |
         |     +- Answer : Heck, no! You're crazy for even thinking that.
         |        |
         |        +- Are you offended at the thought of loving cake or pie less? (Available answers : Yes, no) (Score: 1)
         |        |
         |        +- Would you like some cake and/or pie right now? (Available answers : Yes, no) (Score: 1)
         |    
         +- Answer : No, dieting is not something I need or want to do.

Checklist Two
|
+- Do you like coffee? (Available answers : Yes, no) (Score: 3)
|
+- Do you like tea? (Available answers : Yes, no) (Score: 3)

In the above view, you can see that there are multiple types of data.

The first is the root node - I show two, titled 'Checklist One' and 'Checklist Two'. As you can see, one is complex, while the other is simple.There will be multiple root nodes that all have multiple questions of varying depth that descend from them. I would like to have the ability to view multiple root nodes and all of the resulting questions, but my requirements only ask to see one at a time.

The next levels are characterized by questions that lead to further questions, or ending questions. You can see that each has a different structure. 

Some questions may have further child questions. These questions have free-form answers possible and nothing else. These will never be at the root of the tree, but a given answer may terminate as a leaf. Furthermore, they can have no limit to how often one question descends from another. If you look at Checklist One, you can see a case where the non-root/non-leaf nodes go three levels deep before terminating in the end (leaf) questions, and how two free-form answers end with no further child questions. I would like to have as many levels of depth as possible, but it is unlikely that I will see more than three levels, as I have illustrated above.

Some questions never have child questions. These questions have a list of possible answers (yes, no, equally, both, cake, pie) and there is also an associated 'score'. This is entirely different from the questions above, so they will need to display their data differently. These questions are leaves in the tree. They will never be the root, but they may be connected to the root directly. (Look at Checklist Two for an example where there is a root node - Checklist Two - and two leaf nodes - the coffee question and the tea question. There are no middle nodes there.)

In my database, the root nodes are held in one table, the leaf questions are held in another, and the non-root/non-leaf questions are held in a looping parent-child structure in a third set of tables. Of course, I will be presenting the grid(s) with data via LINQ so the table structures themselves are not important, as I can just create anonymous objects to carry my data.

How should I build this grid? It seems that there is both self-referencing and multiple detail tables, but I haven't found a way to mix the two correctly in a RadGrid.
Ken
Top achievements
Rank 1
 answered on 18 Mar 2013
1 answer
77 views
hi,
i've this code:
<telerik:RadListView ID="RadListView1" runat="server" AllowPaging="True"
DataKeyNames="idutente" ItemPlaceholderID="Contenitore" PageSize="8"
Width="700px" OnNeedDataSource="RadListView1_NeedDataSource">
<LayoutTemplate>
<fieldset style="width: 700px; border:0px; background-color: #FFFFFF; background-image: none;" id="FieldSet1">
<div id="Contenitore" runat="server">
</div>
</fieldset>
</LayoutTemplate>
<ItemTemplate>
<div class="item-sponsor">
<asp:Image ID="Image1" runat="server" ImageUrl='<%# CType(Container.DataItem, PropertyUtente).imageprofile%>' CssClass="img"/>
<span class="name"> <%# CType(Container.DataItem, PropertyUtente).utente%> </span>
<span class="title"> <%# CType(Container.DataItem, PropertyUtente).Desccategoria%></span>
</div>
</ItemTemplate>
</telerik:RadListView

and i wolud that i can click on every field that i see and start a redirect with the value datakyesname...it's possible?

bye
Daniel
Telerik team
 answered on 18 Mar 2013
5 answers
224 views
Hello,

    I'm trying to bind an array of Provincia class objects to the RadComboBox. 

this.ProvinciaRadComboBox.DataSource = DiccionarioDatos.provincias; // Provincia[]
this.ProvinciaRadComboBox.DataTextField= "nombre";
this.ProvinciaRadComboBox.DataBind(); //<---the error is raised here

But when I run the follow error is raised:

Object of type assembly1.Provincia does not have a nombre property

And of course the Provincia class is public, and it has the public string property nombre. The class is defined in a different assembly, but with the reference added to it and also the using.

What I'm doing wrong?

Thanks in advance.
Boyan Dimitrov
Telerik team
 answered on 18 Mar 2013
1 answer
283 views
In my application, when a user clicks on an item in the RadListview, I want a clientside JavaScript function to be called (similar to onclientclick in an asp.net control).
How would I call a client side JavaScript function when "RadListView1_SelectedIndexChanged" event is triggered ?
Angel Petrov
Telerik team
 answered on 18 Mar 2013
1 answer
86 views

Hi all

I have a problem with an Telerik Grid.
Until I can editing direct in the Grid (with AJAX), i have the following problem:
If i’ll editing all data from a line, i go to a editing window with this command:

columns.Command(commands =>
        {
            commands.Custom("editDetail")
                .ButtonType(type)
                .HtmlAttributes(new { @class = "editDetail" })
                .Text("edit")
                .DataRouteValues(route => route.Add(o => o.GeschaeftID).RouteKey("GeschaeftID"))
                .Ajax(false)
                .Action("Edit", "Geschaeft");
        }).Width(38).Title("");

When i finished with the editing, i get back to the site with the Grid.
And now i‘ve lost all filters and sortings.
If i don’t need the AJAX for edting direct in the Grid i don’t loosing the filter and sortings.
I guess the problem ist by the AJAX.
Do you have an idea, what to do that i don't lose the filters and sortings when i using AJAX?

This is my Code:


@(Html.Telerik().Grid<Model>()
    .Name("Grid")
    .DataKeys(keys => keys.Add(c => c.GeschaeftID))
    .ToolBar(commands => { commands.SubmitChanges(); })
    .DataBinding(dataBinding =>
            dataBinding.Ajax()
                .Select("_Index", "Geschaeft")
                .Update("_SaveBatchEditing", "Geschaeft")
    )
    .Columns(columns =>
    {
        columns.Command(commands =>
        {
            commands.Custom("editDetail")
                .ButtonType(type)
                .HtmlAttributes(new { @class = "editDetail" })
                .Text("edit")
                .DataRouteValues(route => route.Add(o => o.GeschaeftID).RouteKey("GeschaeftID"))
                .Ajax(false)
                .Action("Edit", "Geschaeft");
        }).Width(38).Title("");
        columns.Bound(o => o.xy)
            .ClientTemplate("<#=xy? 'ja' : 'nein' #>")
            .Title("A")
            .HeaderHtmlAttributes(new { title = "xy" })
            .Width(12);
        columns.Bound(o => o.xz)
            .Width(84)
            .Title("xz")
            .ReadOnly()
            .ClientTemplate("<#=xz#>");
        columns.Bound(o => o.xf)
            .Title("xf")
            .Width(250)
            .ReadOnly();
    })
    .DetailView(details => details.ClientTemplate(
        Html.Telerik().Grid<Model>()
        .Name("V")
        .Columns(columns =>
        {
            columns.Bound(o => o.vx)
            .Width(90)
            .Title("vx")
            .ReadOnly();
            columns.Bound(o => o.vz)
            .Title("vz")
            .ReadOnly();
        })
        .DataBinding(dataBinding => dataBinding.Ajax()
                .Select("_DetailViewAjax", "Geschaeft", new { geschaeftID = "<#= GeschaeftID #>" }))
        .ToHtmlString()
    ))
    
    .ClientEvents(events => events
        .OnDataBinding("Grid_onDataBinding")
        .OnError("Grid_onError"))
        .Editable(editing => editing.Mode(GridEditMode.InCell))
     .Scrollable(scrolling => scrolling.Enabled(false).Height("auto"))           
     .TableHtmlAttributes(new { style = "table-layout = fixed" })
        .Resizable(resizing => resizing.Columns(true))
        .Sortable()
        .Filterable()
        .Groupable()          
        .Pageable(paging =>
            paging
                .PageSize(ViewBag.PageSize)
                .Style(GridPagerStyles.Status)
                .Position(GridPagerPosition.Bottom)
        )
    )

Petur Subev
Telerik team
 answered on 18 Mar 2013
16 answers
231 views
I am starting to use the rotator control. But cant seem to make it stretch horizontaly when the user resizes the browser horizontaly.

I have the rotator width="100%" but when I grab the side of the browser to make it wider or narrower, normaly all my div's resize and stretch but now with the rotator it seem that the rotator does not resize at all with them.

is there a work around?
Slav
Telerik team
 answered on 18 Mar 2013
3 answers
176 views

I want my GridCheckBoxColumn on insert is visible=false
But in EditMode i want the GridCheckBoxColumn  visible=true

How do i that?

 

 

 

Kostadin
Telerik team
 answered on 18 Mar 2013
2 answers
97 views
Hello,

I am trying to place a notification control inside a content page, between two other controls.
I do not want it's position to be absolute(bottom-right, etc).

How to achive this?

Thanks,
Mike
Mihai
Top achievements
Rank 1
 answered on 18 Mar 2013
5 answers
397 views
How can I navigate to the specified page using tabs. This is my design

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="tabNavigate.aspx.cs" Inherits="tabNavigate" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title></title>
    <link href="StyleSheet2.css" rel="stylesheet" type="text/css" />
    <link href="TabStrip.WebBlue.css" rel="stylesheet" type="text/css" />
    <link href="Ajax.Office2010Silver.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="Rd" runat="server">
    </telerik:RadScriptManager>
    <div>
        <telerik:RadTabStrip ID="rdtabPersonalDetails" runat="server" UnSelectChildren="True"
            AutoPostBack="true" OnTabClick="rdtabPersonalDetails_Click" Skin="WebBlue" EnableEmbeddedSkins="False"
            ClickSelectedTab="True" SelectedIndex="0">
            <Tabs>
                <telerik:RadTab runat="server" Text="Overview">
                </telerik:RadTab>
                <telerik:RadTab runat="server" Text="Personal">
                </telerik:RadTab>
                <telerik:RadTab runat="server" Text="Contact">
                </telerik:RadTab>
                <telerik:RadTab runat="server" Text="Salary">
                </telerik:RadTab>
                <telerik:RadTab runat="server" Text="Bank">
                </telerik:RadTab>
                <telerik:RadTab runat="server" Text="Taxes">
                </telerik:RadTab>
            </Tabs>
        </telerik:RadTabStrip>
    </div>
    </form>
</body>
</html>

My code to navigate is as follows
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
 
public partial class tabNavigate : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
 
    }
 
    protected void rdtabPersonalDetails_Click(object sender, RadTabStripEventArgs e)
    {
        RadTab tab1 = new RadTab();
        switch (e.Tab.Text)
        {
            case "Overview":
                tab1.NavigateUrl = "Default1.aspx";
                break;
            case "Personal":
                tab1.NavigateUrl = "Default2.aspx";
                break;
            case "Contact":
                tab1.NavigateUrl = "Default3.aspx";
                break;
            case "Salary":
                tab1.NavigateUrl = "Default4.aspx";
                break;
            case "Bank":
                tab1.NavigateUrl = "Default5.aspx";
                break;
            case "Taxes":
                tab1.NavigateUrl = "Default6.aspx";
                break;
 
        }
    }
}

But unable to achieve the required

Nencho
Telerik team
 answered on 18 Mar 2013
1 answer
107 views

Need some direction on how to implement this. Any and all assistance is greatly appreciated!
Have a rather abstract business problem, but is huge in my company, so I’m translating it into something simpler to understand.
We’ve collected data on how much coffee people drink, on a daily basis, and need to chart it, showing how much they actually consumed compared to what they should have consumed.

The Data looks like this:

Person                  DateExamined  Budgeted Cups                 Actual Cups Consumed
Fred                       3/1/13                   2                                              1
Fred                       3/2/13                   2                                              4
Fred                       3/3/13                   2                                              2
Bob                        3/1/13                   3                                              5
Bob                        3/2/13                   3                                              4
Bob                        3/3/13                   3                                              5
Steve                    3/1/13                   1                                              1
Steve                    3/2/13                   1                                              0
Steve                    3/3/13                   1                                              0

So by looking at the data we can see how much coffee people actually drank, compared to what they were supposed (budgeted) to drink, on a daily basis.

In the RadChart, I need this charted with a Horizontal Line, with the dates being the x-axis labels.  The line series is the part I’m stumped on.  For the data above, the chart should show a total of 6 lines… more precisely, 3 “groups” of 2 lines… each of the 3 groups being 1 of the persons… the 2 lines being the budget and actual, so one can clearly see when people went over or under.

Thanks for all feedback on this.
Missing User
 answered on 18 Mar 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?