Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
122 views
hi,
        how to give title to RadDockZone not for RadDock.
        please help.
thanks in advance
Jesmon Joseph
Stuart Hemming
Top achievements
Rank 2
 answered on 22 Mar 2012
2 answers
100 views
Hi there
I am experiencing the following problems when I try to rebuild this example in a application : window example
First: the edit button on the right-next collum of the grid isnt working
Second: Whenever I insert or update a record the Insert/Edit window remains open and the grid isn not refreshed. 

<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="DefaultCS.aspx.cs" Inherits="TelerikRadDemo.Home" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
 
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
    <br />
    <telerik:RadMenu ID="RadMenu1" runat="server"
    OnItemClick="RadMenu1_ItemClick" Style="top: 19px;
        left: 0px" Skin="Metro">
        <Items>
            <telerik:RadMenuItem runat="server" Text="Open">
                <Items>
                    <telerik:RadMenuItem runat="server" Text="Cars">
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem runat="server" Text="Manufactures">
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem runat="server" Text="Customers">
                    </telerik:RadMenuItem>
                </Items>
            </telerik:RadMenuItem>
            <telerik:RadMenuItem runat="server" Text="Help">
                <Items>
                    <telerik:RadMenuItem runat="server" Text="Visit Golem webpage">
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem runat="server" Text="About us">
                    </telerik:RadMenuItem>
                </Items>
            </telerik:RadMenuItem>
        </Items>
    </telerik:RadMenu>
    <br />
    <br />
    <telerik:RadToolBar ID="RadToolBar1" Runat="server" Skin="Metro" >
        <Items>
            <telerik:RadToolBarButton runat="server" Text="Add" onclick="return ShowInsertForm();">
            </telerik:RadToolBarButton>
            <telerik:RadToolBarButton runat="server" Text="Delete">
            </telerik:RadToolBarButton>
            <telerik:RadToolBarButton runat="server" Text="Edit">
            </telerik:RadToolBarButton>
            <telerik:RadToolBarButton runat="server" Text="Next">
            </telerik:RadToolBarButton>
            <telerik:RadToolBarButton runat="server" Target="_previous" Text="Previous">
            </telerik:RadToolBarButton>
        </Items>
    </telerik:RadToolBar>
    <br />
    <div>
        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript">
                function ShowEditForm(id, rowIndex) {
                    var grid = $find("<%= RadGrid1.ID %>");
 
                    var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();
                    grid.get_masterTableView().selectItem(rowControl, true);
 
                    window.radopen("EditFormCS.aspx?ID=" + id, "UserListDialog");
                    return false;
                }
 
                function ShowInsertForm() {
                    window.radopen("EditFormCS.aspx", "UserListDialog");
                    return false;
                }
                function refreshGrid(arg) {
                    if (!arg) {
                        $find("<%= RadAjaxManager1.ID %>").ajaxRequest("Rebind");
                    }
                    else {
                        $find("<%= RadAjaxManager1.ID %>").ajaxRequest("RebindAndNavigate");
                    }
                }
                function RowDblClick(sender, eventArgs) {
                    window.radopen("EditFormCS.aspx?ID=" + eventArgs.getDataKeyValue("ID"), "UserListDialog");
                }
 
//                var selected = {};
//                function RadGrid1_RowSelected(sender, args) {
//                    var ID = args.getDataKeyValue("ID");
//                    if (!selected[ID]) {
//                        selected[ID] = true;
//                    }
//                }
//                function RadGrid1_RowDeselected(sender, args) {
//                    var ID = args.getDataKeyValue("ID");
//                    if (selected[ID]) {
//                        selected[ID] = null;
//                    }
//                }
//                function RadGrid1_RowCreated(sender, args) {
//                    var ID = args.getDataKeyValue("ID");
//                    if (selected[ID]) {
//                        args.get_gridDataItem().set_selected(true);
//                    }
//                }
//                function GridCreated(sender, eventArgs) {
//                    var masterTable = sender.get_masterTableView();
//                    //check whether all items on the active page are selected    
//                    if (masterTable.get_selectedItems().length == masterTable.get_pageSize()) {
//                        /*find the checkbox in the header of the GridClientSelectColumn and set checked state for it - will work with AllowMultiRowSelection = true only!*/
//                        var gridHeader = masterTable.get_element().getElementsByTagName("TH")[0];
//                        for (var i = 0; i < gridHeader.childNodes.length; i++) {
//                            if (gridHeader.childNodes[i].id.indexOf("columnSelectCheckBox") > -1) {
//                                gridHeader.childNodes[i].checked = "true";
//                            }
//                        }
//                    }
//                }
            </script>
        </telerik:RadCodeBlock>
        <telerik:RadGrid OnItemCreated="RadGrid1_ItemCreated" ID="RadGrid1" runat="server"
            AllowPaging="True" Width="97%" DataSourceID="SqlDataSource1" Skin="Metro"
            AllowMultiRowSelection="true">
            <PagerStyle Mode="NumericPages" />
            <MasterTableView AutoGenerateColumns="False" DataKeyNames="ID" ClientDataKeyNames="ID"
                Width="100%" CommandItemDisplay="Top" PageSize="5">
                <Columns>
                    <telerik:GridBoundColumn DataField="ID" HeaderText="ID" ReadOnly="True"
                        SortExpression="ID" UniqueName="ID">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Manufacture" HeaderText="Manufacture" SortExpression="Manufacture"
                        UniqueName="Manufacture">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Name" HeaderText="Name" SortExpression="Name"
                        UniqueName="Name">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Year" HeaderText="Year" SortExpression="Year"
                        UniqueName="Year">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Price" HeaderText="Price" ReadOnly="True"
                        SortExpression="Price" UniqueName="Price">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Information" HeaderText="Information" ReadOnly="True"
                        SortExpression="Information" UniqueName="Information">
                    </telerik:GridBoundColumn>
                    <telerik:GridTemplateColumn UniqueName="TemplateEditColumn">
                        <ItemTemplate>
                            <asp:HyperLink ID="EditLink" runat="server" Text="Edit"></asp:HyperLink>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                </Columns>
                <CommandItemTemplate>
                    <a href="#" onclick="return ShowInsertForm();">Add New Record</a>
                </CommandItemTemplate>
            </MasterTableView>
            <ClientSettings>
                <Selecting AllowRowSelect="true" />
                <ClientEvents OnRowDblClick="RowDblClick" />
            </ClientSettings>
        </telerik:RadGrid>
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server"
            EnableShadow="true" Skin="Metro">
            <Windows>
                <telerik:RadWindow ID="UserListDialog" runat="server" Title="Editing record" Height="320px"
                    Width="310px" Left="150px" ReloadOnShow="true" ShowContentDuringLoad="false"
                    Modal="true" />
            </Windows>
        </telerik:RadWindowManager>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:TelerikCars %>"
            SelectCommand="SELECT [ID], [Manufacture], [Name], [Year], [Price], [Information] FROM [Cars]">
        </asp:SqlDataSource>
        <br />
    </div>
</asp:Content>


<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="EditFormCS.aspx.cs" Inherits="TelerikRadDemo.EditFormCS" %>
 
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div>
        <script type="text/javascript">
            function CloseAndRebind(args)
            {
                GetRadWindow().BrowserWindow.refreshGrid(args);
                GetRadWindow().close();
                 
            }
 
            function GetRadWindow()
            {
                var oWindow = null;
                if (window.radWindow) oWindow = window.radWindow;
                else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
 
                return oWindow;
            }
 
            function CancelEdit() {
                GetRadWindow().close();
            }
        </script>
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" Skin="Metro" DecoratedControls="All" />
        <br />
        <br />
        <asp:DetailsView ID="DetailsView1" DataKeyNames="ID" runat="server" AutoGenerateRows="False"
            DataSourceID="SqlDataSource1" Height="50px" Width="125px" OnItemCommand="DetailsView1_ItemCommand"
            BorderWidth="0" CellPadding="0" CellSpacing="7" GridLines="None" OnItemUpdating="DetailsView1_ItemUpdating">
            <Fields>
                <asp:BoundField DataField="Manufacture" HeaderText="Car manufacture" SortExpression="Manufacture" />
                <asp:BoundField DataField="Name" HeaderText="Car" SortExpression="Name" />
                <asp:BoundField DataField="Year" HeaderText="Year of deploymnet" SortExpression="Year" />
                <asp:BoundField DataField="Price" HeaderText="Current Price" SortExpression="Price" />
                <asp:BoundField DataField="Information" HeaderText="Information" SortExpression="Information" />
                <asp:CommandField ShowEditButton="True" ButtonType="Button" />
                <asp:CommandField ShowInsertButton="True" ButtonType="Button" />
            </Fields>
        </asp:DetailsView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:TelerikCars %>"
            InsertCommand="INSERT INTO [Cars] ([Manufacture], [Name], [Year], [Price], [Information]) VALUES (@Manufacture, @Name, @Year, @Price, @Information)"
            SelectCommand="SELECT [ID], [Manufacture], [Name], [Year], [Price], [Information] FROM [Cars] WHERE ([ID] = @ID)"
            UpdateCommand="UPDATE [Cars] SET [Manufacture] = @Manufacture, [Name] = @Name, [Year] = @Year, [Price] = @Price, [Information] = @Information WHERE [ID] = @ID">
            <InsertParameters>
                <asp:Parameter Name="Manufacture" Type="String" DefaultValue="" ConvertEmptyStringToNull="false" />
                <asp:Parameter Name="Name" Type="String" DefaultValue="" ConvertEmptyStringToNull="false" />
                <asp:Parameter Name="Year" Type="String" DefaultValue="" ConvertEmptyStringToNull="false" />
                <asp:Parameter Name="Price" Type="String" DefaultValue="" ConvertEmptyStringToNull="false" />
                <asp:Parameter Name="Information" Type="String" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="Manufacture" Type="String" DefaultValue="" ConvertEmptyStringToNull="false" />
                <asp:Parameter Name="Name" Type="String" DefaultValue="" ConvertEmptyStringToNull="false" />
                <asp:Parameter Name="Year" Type="String" DefaultValue="" ConvertEmptyStringToNull="false" />
                <asp:Parameter Name="Price" Type="String" DefaultValue="" ConvertEmptyStringToNull="false" />
                <asp:Parameter Name="Information" Type="String" />
                <asp:Parameter Name="ID" Type="Int32" />
            </UpdateParameters>
            <SelectParameters>
                <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
        <br />
        <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
    </div>
</asp:Content>


Can you help me solving this problems?
Andrey
Top achievements
Rank 1
 answered on 22 Mar 2012
2 answers
127 views
So I'm successfully binding my resources to the AdvancedForm template, but there is a scenario that I haven't been able to find a solid answer for.

For one of the RadComboBox-es, I want to take the selected value, post it back, and rebind the resource dropdown below it. An example is a client has particular services assigned to them, so when the client selection changes, I need just the services they have available to be rebound.

I'm actually to the point that I have the combo box posting back and rebinding accordingly, but now for some reason, the combo box that posts back (also a resource, the Client resource) is no longer attached to the appointment. So when I insert the appointment, the 2 other resources I have are in the collection on the Appointment, but not the Client resource.

My major hang up is that the ResourceControl is used on the AdvancedForm control and I'm not really quite sure how to get directly to the ResourceControl and its child controls without doing a bunch of FindControl (which is what I'm doing now)

The strange thing is that on the SelectedIndexChanged handler that's firing, if I look at the Appointment property that I have on the code-behind class, all 3 resources are there and assigned successfully. After that event is completed and move to an insert/update, for some reason the Client resource gets dropped off the appointment.
David
Top achievements
Rank 1
 answered on 22 Mar 2012
0 answers
163 views

Sorry if this has been posted this in wrong place.   

I'm using a RadComboBox (ASP.Net) that has properties:
CloseDropDownOnBlur="true"
MarkFirstMatch="true"
AllowCustomText="true"

The Problem I'm facing is: 
If user start typing your own title, the pre-defined values starts to appear.
Say, the user types a single letter, say "N" into the box and it instantly selects the first option that starts with a 'N' (the list is presorted) and fill in that option in the box.
When you click off the combobox, is takes what you typed followed with the predefined value.


For e.g.: 'nNetwork Administrator'

I typed in "n"

'Network Administrator' automatically got taged on to the end there.

This happens on IE 9, IE8, Safari and Chrome but not on Mozilla.
The Telerik RdComboBox Version I'm using is: 2.8.5.0

I would highly appreciate if any one can Promptly reply on this, as this is very urgent for me.

Thanks in Advance


Mitesh
Top achievements
Rank 1
 asked on 22 Mar 2012
6 answers
387 views
i've installed telerik 2011 Q3 Asp.net ajax. all skins are disappeared  except the default skin.... how i can find it ?!
bishoy
Top achievements
Rank 1
 answered on 22 Mar 2012
3 answers
255 views
I've pretty much kept to the example here
http://www.telerik.com/community/code-library/aspnet-ajax/grid/export-multiple-radgrids-in-single-pdf-excel-file.aspx

except that I have two grids on separate rows, which I've done like this.

<telerik:RadGrid ID="rgridExport" AutoGenerateColumns="false" runat="server" OnNeedDataSource="rgridExport_NeedDataSource" ExportSettings-ExportOnlyData="false"
    ExportSettings-OpenInNewWindow="true" OnItemDataBound="rgridExport_ItemDataBound" ShowHeader="false" AlternatingItemStyle-BackColor="White">
        <MasterTableView>
            <Columns>
                <telerik:GridBoundColumn UniqueName="Id" DataField="Id" Visible="false" />
                <telerik:GridTemplateColumn UniqueName="image">
                     
                    <ItemTemplate>
                    <table width="100%">
                        <tr>
                            <td align="right" valign="middle" style="vertical-align:middle; width:50px;">
                            <asp:Image runat="server" ID="img" />
                           </td>
                           <td>
                        <telerik:RadGrid ID="rgrid" runat="server" Skin="Sitefinity" ItemStyle-HorizontalAlign="Center" AlternatingItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" >
                            <ExportSettings ExportOnlyData="true" OpenInNewWindow="true" />
                        </telerik:RadGrid>
                           </td>
                        </tr>
                    </table>
                    <br /><br /><br />
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                     
            </Columns>
        </MasterTableView>
         
    </telerik:RadGrid>
and the .cs file
protected void rgridExport_NeedDataSource(object sender, EventArgs e)
{
    DataTable dt = new DataTable();
    dt.Columns.Add("Id", typeof(int));
    DataRow dr = dt.NewRow();
    dr["Id"] = 1;
    dt.Rows.Add(dr);
    dr = dt.NewRow();
    dr["Id"] = 2;
    dt.Rows.Add(dr);
    rgridExport.DataSource = dt;
  
}
protected void rgridExport_ItemDataBound(object sender, GridItemEventArgs e)
{
    if (e.Item is GridDataItem)
    {
        GridDataItem item = (GridDataItem)e.Item;
        Image img = item["image"].FindControl("img") as Image;
        RadGrid rgrid = item["image"].FindControl("rgrid") as RadGrid;
  
        switch (item["Id"].Text)
        {
            case "1":
                rgrid.ShowFooter = true;
                rgrid.GridLines = GridLines.Horizontal;
                rgrid.AllowPaging = true;
                rgrid.AutoGenerateColumns = false;
                rgrid.NeedDataSource += rgHitRatio_NeedDataSource;
                rgrid.ItemDataBound += rgHitRatio_ItemDataBound;
                rgrid.MasterTableView.ShowFooter = true;
                rgrid.FooterStyle.Font.Bold = true;
                GridBoundColumn col = new GridBoundColumn();
                col.UniqueName = "Placed";
                col.HeaderText = "Placed";
                col.DataField = "Placed";
                rgrid.Columns.Add(col);
                col = new GridBoundColumn();
                col.UniqueName = "#";
                col.HeaderText = "#";
                col.DataField = "#";
                col.Aggregate = GridAggregateFunction.Sum;
                col.FooterAggregateFormatString = "{0}";
                rgrid.Columns.Add(col);
                col = new GridBoundColumn();
                col.UniqueName = "30";
                col.HeaderText = "30";
                col.DataField = "30";
                col.Aggregate = GridAggregateFunction.Sum;
                col.FooterAggregateFormatString = "{0}";
                rgrid.Columns.Add(col);
                col = new GridBoundColumn();
                col.UniqueName = "60";
                col.HeaderText = "60";
                col.DataField = "60";
                col.Aggregate = GridAggregateFunction.Sum;
                col.FooterAggregateFormatString = "{0}";
                rgrid.Columns.Add(col);
                col = new GridBoundColumn();
                col.UniqueName = "90";
                col.HeaderText = "90";
                col.DataField = "90";
                col.Aggregate = GridAggregateFunction.Sum;
                col.FooterAggregateFormatString = "{0}";
                rgrid.Columns.Add(col);
                col = new GridBoundColumn();
                col.UniqueName = "Total";
                col.HeaderText = "Total";
                col.DataField = "Total";
                col.Aggregate = GridAggregateFunction.Sum;
                col.FooterAggregateFormatString = "{0}";
                rgrid.Columns.Add(col);
                col = new GridBoundColumn();
                col.UniqueName = "Exhausted";
                col.HeaderText = "Exhausted";
                col.DataField = "Exhausted";
                col.Aggregate = GridAggregateFunction.Sum;
                col.FooterAggregateFormatString = "{0}";
                rgrid.Columns.Add(col);
                col = new GridBoundColumn();
                col.UniqueName = "Rate";
                col.HeaderText = "Rate";
                col.DataField = "Rate";
                col.Aggregate = GridAggregateFunction.Custom;
                col.DataType = typeof(double);
                col.FooterAggregateFormatString = "{0:N2}%";
                col.DataFormatString = "{0:N2}%";
                rgrid.Columns.Add(col);
  
                img.ImageUrl = "~/Images/Clients/Summary.png";
                break;
            case "2":
                rgrid.NeedDataSource += rgScoreCard_NeedDataSource;
                img.ImageUrl = "~/Images/Clients/scorecard.png";
                break;
                  
        }
        if(rgrid != null)
            rgrid.Rebind();
    }
}
protected void btnExport_Click(object sender, EventArgs e)
{
    rgridExport.MasterTableView.ExportToPdf();
}

On the screen, it looks fine, but when I export, I just get empty boxes (see attached)
Daniel
Telerik team
 answered on 22 Mar 2012
2 answers
197 views
Hello Telerik team,
I have a little problem synchronizing a RadGrid and a RadScheduler control. In my project I use a RadScheduler control and a RadGrid control. There the RadGrid control contains all appointments in a list form (only with fields Start, End and Subject) which are displayed in the selected view of the scheduler control.

To use Ajax, both, the RadScheduler and the RadGrid control are inside AjaxSettings.

I'm using an own SchedulerProviderClass and in the code behind the right event handler (OnNeedDataSource and OnNavigationComplete).

My problem is now the following:

If I use the navigation controls of the RadScheduler control the events are fired in the follwowing order:

1. OnNeedDataSource of the RadGrid control will be called
2. OnNavigationComplete of the RadScheduler controll will be called
3. OnDataBound of the RadScheduler control will be called

somtimes (e.g. when changing the view type) the event order is like this:

1. OnNeedDataSource of the RadGrid control will be called
2. OnDataBound of the RadScheduler control will be called
3. OnNavigationComplete of the RadScheduler controll will be called
4. OnDataBound of the RadScheduler control will be called

This order causes me some problems because in the OnNeedDataSource handler I load all appointments from the database DEPENDING on the selected view type AND the selected date of the RadScheduler control.

But since the OnNeedDataSource event is called BEFORE the OnNavigationComplete event, my data in the RadGrid control will be wrong. For example if I navigate one day forward in the DayView, OnNeedDataSource will be called and the SelectedDate of the RadScheduler contains the current day, NOT the next day.

Is there a way, to set the order of the events?

To get for sure that the OnNeedDataSource event will be raised AFTER the OnNavigationComplete event?

Yours sincerely,
Richard Huber-
Richard
Top achievements
Rank 1
 answered on 22 Mar 2012
3 answers
395 views
Hi,
I have a radcombobox with OnClientKeyPressing event.User should not enter any special characters.How can i block this.I have used "OnClientKeyPressing " for validating for special characters.This is the JavaScript code
function OnClientKeyPressing() {
            var evtobj = window.event ? event : e
            if ((evtobj.shiftKey) && ((evtobj.keyCode == 188) || (evtobj.keyCode == 190))) {
                alert("Special characters not allowed");
                evtobj.keyCode = 0;
                evtobj.returnValue = false;
                return false;
            }
        }
Eg:-If the user type "vis<" then "<" it should not come.The value should be "vis" instead of "vis<".How can i avoid this.And data should come starting with "vis"
Princy
Top achievements
Rank 2
 answered on 22 Mar 2012
3 answers
308 views
I'm working with the RadFileExplorer, and the ViewPath is configured in the C#;

My goal is to sort the items in the RadFileExplorer by name and date, such as

CD 3-1

CD 3-2

CD 3-14

CD 3-18

CD 3-24

Rather than the default behavior of

 

CD 3-1

CD 3-14

CD 3-18

CD 3-2

CD 3-24

using (SqlConnection connection = new SqlConnection(newConnect))
                        {
                            // Create the Command and Parameter objects;
                            SqlCommand command = new SqlCommand(queryString, connection);
  
                            // Open the connection in a try/catch block; 
                            // Create and execute the DataReader; 
                            try
                            {
                                connection.Open();
                                SqlDataReader reader = command.ExecuteReader();
                                  
                                while (reader.Read())
                                {                                   
                                    UsernameDB = (reader[1]).ToString();
  
                                    listViewPaths.Add(reader.GetString(3));
                                    listUploadDeletePaths.Add(reader.GetString(4));
  
                                    WebPageTitle = (reader[5]).ToString();
                                }
                                reader.Close();
                            }
                            catch (Exception ex)
                            {
  
                            }
                        }
  
 RadFileExplorer1.Configuration.ViewPaths = listViewPaths.ToArray();

 

Dobromir
Telerik team
 answered on 22 Mar 2012
5 answers
164 views
I have an orgchart inside of a content place holder for a page with a master page:

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <telerik:RadOrgChart ID="RadOrgChart1" runat="server" EnableCollapsing="true" EnableDragAndDrop="true">
    </telerik:RadOrgChart>
</asp:Content>

The data I'm using to populate the orgchart is coming from a web service - so on page load I attach the nodedrop event handler, grab the resource data which I then translate into a data table, then I do my data binding:

protected void Page_Load(object sender, EventArgs e)
    {
        RadOrgChart1.NodeDrop += RadOrgChart1_NodeDrop;
        GetResources();
        LoadEmployees();
 
        RadOrgChart1.RenderedFields.ItemFields.Add(new Telerik.Web.UI.OrgChartRenderedField() { DataField = "Position" });
 
        RadOrgChart1.DataSource = employees;
        RadOrgChart1.DataFieldID = "EmployeeID";
        RadOrgChart1.DataFieldParentID = "ReportsTo";
        RadOrgChart1.DataTextField = "FullName";
        RadOrgChart1.DataImageUrlField = "ImageUrl";
        RadOrgChart1.DataBind();
    }

The orgchart loads as expected and looks great.  When I drag and drop an item and set up break points, the page load events are hit but not the nodedrop events.  I'm not sure if there is something special I have to deal with due to the master page or if I'm just missing something basic in the page life cycle.  The way I'm looking at this I'm essentially doing it exactly as the demo suggests:  http://demos.telerik.com/aspnet-ajax/orgchart/examples/draganddropsimplebinding/defaultcs.aspx 

One additional piece of information is that the script manager is located on the master page - not sure why that should cause a problem.
Ahmad
Top achievements
Rank 1
 answered on 22 Mar 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?