Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
188 views
Hello Telerik,

So far we have been having a difficult time developing the RadTreeView using server-side coding and data. We have a single table with 3 fields that help define the tree/levels and our internal structure for the application. We want the TreeView to be only postbacked with AJAX on a button click. The TreeView should send back all nodes to the code, which includes new/renamed/reorder nodes. The 3 fields are

NodeLevel - this starts at 1 and ends and the last node in the tree (just a counter of all the node entries - in order of the tree node collection)
NodeLevelUnder - this is a parent to the node - points to the NodeLevel field number
NodeLevelDepth - this is the depth of the node - level deep

Data (NodeLevel, ..Under, ...Depth):
Fruit 1, 0, 0
    Apples 2, 1, 1
        Granny Smith 3, 2, 2
        Greenish Hue 4, 2, 2
    Bananas 5, 1, 1
        Dole 6, 5, 2
            Hawaii 7, 6, 3
            Brazil 8, 6, 3
        Frozen 9, 5, 2
Veggies 10, 0, 0
    Lettuce 11, 10, 1
    Peas 12, 10, 1
        Sugar Snap 13, 12, 2
        Green Pod 14, 12, 2

Well good news is we can get most of this edited nodes, levels, but not the parents id. Using "ClientOperation" of the RadTreeNode in the TreeNode.ClientChanges we can not determine who the parent is of a node that has been added. The GetAllNodes() collecton DOES NOT include the new nodes in the count. We have no idea where it has been added or added and moved. If a old node has a new Parent we need to get that LevelId and put it in the NodeLevelUnder field. The same with a new node that is under a new parent, the index will not reflect the total indexes in the Tree itself, because they are not included in the GetAllNodes() count.

Are we really out of luck trying to accomplish this on the server-side coding? We went through your example here:
http://www.telerik.com/help/aspnet-ajax/treeview-server-save-made-changes-to-treeview-to-database.html
...but you know it really doesnt show real helpful example. It doesnt explain the track/commit at all and really who is just editing node text and reording them, deleting and adding are key features  that should have more attention, at least from our stand point.

Please tell me there is a way to accomplish getting the RadTree back as a whole and iterate through ALL nodes as they appear on the web page? If we cant, then we are defaulted to use custom attributes on the cilent-side for all the user changes and persist them back to the server-side. Will this work? We would have to change out our server-side code and fill in the 3 custom attributes, everytime the client reorders, add, edits, etc., or maybe jsut fill them in once when they click the button to save.

Thanks for the help here
SDI


jlj30
Top achievements
Rank 2
 answered on 04 Apr 2014
3 answers
110 views
Hi all,

Using VS 2010 with UI for ASP.NET AJAX Q1 2014. I am using Grid - Form Template Edit Form like this for both Master/Child Records:

http://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/form-template-update/defaultcs.aspx

My question is it possible as users are typing the values in attached, total values gets changed accordingly for Master/Child Grids, not after post back but as
they are entering/changing values.

Thanks for any help.

gc_0620
Top achievements
Rank 1
 answered on 03 Apr 2014
2 answers
125 views
I have a dilemma where we have a datasource that defines either a 'landscape' or 'portrait' item, each of these need its own template inside a grid (or other recommended control) that flows in the correct manner, see attached illustration.

In the example you can disregard the odd item on the first row, this is simply a 'hoover' effect that has nothing to do with the actual problem.
But as you can see there are two types of items, one landscape and one portrait to be able to show the correct images and still make it flow together with one another. Of course there might be cases where the last item is dropped if we have three landscape items in a row.

So, Is there any way to accomplish this? 
Suppose we need an Event that still hasn't bound the template and we can bind it to the correct template based on the item datasource.

Christian
Konstantin Dikov
Telerik team
 answered on 03 Apr 2014
2 answers
182 views

Hi,

I have a single sliding pane setup horizontally that is used like a quick search window. Is it possible to hide the tab when the user docks the pane using CSS?
I'm doing something like this in my CSS, please tell me what I'm missing...
<style type="text/css">
    .paneTabContainerExpandedHorizontal, rspSlidePane
    {
        /*visibility:hidden !important;*/
        display:none !important;
    }
    html, body, form
    {
        height: 100%;
        margin: 0px;
        padding: 0px;
        overflow: hidden;
    }
</style>

This is my html code:

<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server" ></telerik:RadScriptManager>
         
        <script type="text/javascript">
            function PaneDockedHandler(sender, eventArgs) {
 
                var slidingZone = $find("<%= SpeedSearchSlidingZone.ClientID %>");
                var pane = slidingZone.getPaneById(slidingZone.get_dockedPaneId());
                if (pane) {
                    pane.hideTab();
                }
 
            }
        </script>
 
        <telerik:RadSplitter ID="RadSplitter1" runat="server" Orientation="Vertical" width="100%" Height="100%">
             
            <telerik:RadPane ID="LeftPane" runat="server" Width="22px" Scrolling="None" >
                <telerik:RadSlidingZone ID="RadSlidingZone1" runat="server" Height="100%">
                    <telerik:RadSlidingPane ID="LeadSearchSlidePane" Title="Search Criteria" runat="server" width="150px">
                        <uc1:LeadSearchCriteria runat="server" ID="LeadSearchCriteria" />
                    </telerik:RadSlidingPane>
                    <telerik:RadSlidingPane ID="TreeListSlidePane" Title="Tree View" runat="server">
                        <uc2:LeadSearchTreeView runat="server" ID="LeadSearchTreeView" />
                    </telerik:RadSlidingPane>
                </telerik:RadSlidingZone>
            </telerik:RadPane>
 
            <telerik:RadSplitBar ID="RadSplitBar1" runat="server" BorderWidth="1px" Width="1px" />
            <telerik:RadPane ID="RightPane" runat="server" >
                <telerik:RadSplitter ID="RadSplitter3" runat="server" Orientation="Horizontal" Width="100%" Height="100%">
 
                    <telerik:RadPane ID="SpeedSearchPane" runat="server" Scrolling="None" Height="22px">
                        <telerik:RadSlidingZone ID="SpeedSearchSlidingZone" runat="server" Height="22px">
                            <telerik:RadSlidingPane ID="SpeedSearchSlidingPane" Title="Speed Lead" runat="server"
                                   OnClientDocked="PaneDockedHandler" >
                                speed lead content
                            </telerik:RadSlidingPane>
                        </telerik:RadSlidingZone>
                    </telerik:RadPane>
 
                    <telerik:RadPane ID="LeadResultPane" runat="server" Scrolling="None">
                        content
                    </telerik:RadPane>
                </telerik:RadSplitter>               
            </telerik:RadPane>
        </telerik:RadSplitter>
    </form>
</body>
</html>

As you can see, I'm also trying to hide the tab using javascript by following this example here:

it hides the tab but leaves an empty space. If I use OnClientBeforeDock or OnClientDocking, slidingZone.get_dockedPaneId() returns null and wouldn't go to the hideTab statement.  I have attached a screen shot of the tab layouts.

Please tell me if it's possible to do this using CSS? If not, is there a way to get ride of the empty space besides messing with the width and height as done in the example above?

Thank you for your help~

Helen

 




Helen
Top achievements
Rank 1
 answered on 03 Apr 2014
11 answers
388 views
Hi,

I'm new in Telerik's grid and need help. I have 2 grid controls on ASPX page. The first one is populated with some data. I want to populate the second one when I select an item in first one.

The markup (in aspx) for second grid looks as follows:

            <telerik:RadGrid ID="grdDetails" runat="server" GridLines="Both" AllowPaging="true" AllowSorting="true" AutoGenerateColumns="false">
                <MasterTableView DataKeyNames="ID" Width="50%" TableLayout="Fixed">
                    <Columns>
                        <telerik:GridTemplateColumn HeaderText="Select">
                            <ItemTemplate>
                                <asp:CheckBox runat="server" ID="chkDeleteAppItem" />
                            </ItemTemplate>
                            <HeaderStyle Width="10%" />
                        </telerik:GridTemplateColumn>
                        
                        <telerik:GridBoundColumn DataField="ID" HeaderText="ID">
                            <HeaderStyle Width="25%" />
                        </telerik:GridBoundColumn>
                        
                        <telerik:GridBoundColumn DataField="FN" HeaderText="FIRST NAME">
                            <HeaderStyle Width="25%" />
                        </telerik:GridBoundColumn>
                    </Columns>
                </MasterTableView>
                <ClientSettings>
                    <Selecting AllowRowSelect="true" />
                    <Scrolling AllowScroll="true" />
                    <Resizing AllowColumnResize="true" />
                </ClientSettings>
            </telerik:RadGrid>

The code behind (but not in direct aspx.cs file) looks like this:

        private static void OnGridRecordChanged(object sender, EventArgs e)
        {
            var viewFrameControl = sender as GridFrameControl;
            if (viewFrameControl == null)
            {
                throw new ParusException("Unable to get viewframecontrol!");
            }

            if (CacheInfoRequest.CacheRequest)
            {
                Dictionary<string, Person> dict = new Dictionary<string, Person>()
                {
                    { "1", new Person { FirstName = "Andrey", LastName = "Andreyev" }},
                    { "2", new Person { FirstName = "Sergey", LastName = "Sergeyev" }},
                    { "3", new Person { FirstName = "Igor", LastName = "Igorev" }},
                    { "4", new Person { FirstName = "Vladimir", LastName = "Vladimirov" }},
                    { "5", new Person { FirstName = "Oleg", LastName = "Olegov" }}
                };

                List<BindItem> list = new List<BindItem>();
                foreach (KeyValuePair<string, Person> dictItem in dict)
                {
                    BindItem bindItem = new BindItem();
                    bindItem.ID = dictItem.Key;
                    bindItem.FN = dictItem.Value.FirstName;
                    list.Add(bindItem);
                }

                Control ctrlParent = viewFrameControl.Parent;
                RadGrid grdDetail = ctrlParent.FindControl("grdDetails") as RadGrid;

                grdDetail.BackColor = Color.Green;

                grdDetail.DataSource = list;
                grdDetail.DataBind();
            }
        }

When I select the row in first grid, nothing happens.

I appreciate any help.

Thank you in advance.

Goran
Matthew
Top achievements
Rank 1
 answered on 03 Apr 2014
5 answers
571 views
Hi

Is it possible to perform a SUM aggregate on a field of type TimeSpan? When I try it I get an error: 'Invalid usage of aggregate function SUM and type: Timespan'

thanks
Fernando
Top achievements
Rank 1
 answered on 03 Apr 2014
6 answers
158 views
We're using the grid settings (GridSettingsPersister) to save the grid state on each page Page_PreRenderComplete, so that when the user returns later to the page it's always how they left it last. Conversely the Page_Load sets the state the first time.

I can't seem to find any combination of methods to do that here.
Peter Filipov
Telerik team
 answered on 03 Apr 2014
2 answers
251 views
Hi,

I've created a tooltip for my radgrid in the ItemCreated Event as shown in the code below.  However, I need to style the tooltip now and I don't know how to do it.  Can someone help me with this?

Thanks,

Andy
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
       {
           if (e.Item is GridDataItem)
           {
               GridDataItem gridItem = e.Item as GridDataItem;
               foreach (GridColumn column in RadGrid1.MasterTableView.RenderColumns)
               {
                   if (column is GridBoundColumn)
                   {
                       if (column.UniqueName == "SocSecNum")
                       {
                           CaseSearchDTO obj = (CaseSearchDTO)gridItem.DataItem;
                           if (obj != null)
                               gridItem[column.UniqueName].ToolTip = obj.SocialSecurityNumberFull;
                       }
                   }
               }
           }

 

 

Andy
Top achievements
Rank 1
 answered on 03 Apr 2014
4 answers
152 views
I have users that complain about the inability to "double-click" or "right-click" from their tablets or phones.  Is it possible to trigger the opening of the advanced form via a button or other client side event?
Kate
Telerik team
 answered on 03 Apr 2014
1 answer
162 views
Is there any way to see the filename properties, such as the datetime, when you bring up the Document Manager. This is the middle section that has the file name and size. It would be nice to see the datetime of the file to know which ones were old for my client to archive.

Thanks.
Susan
Vessy
Telerik team
 answered on 03 Apr 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?