Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
277 views

Hello,

I have just upgraded my telerik components that I use inside our sitefinity custom controls so that I can use RadDropDownTree.

I have coded it as it is done on the demos webpage resources but only using a DataTable as DataSource .

The objects works just fine but the problem is although it recognizes and orders the elements in the correct hierarchy,

The child items does not get indented so instead of looking like this

 

+GrandParent1

 -GrandParent2

     +Parent1

     -Parent2

         +Child1
          +Child2

they look like this

+GrandParent1

-GrandParent2

 +Parent1

 -Parent2

 +Child1

 +Child2

 

There is no property in the documents and in the public properties about the “indentation of child nodes” as far as I can see.
Shouldn't indentation be the default behaviour of a dropdown tree?
I mean it's almost the whole purpose of a dropdown tree instead of a DropDownList.

Am I missing something? Or is there something missing in the documentation about this, or is there a bug?

 

IBelow are my .ascx and .cs files so that you can see for yourselves that it is not different than the example documentation.

Thank you..

-------ASCX FILE------------------

<%@ Control Language="C#" AutoEventWireup="True" CodeBehind="GenericTreeFilter.ascx.cs" Inherits="MyNameSpace.GenericTreeFilter" %>

<telerik:RadAjaxManagerProxy ID="AjaxManagerProxy1" runat="server">

    <AjaxSettings>

       

    </AjaxSettings>

</telerik:RadAjaxManagerProxy>

<style type="text/css">    

    ul.tree-list

    {

        list-style:none;

        padding:0;

        margin:0;

        height:300px;

    }

    li.tree-item

    {

        float:left;

        width:260px;

        padding: 0 10px;

        border-left: solid 1px #b1d8eb;

        height:300px;

    }

</style>

<asp:SqlDataSource ID="Data1" runat="server"

    ConnectionString="<%$ ConnectionStrings:CustomConnectionString %>"

    ProviderName="<%$ ConnectionStrings:CustomConnectionString.ProviderName %>"

    SelectCommand=""></asp:SqlDataSource>

  

        <telerik:RadSkinManager ID="QsfSkinManager" runat="server" ShowChooser="true" />

        <ul class="tree-list" style="margin-left: 100px;">

        <li class="tree-item" style="border: none">

            <asp:Label ID="FilterName" runat="server" font-names="myFont" Text="Generic Filter: "></asp:Label>

            <telerik:RadDropDownTree ID="RadDropDownTree1" runat="server"

                CheckBoxes="TriState"

                ViewStateMode="Enabled"

                Skin="Default"

                DefaultMessage="Seçiniz"

                DataFieldID="ID"

                DataFieldParentID="PARENT_ID"

                DataTextField="VALUE" 

                Width="250"      

                >               

                <DropDownSettings Width="250px"/>

            </telerik:RadDropDownTree>

        </li>

        </ul>

       

       

------------------------------

--------ascx.cs file--------------

namespace MyNameSpace

{

   

       ///<Summary>GenericTreeFilter</Summary>

       public partial class GenericTreeFilter : System.Web.UI.UserControl

       {

             .................

}

protected void Page_Load(object sender, EventArgs e)

       {

if (!IsPostBack)

{                     

                                               RadDropDownTree1.DataSource = GetTreeItems();

                    RadDropDownTree1.DataBind();

             }

       }

       public DataTable GetTreeItems()

{

             using (var connection = new OracleConnection(

                            ConfigurationManager.ConnectionStrings["CustomConnectionString"].ConnectionString))

            using (var cmd = connection.CreateCommand())

            {

            

cmd.CommandText = "select ID,PARENT_ID,PARENT_VALUE,VALUE from tblXXXXX”;

                    DataSet s = new DataSet();

                    using (OracleDataAdapter sdap = new OracleDataAdapter(cmd))

                    {

                           sdap.Fill(s);

                    }

                     connection.Close();

                     if (s.Tables.Count > 0)

                           return s.Tables[0];

else return new DataTable();

               }

        }

---------------------------------------------------------

Peter Filipov
Telerik team
 answered on 06 Mar 2013
7 answers
485 views
If this is  code inserts into rad grid when in insert mode what would be the code that updates a grid when in edit mode?
Protected Sub btnAddRow_Click(sender As Object, e As EventArgs)
 
      If RadGrid4.MasterTableView.IsItemInserted Then
          RadGrid4.MasterTableView.PerformInsert()
      End If
      If RadGrid6.MasterTableView.IsItemInserted Then
          RadGrid6.MasterTableView.PerformInsert()
      End If
 
  End Sub
Kostadin
Telerik team
 answered on 06 Mar 2013
13 answers
1.0K+ views
hi 
i have RadGrid Control, popup edit template form which includes two AsyncUpload controls, a user will use those AsyncUpload controls to upload two files then a submit button will be clicked by the user to insert and submit the data, in code behind i'm checking if the file exists and if it does i'm keeping the popup template opened and show a RadAlert message tells the user that his file already existed, but the AsyncUpload controls are going back to thier default state where no file is selected, maybe i'm silly to look for this scenario but i don't want the user to get bored where he is going to reselect his files again, is there any possible way to maintain the AsyncUpload state ?

thank you 
Peter Filipov
Telerik team
 answered on 06 Mar 2013
7 answers
226 views
Hello,

We use the TreeList control in our ASP .NET 4, C# application (running on Internet Explorer).
In a page we have a Repeater of Update Panels. Each Update Panel contains a TreeList. All TreeLists have the same behaviour. They have multiple sorting enabled, and by default they are sorted by 2 columns (Class, ID). When sorting by some other column (Example: State), we adjust the Sorting Expressions from (Class, ID, State) to (State, ID). The sorting icon is not visible on the State column, but we have a simple button with no text on the Class column.

Do you have any idea what could be the cause for this problem?

Thank you.
Andrey
Telerik team
 answered on 06 Mar 2013
9 answers
529 views
i have radalert on my web page. i wants to change back ground color of rad alert and wants to add image inside the rad alert.

how to do that?

For reference i am adding screenshot of my rad alert box.

and Above the welcome , i want to add horizontal image.
Princy
Top achievements
Rank 2
 answered on 06 Mar 2013
1 answer
58 views
Hi there,

with Telerik it is rather easy to bind a custom class to a radGrid. But for now I do spend hours of research on how to visualize the hierarchy of my class!

Let's assume, we're having this class structure:
class MasterRecord
{
    public string Title { get; set; }
    public string Description { get; set; }
    public List<SlaveRecord> SlaveRecords { get; set; }
    public SlaveRecord SingleRecord { get; set; }
}
 
class SlaveRecord
{
    public string Title { get; set; }
    public string Description { get; set; }
}


If I bind a list of <MasterRecord> to the datasource, all my entries show up in the grid (two columns: Title; Description ), but I can't manage to show up the SlaveRecords or even the SingleRecord!

I've tried a lot of stuff so far, but nothing gets it to work as expected. If I'm in the context of a NestedViewTemplate I'm able to Eval() on the current child, but it doesn't get connected with another radGrid.

Hope, someone could help me here, as all i want to achieve is a basic property grid / property editor.

Regards
Andrey
Telerik team
 answered on 06 Mar 2013
1 answer
67 views
Scenario: You have a start date picker and an end date picker and you want a function that will clear either based on passing the id.   While I know this works:

var StartDatePicker = $find("<%= dpStartDate.ClientID %>");
StartDatePicker.clear();

when we try to pass the id to a function something gets lost in the translation.  Is there any way to do something like:

function clearDatePicker(id) {
     var picker = $find(id);
     picker.clear();
}

called by:

<a href = "javascript: clearDatePicker('<%= dpStartDate.ClientID %.');">clear</a>
Princy
Top achievements
Rank 2
 answered on 06 Mar 2013
9 answers
303 views
hello,
I'm working with radgrid.
could you write any example for creating dynamic edit form template on ItemCreated or ItemDataBound?

thanks a lot!
Shinu
Top achievements
Rank 2
 answered on 06 Mar 2013
17 answers
537 views
I have a radgrid with edit form as Pop-Ups.
After an insert/ edit, I want to display a confirmation message.
How do I do it?
How do I customize appearance of that confirmation modal?
Bala
Top achievements
Rank 1
 answered on 06 Mar 2013
1 answer
232 views
Here is the scenario I am attempting to achieve:

Create a RadGrid set to AutoGenerateColumns. Events on the page can change the data source of this RadGrid. Programatically, I will look for various known possible column and turn on or off the filter for each column. Instead of forcing the user to use the Filter Icon Button, I want all filtering to utilize the "Contains" filter logic, so I am specifying this in the ColumnCreated event.

The problem that I am running into is that for numeric columns, the first time that I type a filter value into the filter textbox and hit enter or tab, the filter value is cleared out and the filter is not applied. The second time I type it, it works.

I am using Telerik.Web.UI.dll version 2013.1.220.40. the behavior is consistent in Chrome v 25.0.1364.97 and IE 9.0.8112.16421. A simplified page that exhibits this behavior is below. Any help will be appriciated. Thank you.

-Scott

Markup:

<%@ Page Language="vb" AutoEventWireup="false" Inherits="acctrpt.acctrpt._Default2"
    validateRequest="false" Codebehind="Default2.aspx.vb" Trace="false" %>
 
 
<head id="Head1" runat="server">
    <title></title>
</head>
 
    <body>
        <form runat="server">
 
        <telerik:RadScriptManager ID="ScriptManager1" runat="server" />
 
        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript">
 
                function RequestStart(sender, args) {
 
                    if (args.get_eventTarget().indexOf("ExportToCsvButton") >= 0)
 
                        args.set_enableAjax(false);
                }
            </script>
        </telerik:RadCodeBlock>
 
        <telerik:RadCodeBlock ID="RadCodeBlock2" runat="server">
            <style type="text/css">
                a:hover {color: #444444; text-decoration: overline underline; background-color: #E1DDC9 !important;}
            </style>
        </telerik:RadCodeBlock>
 
        <telerik:RadAjaxManager ID="AjaxManager1" runat="server" >
            <ClientEvents OnRequestStart="RequestStart" ></ClientEvents>
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="rgValidate">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="rgValidate" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
 
        <table id="tblGrids" width="96%" align="center" runat="server" >
            <tr><td>
                <telerik:RadGrid ID="rgValidate" runat="server" AutoGenerateColumns="true" Width="100%" ItemStyle-Wrap="false" FilterItemStyle-Width="100%" 
                    AllowSorting="true" AllowPaging="true" AllowFilteringByColumn="true" Skin="Outlook" >
                    <GroupingSettings CaseSensitive="false" />
                    <PagerStyle AlwaysVisible="true" />
                    <ExportSettings HideStructureColumns="true" OpenInNewWindow="false" IgnorePaging="true" ExportOnlyData="true" />
                    <MasterTableView CommandItemDisplay="Top" HierarchyLoadMode="Client" GroupLoadMode="Server" >
                        <CommandItemSettings ShowExportToCsvButton="true" ShowAddNewRecordButton="false" ExportToCsvText="grid" />
                    </MasterTableView>
                </telerik:RadGrid>
            </td></tr>
        </table>
 
        <asp:Button runat="server" ID="btn1" Text="Data Source 1" UseSubmitBehavior="false" />
        <asp:Button runat="server" ID="btn2" Text="Data Source 2" UseSubmitBehavior="false" />
 
        </form>
    </body>
 
</html>


Code Behind:
Option Strict On
Imports Microsoft.VisualBasic
Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.Web
Imports System.Web.HttpContext
Imports System.Web.UI
Imports System.Web.UI.HTMLControls
Imports System.Web.UI.WebControls
Imports System.Text.RegularExpressions
Imports System.IO
Imports Telerik.Web.UI
 
Namespace acctrpt
 
    Partial Class _Default2 : Inherits page
 
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
 
        If Not IsPostBack Then
            Dim dt1 As New DataTable
            dt1.Columns.Add("Column1", GetType(Integer))
            dt1.Columns.Add("Column2", GetType(Integer))
            dt1.Columns.Add("Column3", GetType(Integer))
 
            Dim dt2 As New DataTable
            dt2.Columns.Add("Field1", GetType(Integer))
            dt2.Columns.Add("Field2", GetType(Integer))
            dt2.Columns.Add("Field3", GetType(Integer))
 
            For i As Integer = 1 to 20
                Dim dr1 As DataRow = dt1.NewRow
                Dim dr2 As DataRow = dt2.NewRow
 
                dr1("Column1") = i
                dr1("Column2") = i + 100
                dr1("Column3") = i + 1000
 
                dr2("Field1") = i
                dr2("Field2") = i + 200
                dr2("Field3") = i + 2000
 
                dt1.Rows.Add(dr1)
                dt2.Rows.Add(dr2)
            Next
 
            Session("DS1") = dt1.DefaultView
            Session("DS2") = dt2.DefaultView
            Session("ActiveDataSource") = "1"
        End If
    End Sub
 
    Private Sub rgValidate_NeedDataSource(sender As Object, e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles rgValidate.NeedDataSource
        Select Case Session("ActiveDataSource").ToString()
            Case "1"
                rgValidate.DataSource = Session("DS1")
            Case "2"
                rgValidate.DataSource = Session("DS2")
            Case Else
                rgValidate.DataSource = Nothing
        End Select
             
        rgValidate.ExportSettings.FileName = "Export" & Session("ActiveDataSource").ToString()
    End Sub
 
    Private Sub btn1_Click(sender As Object, e As System.EventArgs) Handles btn1.Click
        Session("ActiveDataSource") = "1"
        If rgValidate.MasterTableView isnot Nothing then
            rgValidate.MasterTableView.SortExpressions.Clear()
            rgValidate.MasterTableView.FilterExpression = ""
            rgValidate.MasterTableView.GroupByExpressions.Clear()
        End If
        rgValidate.Rebind()
    End Sub
 
 
    Private Sub btn2_Click(sender As Object, e As System.EventArgs) Handles btn2.Click
        Session("ActiveDataSource") = "2"
        If rgValidate.MasterTableView isnot Nothing then
            rgValidate.MasterTableView.SortExpressions.Clear()
            rgValidate.MasterTableView.FilterExpression = ""
            rgValidate.MasterTableView.GroupByExpressions.Clear()
        End If
        rgValidate.Rebind()
    End Sub
 
    Private Sub rgValidate_ColumnCreated(sender As Object, e As Telerik.Web.UI.GridColumnCreatedEventArgs) Handles rgValidate.ColumnCreated
        If TypeOf e.Column is GridBoundColumn Then
            Dim col As GridBoundColumn = DirectCast(e.Column, GridBoundColumn)
                     
            Select Case True
                Case col.UniqueName.ToLower.Contains("1")
                    col.AllowFiltering = False
                Case col.UniqueName.ToLower.Contains("2")
                    col.CurrentFilterFunction = GridKnownFunction.Contains
                    col.ShowFilterIcon = False   
                    col.AutoPostBackOnFilter = True
                    col.FilterControlWidth = New Unit (110, UnitType.Pixel)
                    col.FilterControlToolTip = "Filter Data"
                Case col.UniqueName.ToLower.Contains("3")
                    col.CurrentFilterFunction = GridKnownFunction.Contains
                    col.ShowFilterIcon = False   
                    col.FilterControlToolTip = "Filter Data"
                    col.AutoPostBackOnFilter = True
                    col.ItemStyle.Width = New Unit(110)
                    col.FilterControlWidth = New Unit(85, UnitType.Percentage)
            End Select
        End If
    End Sub
 
    End Class
End Namespace

Scott
Top achievements
Rank 1
 answered on 05 Mar 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?