Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
216 views
Hello there,
I'm using radwindow in my page in RTL mode, but it doesn't seem link it work!!
it looks like in the attached image!!

I set direction = rtl to the container of the radwindow as in you live demo but didn't work.
did I miss anything to do?

please help me
thanks in advance
Malek
Top achievements
Rank 1
 answered on 31 Oct 2011
1 answer
86 views
Hello,
i am getting this error on popup editform of radgrid (ajax):

Sys.ArgumentUndefinedException: Value cannot be undefined.
Parameter name: type 

I am programming webpart for sharepoint and using radgrid with popup templated edit form. 

When edit template is populated with radcontrols I am having above error.
And when I am using regular asp controls, everything is OK.

Help please!


 


Marin
Telerik team
 answered on 31 Oct 2011
2 answers
90 views
I have a dash board style application that uses the Rad Splitter with a Rad Panel. I'm using an Asp.Panel wrapped in a RadAjaxPanel to dynamically call User Controls. (this as a result of a support article dealing with viewstate issues). 

Two of my user controls use a RadTreeView.
These controls work great when I use a test.aspx and don't use the RadAjaxPanel.

But two issues I can't get by and I suspect are related. The Server Side NodeClicked Event is not firing. Other events on the page are so it appears to be specific to RadTreeView.
I also use the Java code provided in one of the demos to add/delete nodes. I can't seem to find a way to 'find' the treeview control.
The code  I see recommended ... var treeView;  and  treeView = $find("<%= tvNodes.ClientID %>"); on page load returns a null.

I did catch one article that suggested that MS Ajax did not support the Treeview? Can you tell me what I'm doing wrong or suggest and alternate way to get this done?

Code below for the dashboard and the UserControl. 

USERCONTROL ASPX   -------------------------------------------
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="InspectionManager.ascx.vb" Inherits="KCCSoft_Web_Controls_InspectionManager" %>

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
 <script type="text/javascript">
    
     var treeView;
     var textBox;

     function pageLoad() {
         treeView = $find("<%= tvNodes.ClientID %>");
         textBox = $find("<%= tAddNode.ClientID %>");
     }

     function addNode() {
         var nodeText = textBox.get_value();
         var nodelevel = treeView.get_selectedNode();
         if (!nodeText) {
             alert("Please specify the text for the new node.");
             return false;
         }

         if (nodelevel.get_level() > 1) {
             alert("You cannot add a node beyond this level for this tree.");
             return false;
         }

         treeView.trackChanges();
         //Instantiate a new client node
         var node = new Telerik.Web.UI.RadTreeNode();
         //Set its text
         node.set_text(nodeText);
         //Add the new node as the child of the selected node or the treeview if no node is selected
         var parent = treeView.get_selectedNode() || treeView;
         parent.get_nodes().add(node);
         //Expand the parent if it is not the treeview
         if (parent != treeView && !parent.get_expanded())
             parent.set_expanded(true);

         treeView.commitChanges();
         return false;
     }

     function deleteNode() {
         var allNodes = treeView.get_allNodes();
         if (allNodes.length < 1) {
             alert("The treeview is empty.");
             return false;
         }

         var selectedNode = treeView.get_selectedNode();
         if (!selectedNode) {
             alert("You need to select a node first.");
             return false;
         }

         if (allNodes.length == 1) {
             if (!confirm("This is the last node in the treeview. Are you sure you want to delete it?"))
                 return false;
         }

         treeView.trackChanges();
         var parent = selectedNode.get_parent();
         parent.get_nodes().remove(selectedNode);

         treeView.commitChanges();
         return false;
     }
        </script>
    </telerik:RadCodeBlock>

    <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="ButtonSave">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="CheckList" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
        
    </telerik:RadAjaxManagerProxy>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default">
    </telerik:RadAjaxLoadingPanel>
    
    <telerik:RadSplitter ID="RadSplitter1" runat="server" Width="100%" Height="100%">
        <telerik:RadPane ID="RadPane1" runat="server">
             <telerik:RadPanelBar ID="rpInspections" runat="server" Width="100%" 
                ExpandMode="SingleExpandedItem">
                <Items>
                    <telerik:RadPanelItem runat="server" Text="Inspection and Control Checklist" 
                        Expanded="True">
                        <ContentTemplate>
                            <telerik:RadSplitter ID="RadSplitter2" runat="server">
                                <telerik:RadPane ID="RadPanelInspectionTree" runat="server" Width="225px">
                                <div style="padding: 5px">
                                    <label>
                                    Add, Edit or Delete Nodes to Checklist<br />
                                    <telerik:RadTreeView ID="tvNodes" runat="server" DataFieldID="Id" 
                                        DataFieldParentID="ParentId" DataSourceID="sqlNodes" DataTextField="Display" 
                                        DataValueField="Id" >
                                    </telerik:RadTreeView> <br />
                                    Add Node <br />
                                    <telerik:RadTextBox runat="server" ID="tAddNode" > </telerik:RadTextBox>
                                    <asp:ImageButton ID="ButtonSave" runat="server" 
                                        ImageUrl="~/KCCSoft/Images/icon-save.gif" ToolTip="Add Node" 
                                        OnClientClick="return addNode()" /> <br />
                                    Delete Node &nbsp;<asp:ImageButton ID="ImageButton3" runat="server" ImageUrl="~/KCCSoft/Images/icon-delete.gif" ToolTip="Delete Node" OnClientClick="return deleteNode()" /> <br />
                                    <asp:LinkButton ID="SaveInspectionItem" runat="server" onclick="SaveInspectionItem_Click" 
                                       >Save Checklist</asp:LinkButton>
                                    </label>
                                </div>
                                </telerik:RadPane>
                                <telerik:RadPane ID="RadPanelInspectionSitemap" runat="server">
                                   <telerik:RadSiteMap runat="server" ID="SiteMap1" DataSourceID="sqlSiteMap" 
                                    DataFieldID="Id" DataFieldParentID="ParentId" 
                                    DataTextField="Display" DataValueField="Id" Width="100%">
                                        <LevelSettings>
                                            <%-- Settings are initialized from the code-behind --%>
                                            <telerik:SiteMapLevelSetting>
                                            </telerik:SiteMapLevelSetting>
                                            <telerik:SiteMapLevelSetting>
                                            </telerik:SiteMapLevelSetting>
                                            <telerik:SiteMapLevelSetting>
                                                <NodeTemplate>
                                                    <asp:CheckBox ID="cbNode" runat="server"/>
                                                    <asp:Label ID="Label1" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Display") %>' Font-Bold="False"></asp:Label>
                                                </NodeTemplate>
                                            </telerik:SiteMapLevelSetting>
                                        </LevelSettings>
                                    </telerik:RadSiteMap>
                               </telerik:RadPane>
                            </telerik:RadSplitter>
                            
                        </ContentTemplate>
                    </telerik:RadPanelItem>
                    <telerik:RadPanelItem runat="server" Text="Inspection Workflow Details" Expanded="True" Width="100%">
                        <ContentTemplate>
                           <%-- <uc1:Detail runat="server" ID="InspectionDetail" Width="100%" />--%>
                        </ContentTemplate>
                    </telerik:RadPanelItem>
                    <telerik:RadPanelItem runat="server" Text="Inspection Workflow to Remediate">
                    </telerik:RadPanelItem>
                    <telerik:RadPanelItem runat="server" Text="Supervisor Sign Off and Completion">
                    </telerik:RadPanelItem>
                </Items>
            </telerik:RadPanelBar>
        </telerik:RadPane>
    </telerik:RadSplitter>
    <asp:HiddenField ID="hNodeId" runat="server" />

    <asp:SqlDataSource ID="sqlSiteMap" runat="server" 
    ConnectionString="<%$ ConnectionStrings:con_commlist %>" 
    SelectCommand="SELECT dbo.uvw_InspectionGetSiteMap.* FROM dbo.uvw_InspectionGetSiteMap WHERE (SiteMap = @sitemap)">
        <SelectParameters>
            <asp:ControlParameter ControlID="hNodeId" DefaultValue="" Name="sitemap" 
                PropertyName="Value" />
        </SelectParameters>
    </asp:SqlDataSource>
      
    <asp:SqlDataSource ID="sqlNodes" runat="server" 
            ConnectionString="<%$ ConnectionStrings:con_commlist %>" 
            SelectCommand="SELECT Id, ParentId, Display, Description, Expanded FROM dbo.tInspectionAssessment">
    </asp:SqlDataSource>
END USERCONTROL -------------------------------------------

USERCONTROL  VB  -------------------------------------------
Imports System.Data
Imports System.Data.Sql
Imports System.Data.SqlClient
Imports Telerik.Web.UI

Partial Class KCCSoft_Web_Controls_InspectionManager
    Inherits System.Web.UI.UserControl

    Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
        ApplyFirstLevelSettings()
        ApplySecondLevelSettings()
    End Sub

    Protected Sub ApplyFirstLevelSettings()
        Dim setting As SiteMapLevelSetting = SiteMap1.LevelSettings(0)
        setting.ListLayout.RepeatDirection = SiteMapRepeatDirection.Vertical
        setting.ListLayout.RepeatColumns = 2
        setting.ListLayout.AlignRows = False
    End Sub

    Protected Sub ApplySecondLevelSettings()
        Dim setting As SiteMapLevelSetting = SiteMap1.LevelSettings(1)
        setting.ListLayout.RepeatDirection = SiteMapRepeatDirection.Vertical
        setting.ListLayout.RepeatColumns = 4
        setting.ListLayout.AlignRows = False
    End Sub

    Protected Sub tvNodes_NodeClick(sender As Object, e As Telerik.Web.UI.RadTreeNodeEventArgs) Handles tvNodes.NodeClick
        If tvNodes.SelectedNode.Level = "&H0" Then
            hNodeId.Value = tvNodes.SelectedValue
        End If
    End Sub

    Private Function InspectionChecklist() As UserControl
        Throw New NotImplementedException
    End Function

    Protected Sub SaveInspectionItem_Click(sender As Object, e As System.EventArgs)
        Dim sqlConn As New SqlConnection(ConfigurationManager.ConnectionStrings("con_commlist").ConnectionString)
        Dim insStr As String = "usp_InspectionInsertNewItem"
        Dim delStr As String = "usp_InspectionDeleteItem"
        Dim inscomm As New SqlCommand(insStr, sqlConn)
        inscomm.CommandType = CommandType.StoredProcedure
        inscomm.Parameters.Add("parentid", SqlDbType.Int)
        inscomm.Parameters.Add("display", SqlDbType.VarChar)

        Dim delcomm As New SqlCommand(delStr, sqlConn)
        delcomm.CommandType = CommandType.StoredProcedure
        delcomm.Parameters.Add("nodeid", SqlDbType.Int)

        sqlConn.Open()

        For Each operation As ClientOperation(Of RadTreeNode) In tvNodes.ClientChanges
            Dim node As RadTreeNode = operation.Item
            Select Case operation.Type
                Case ClientOperationType.Insert
                    Try
                        inscomm.Parameters("parentid").Value = Val(node.ParentNode.Value)
                        inscomm.Parameters("display").Value = node.Text
                        node.Value = inscomm.ExecuteScalar
                    Catch ex As Exception
                    End Try
                    Exit Select
                Case ClientOperationType.Remove
                    Try
                        delcomm.Parameters("nodeid").Value = Val(node.Value)
                        delcomm.ExecuteNonQuery()
                    Catch ex As Exception
                    End Try
                    Exit Select
                Case ClientOperationType.Update
                    Dim update As UpdateClientOperation(Of RadTreeNode) = DirectCast(operation, UpdateClientOperation(Of RadTreeNode))
                    'EventLogConsole1.LoggedEvents.Add("The """ + update.PropertyName + """ property of the """ + node.Text + """ node changed.")
                    Exit Select
            End Select
        Next
        sqlConn.Close()
    End Sub
End Class

END USERCONTROL -------------------------------------------------

DASHBOARD.ASPX -----------------------------------------------------------------------
<%@ Page Title="" Language="VB" MasterPageFile="~/KCCSoft/Web/Master.master" AutoEventWireup="false" CodeFile="Dashboard.aspx.vb" Inherits="Web_Dashboard" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Main" Runat="Server">
    <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="NavPanel">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="Panel1" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>

    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default">
    </telerik:RadAjaxLoadingPanel>
   
    <div id="container">
    <telerik:RadSplitter id="RadSplitter1" runat="server" height="99%" width="100%">
                <telerik:RadPane id="LeftPane" runat="server" width="22" Scrolling="None">
                    <telerik:RadSlidingZone id="SlidingZone1" runat="server" width="22"
                    DockedPaneId="Pane1"
                    ExpandedPaneId="Pane1" BorderStyle="None" >
                        <telerik:RadSlidingPane id="Pane1" runat="server" 
                            width="250" minwidth="100" TabView="TextOnly" Title="Expand / Collapse">

        <asp:Login ID="Login1" runat="server" CreateUserText="Register" 
                PasswordRecoveryText="Recover Password" 
                VisibleWhenLoggedIn="False">
            </asp:Login>

            <telerik:RadPanelBar ID="NavPanel" runat="server" DataFieldID="Id" 
                DataFieldParentID="ParentId" 
                DataSourceID="sqlPanel" DataTextField="Display" DataValueField="Id" 
                ExpandMode="SingleExpandedItem">
                
            </telerik:RadPanelBar>
            </telerik:RadSlidingPane>
            </telerik:RadSlidingZone>
            </telerik:RadPane>
            
            <telerik:RadPane id="MainPane" runat="server">
                <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" 
                    LoadingPanelID="RadAjaxLoadingPanel1" EnableViewState="False">
                    <asp:Panel ID="Panel1" runat="server">
                    </asp:Panel>
                </telerik:RadAjaxPanel>
            </telerik:RadPane>
    </telerik:RadSplitter>
</div>

<asp:SqlDataSource ID="sqlData" runat="server" 
    ConnectionString="<%$ ConnectionStrings:con_commlist %>" 
    SelectCommand="SELECT * FROM [tUserMenus] ORDER BY [Id]">
</asp:SqlDataSource>

<asp:SqlDataSource ID="sqlPanel" runat="server" 
    ConnectionString="<%$ ConnectionStrings:con_commlist %>" 
    SelectCommand="usp_GetUserMenus" SelectCommandType="StoredProcedure">
    <SelectParameters>
        <asp:SessionParameter Name="username" SessionField="username" Type="String" />
    </SelectParameters>
</asp:SqlDataSource>

</asp:Content>
END DASHBOARD.ASPX -----------------------------------------------------------------------

DASHBOARD VB -------------------------------------------------------------
    Protected Sub NavPanel_ItemClick(sender As Object, e As Telerik.Web.UI.RadPanelBarEventArgs) Handles NavPanel.ItemClick
        LoadUserControl(e.Item.Attributes("GoToURL").ToString)
    End Sub

    Public Sub LoadUserControl(controlName As String)
        If Not (LatestLoadedControlName Is Nothing) Then
            Dim previousControl As Control = Panel1.FindControl(LatestLoadedControlName.Split("."c)(0))
            If Not (previousControl Is Nothing) Then
                Me.Panel1.Controls.Remove(previousControl)
            End If
        End If
        Dim userControlID As String = controlName.Split("."c)(0)
        Dim targetControl As Control = Panel1.FindControl(userControlID)
        If targetControl Is Nothing Then
            Dim userControl As UserControl = CType(Me.LoadControl(controlName), UserControl)
            'slashes and tildes are forbidden
            userControl.ID = userControlID.Replace("/", "").Replace("~", "")
            Me.Panel1.Controls.Add(userControl)
            LatestLoadedControlName = controlName
        End If
    End Sub 'LoadUserControl

    Private Property LatestLoadedControlName() As String
        Get
            Return CStr(ViewState("LatestLoadedControlName"))
        End Get
        Set(value As String)
            ViewState("LatestLoadedControlName") = value
        End Set
    End Property

END DASHBOARD VB -------------------------------------------------------------

Tsvetina
Telerik team
 answered on 31 Oct 2011
1 answer
208 views

No idea why my details tables won't load.  If I comment out the code in the rgDefects_PreRender event.  I just get blank details tables.  If enable the code in PreRender then I get the details table headers to show but no records UNTIL i click one of the the row expand buttons.  When I do that, the entire grid loads all the details correctly and shows all detail records.  Very confused on why I can't get the details to load on initial grid bind.  Can anyone point anything out?

Thanks in advance!

using System;
using System.Collections.Generic;
using System.Linq;
using System.Data.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using Bird.GlobalDatabase;
using Telerik.Web.UI;
using System.Data.SqlClient;
using System.Data;
using System.Web.SessionState;
using System.Text;
 
namespace BDT
{
    public partial class _default : System.Web.UI.Page
    {
 
        protected void Page_Load(object sender, EventArgs e)
        {
 
            rddTech.Filter = RadComboBoxFilter.Contains;
             
            if (Globals.UserName == "" || Globals.UserName == null)
            {
                try
                {
                    if (!Globals.validateUser())
                        Response.Redirect("unauthorized.aspx");
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
 
            if (Globals.dtSerials.Columns.Count <= 0)
            {
                Globals.dtSerials.Columns.Add("SERIAL_NBR");
            }
 
        }
 
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            SqlConnection sqlConn = null;
            SqlDataAdapter sqlDa = null;
            DataTable sqlDt = null;
            SqlCommand sqlCmd = new SqlCommand();
 
            try
            {
                lbSnSelected.Items.Clear();
 
                sqlConn = GlobalDatabase.CreateSqlConnection(GlobalDatabase.gintAvanteDW);
                sqlCmd.Connection = sqlConn;
                sqlCmd.CommandType = System.Data.CommandType.StoredProcedure;
 
                sqlCmd.Parameters.Add(new SqlParameter("@WoSerial", System.Data.SqlDbType.VarChar));
                sqlCmd.Parameters["@WoSerial"].Value = txtWoSerial.Text;
 
                sqlCmd.CommandText = "sp_GET_PART_BY_WO_SERIAL";
                sqlConn.Open();
                sqlDa = new SqlDataAdapter(sqlCmd);
                sqlDt = new DataTable();
 
                sqlDa.Fill(sqlDt);
 
                if (sqlDt.Rows.Count > 0)
                {
                    lbSnResults.DataSource = sqlDt;
                    lbSnResults.DataTextField = "SERIAL_NBR";
                    lbSnResults.DataValueField = "SERIAL_NBR";
                    lbSnResults.DataBind();
                     
 
                    lblItemNbr.Text = sqlDt.Rows[0]["ITEM_NBR"].ToString();
                    lblWoNbr.Text = sqlDt.Rows[0]["WO_NBR"].ToString();
                     
                    lblItemNbr.Visible = true;
                    lblItemNbrLbl.Visible = true;
                    lblWoNbrLbl.Visible = true;
                    lblWoNbr.Visible = true;
                    plResults.Visible = true;
 
                    ddRefDes.DataBind();
                }
                else
                {
                    lblItemNbr.Visible = false;
                    lblItemNbrLbl.Visible = false;
                    lblWoNbrLbl.Visible = false;
                    lblWoNbr.Visible = false;
                    plResults.Visible = false;
                }
 
            }
            catch (Exception ex)
            {
                throw ex;
            }
 
        }
 
        protected void rddTech_DataBound(object sender, EventArgs e)
        {
            RadComboBoxItem item = new RadComboBoxItem();
            item.Value = "";
            item.Text = "";
            rddTech.Items.Add(item);
        }
 
        protected void lbSnResults_PreRender(object sender, EventArgs e)
        {
            if (lbSnResults.Items.Count() == 1)
            {
                RadListBoxItem founditem = lbSnResults.Items[0];
                lbSnResults.Transfer(founditem, lbSnResults, lbSnSelected);
            }
 
        }
 
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            //    DataRow dr;
 
            //    dr = Globals.dtDefects.NewRow();
            //    dr["TEST_CD"] = ddTest.SelectedValue;
            //    dr["TEST_DESC"] = ddTest.SelectedItem.Text;
            //    dr["REF_DESIGNATOR"] = ddRefDes.SelectedValue;
            //    dr["DEFECT_CD"] = ddDefect.SelectedValue;
            //    dr["DEFECT_DESC"] = ddDefect.SelectedItem.Text;
 
            //    Globals.dtDefects.Rows.Add(dr);
 
            //ddTest.SelectedIndex = 0;
            //ddRefDes.SelectedIndex = 0;
            //ddDefect.SelectedIndex = 0;
 
            //rgDefects.DataSource = Globals.dtDefects;
            //rgDefects.DataBind();
        }
 
        protected void ddTest_DataBound(object sender, EventArgs e)
        {
            ListItem li = new ListItem();
            li.Value = "";
            li.Text = "Choose Test";
            ddTest.Items.Insert(0, li);
        }
 
        protected void ddRefDes_DataBound(object sender, EventArgs e)
        {
            ListItem li = new ListItem();
            li.Value = "";
            li.Text = "Choose Ref Des";
            ddRefDes.Items.Insert(0, li);
        }
 
        protected void ddDefect_DataBound(object sender, EventArgs e)
        {
            ListItem li = new ListItem();
            li.Value = "";
            li.Text = "Choose Defect";
            ddDefect.Items.Insert(0, li);
        }
 
        protected void rgDefects_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            //rgDefects.DataSource = Globals.dtSerials;
        }
 
        protected void lbSnResults_Transferred(object sender, RadListBoxTransferredEventArgs e)
        {
            DataRow dr;
            Globals.dtSerials.Clear();
 
            Session["SelectedSerialNbrs"] = "";
 
            foreach (RadListBoxItem i in this.lbSnSelected.Items)
            {
                if (i.Value != "")
                {
                    dr = Globals.dtSerials.NewRow();
                    dr["SERIAL_NBR"] = i.Value;
                     
                    Globals.dtSerials.Rows.Add(dr);
                }               
            }
 
            Session["SelectedSerialNbrs"] = Globals.dtSerials;
 
            SqlConnection sqlConn = null;
            SqlDataAdapter sqlDa = null;
            DataTable sqlDt = null;
            SqlCommand sqlCmd = new SqlCommand();
 
            try
            {
                sqlConn = GlobalDatabase.CreateSqlConnection(GlobalDatabase.gintBDT);
                sqlCmd.Connection = sqlConn;
                sqlCmd.CommandType = System.Data.CommandType.StoredProcedure;
 
                sqlCmd.Parameters.Add(new SqlParameter("@SerialNumbers", System.Data.SqlDbType.Structured));
                sqlCmd.Parameters["@SerialNumbers"].Value = Globals.dtSerials;
 
                sqlCmd.CommandText = "sp_GET_SERIAL_NBRS";
                sqlConn.Open();
                sqlDa = new SqlDataAdapter(sqlCmd);
                sqlDt = new DataTable();
 
                sqlDa.Fill(sqlDt);
 
                if (sqlDt.Rows.Count > 0)
                {
                    rgDefects.DataSource = Globals.dtSerials;
                    rgDefects.Rebind();
                }
 
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 
        protected void rgDefects_ItemDataBound(object sender, GridItemEventArgs e)
        {
            ////DEBUGGING ONLY CODE BELOW
            //try
            //{
            //    if (e.Item is GridDataItem)
            //    {
            //        //int repId = 0;
 
            //        GridDataItem dataItem = e.Item as GridDataItem;
 
            //        //GridDataItem item = (GridDataItem)e.Item;
            //        //repId = Convert.ToInt32(item.GetDataKeyValue("SERIAL_NBR"));
 
            //    }
            //    if (e.Item is GridFooterItem)
            //    {
 
            //    }
            //}
            //catch (Exception ex)
            //{
 
            //}
             
        }
 
        protected void rgDefects_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e)
        {           
            e.DetailTableView.DataSource = dsDefects;
        }
 
        protected void rgDefects_PreRender(object sender, EventArgs e)
        {
            //if (rgDefects.MasterTableView.Items.Count > 0)
            //{
            //    foreach (GridDataItem dataItem in rgDefects.MasterTableView.Items)
            //    {
 
            //        GridTableView tv = (GridTableView)dataItem.ChildItem.NestedTableViews[0];
            //        tv.Rebind();
            //        dataItem.Expanded = true;                   
 
            //    }
            //}
        }
 
    }
}

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="default.aspx.cs" Inherits="BDT._default" %>
 
<%@ Register assembly="Telerik.Web.UI, Version=2011.2.915.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" namespace="Telerik.Web.UI" tagprefix="telerik" %>
<%@ Register TagPrefix="uc" TagName="MenuBar" Src="menu.ascx" %>
 
<!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>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>   
    <script type="text/javascript">
 
        function openpopup(mypage, myname, features) {
            win = window.open(mypage, myname, features);
            win.window.focus();
 
        }
 
        Sys.Application.add_load(function() {
            var listBox = $find("lbSnResults");
            var $ = $telerik.$;
             
            if (listBox != null)
            {
                $(".rlbItem", listBox._getGroupElement())
               .click(function(event) {
                   event.stopImmediatePropagation();
                   event.ctrlKey = true;
                   listBox._onClick(event);
               });
           }
       });
 
       Sys.Application.add_load(function() {
           var listBox = $find("lbSnSelected");
           var $ = $telerik.$;
 
           if (listBox != null) {
               $(".rlbItem", listBox._getGroupElement())
               .click(function(event) {
                   event.stopImmediatePropagation();
                   event.ctrlKey = true;
                   listBox._onClick(event);
               });
           }
       });       
           
    </script>    
      
    <UC:MenuBar id="ucMenu" runat="server" />
    <div>
                 
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadAjaxPanel1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadAjaxPanel1" LoadingPanelID="RadAjaxLoadingPanel" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
     
        <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" height="200px" width="100%" >
            <asp:SqlDataSource ID="QisDataSource" runat="server"
                ConnectionString="<%$ ConnectionStrings:QISConnectionString %>"
                SelectCommand="sp_GET_TECHNICIANS" SelectCommandType="StoredProcedure"></asp:SqlDataSource>
            <asp:SqlDataSource ID="dsGetRefDes" runat="server"
                ConnectionString="<%$ ConnectionStrings:AvanteDWConnectionString %>"
                SelectCommand="sp_GET_REF_DES_BY_ITEM" SelectCommandType="StoredProcedure">
                <SelectParameters>
                    <asp:ControlParameter ControlID="lblItemNbr" Name="Item" PropertyName="Text"
                        Type="String" />
                </SelectParameters>
            </asp:SqlDataSource>
            <asp:SqlDataSource ID="SearchResultsDataSource" runat="server"
                ConnectionString="<%$ ConnectionStrings:AvanteDWConnectionString %>"
                SelectCommand="sp_GET_PART_BY_WO_SERIAL" SelectCommandType="StoredProcedure">
                <SelectParameters>
                    <asp:ControlParameter ControlID="txtWoSerial" Name="WoSerial"
                        PropertyName="Text" Type="String" />
                </SelectParameters>
            </asp:SqlDataSource>
            <asp:SqlDataSource ID="dsDefects" runat="server"
                ConnectionString="<%$ ConnectionStrings:BDTConnectionString %>"
                SelectCommand="sp_GET_DEFECTS_LVL2" SelectCommandType="StoredProcedure">
                <SelectParameters>
                    <asp:Parameter Name="SERIAL_NBR" Type="String" />
                </SelectParameters>   
            </asp:SqlDataSource>
            <asp:SqlDataSource ID="dsSerials" runat="server"
                ConnectionString="<%$ ConnectionStrings:BDTConnectionString %>"
                SelectCommand="sp_GET_SERIAL_NBRS" SelectCommandType="StoredProcedure">
                <SelectParameters>
                    <asp:SessionParameter Name="SerialNumbers" SessionField="SelectedSerialNbrs"
                        Type="Object" />
                </SelectParameters>
            </asp:SqlDataSource>
            <br />
            <table width="100%" style="border-bottom:solid 2px #bbc1c9; border-top:solid 2px #bbc1c9;" >
                <tr>
                    <td width="5px"></td>
                    <td width="140px">Employee ID:</td>
                    <td width="200px">
                        <telerik:RadComboBox ID="rddTech" runat="server" Width="95%"
                            DataSourceID="QisDataSource" DataTextField="FULL_DISPLAY" DataValueField="employee_id"
                            HighlightTemplatedItems="true" EmptyMessage="Please Select"
                            MarkFirstMatch="true" ondatabound="rddTech_DataBound">
                        </telerik:RadComboBox></td>
                    <td width="100px"></td>
                    <td width="50px">
                        <asp:Label ID="lblItemNbrLbl" runat="server" Visible="false" Text="Item #:"></asp:Label></td>
                    <td>
                        <asp:Label ID="lblItemNbr" runat="server" Visible="false"></asp:Label></td>
                </tr>
                <tr>
                    <td></td>
                    <td>Work Order/Serial #</td>
                    <td>
                        <asp:TextBox ID="txtWoSerial" Width="93%" runat="server"></asp:TextBox></td>
                    <td>
                        <asp:Button ID="btnSearch" runat="server" Text="Search"
                            onclick="btnSearch_Click" /></td>
                    <td>
                        <asp:Label ID="lblWoNbrLbl" runat="server" Visible="false" Text="WO #:"></asp:Label></td>                   
                    <td>
                        <asp:Label ID="lblWoNbr" runat="server" Visible="false"></asp:Label></td>                   
                </tr>               
            </table>
            <br />
            <asp:Panel ID="plResults" runat="server" Visible="true">
            <table width="100%" border="0px">
                <tr>
                    <td width="375px" valign="top">
                        <table width="375px" border="0px">
                            <tr>
                                <td width="5px"></td>
                                <td width="145px"><asp:Label ID="lblSelectMsg" runat="server" Text="Select Serial #'s" Visible="true"></asp:Label></td>
                                <td width="25px"></td>
                                <td><asp:Label ID="lblApplyMsg" runat="server" Text="Apply Defect(s) To" Visible="true"></asp:Label></td>
                            </tr>
                            <tr>
                                <td width="5px"></td>
                                <td colspan="3">
                                    <telerik:RadListBox ID="lbSnResults" runat="server" Visible="true"
                                        Height="200" Width="175px" SelectionMode="Multiple" AllowTransfer="true"
                                        TransferToID="lbSnSelected" onprerender="lbSnResults_PreRender"
                                        ontransferred="lbSnResults_Transferred" AutoPostBackOnTransfer="True">
                                    <buttonsettings transferbuttons="All" />
                                    </telerik:RadListBox>
                                    <telerik:RadListBox runat="server" ID="lbSnSelected"
                                        Height="200px" Width="150px" AutoPostBack="True" SelectionMode="Multiple"
                                        AutoPostBackOnTransfer="True" AutoPostBackOnReorder="True"
                                        AutoPostBackOnDelete="True">
                                        <buttonsettings transferbuttons="All" />
                                    </telerik:RadListBox>
                                </td>
                            </tr>               
                        </table>
                    </td>
                    <td align="left" valign="top">
                        <table border="0px" width="500px" style="border-bottom:solid 2px #bbc1c9;">
                            <tr>
                                <td width="100px">Finding Area:</td>
                                <td width="150px"><asp:DropDownList ID="ddFindingArea" runat="server" Width="100%">
                                        <asp:ListItem Value="" Text=""></asp:ListItem>
                                        <asp:ListItem Value="PCBA" Text="PCBA"></asp:ListItem>
                                        <asp:ListItem Value="INST" Text="Instrumentation"></asp:ListItem>
                                    </asp:DropDownList></td>
                                <td width="20px"></td>
                                <td width="100px">Rework Ord #:</td>
                                <td width="100px"><asp:TextBox ID="txtReworkOrd" Width="100%" runat="server"></asp:TextBox></td>                                   
                                <td></td>
                            </tr>
                        </table>
                        <table border="0px" width="100%">
                            <tr>
                                <td> </td>
                            </tr>
                            <tr>
                                <td width="40px">Test:</td>
                                <td width="150px">
                                    <asp:DropDownList ID="ddTest" runat="server" width="90%"
                                        ondatabound="ddTest_DataBound">
                                        <asp:ListItem Value="" Text="Choose Test"></asp:ListItem>
                                        <asp:ListItem Value="TA" Text="Test A"></asp:ListItem>   
                                        <asp:ListItem Value="TB" Text="Test B"></asp:ListItem>
                                        <asp:ListItem Value="TC" Text="Test C"></asp:ListItem>
                                    </asp:DropDownList></td>
                                <td width="60px">Ref Des:</td>
                                <td width="150px">
                                    <asp:DropDownList ID="ddRefDes" runat="server" width="90%"
                                        DataSourceID="dsGetRefDes" DataTextField="REF_DESIGNATOR"
                                        DataValueField="REF_DESIGNATOR" ondatabound="ddRefDes_DataBound">
                                    </asp:DropDownList></td>
                                <td width="50px">Defect:</td>
                                <td width="150px">
                                    <asp:DropDownList ID="ddDefect" runat="server" width="90%"
                                        ondatabound="ddDefect_DataBound">
                                        <asp:ListItem Value="" Text="Choose Defect"></asp:ListItem>
                                        <asp:ListItem Value="DA" Text="Defect A"></asp:ListItem>   
                                        <asp:ListItem Value="DB" Text="Defect B"></asp:ListItem>
                                        <asp:ListItem Value="DC" Text="Defect C"></asp:ListItem>                                   
                                    </asp:DropDownList></td>
                                <td><asp:Button ID="btnAdd" runat="server" Text="Add" onclick="btnAdd_Click" /></td>
                            </tr>                           
                        </table>                       
                        <br />
                        <table border="0px" width="100%" style="border-bottom:solid 0px #bbc1c9;">
                            <tr>
                                <td valign="top" width="50%">
                                    <telerik:RadGrid ID="rgDefects" runat="server" GridLines="None" Skin="WebBlue"
                                        BorderStyle="None" ShowStatusBar="True"
                                        onneeddatasource="rgDefects_NeedDataSource"
                                        CellSpacing="0" OnItemDataBound="rgDefects_ItemDataBound"
                                        ondetailtabledatabind="rgDefects_DetailTableDataBind"
                                        onprerender="rgDefects_PreRender">
                                        <headercontextmenu cssclass="GridContextMenu GridContextMenu_WebBlue"></headercontextmenu>
                                        <mastertableview autogeneratecolumns="False" datakeynames="SERIAL_NBR"
                                            tablelayout="Auto" HierarchyDefaultExpanded="True" HierarchyLoadMode="ServerBind">
                                            <detailtables>
                                                <telerik:GridTableView runat="server" AllowFilteringByColumn="False"
                                                    AutoGenerateColumns="false" CommandItemDisplay="None"
                                                    DataKeyNames="SERIAL_NBR" DataSourceID="dsDefects">
                                                    <parenttablerelation>
                                                        <telerik:GridRelationFields DetailKeyField="SERIAL_NBR"
                                                            MasterKeyField="SERIAL_NBR" />
                                                    </parenttablerelation>
                                                    <commanditemsettings exporttopdftext="Export to PDF" />
                                                    <rowindicatorcolumn filtercontrolalttext="Filter RowIndicator column">
                                                    </rowindicatorcolumn>
                                                    <expandcollapsecolumn filtercontrolalttext="Filter ExpandColumn column">
                                                    </expandcollapsecolumn>
                                                    <Columns>
                                                        <telerik:GridBoundColumn DataField="TEST_DESC" HeaderText="Test"
                                                            SortExpression="TEST_DESC" UniqueName="TEST_DESC">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="TEST_CD" HeaderText="Test"
                                                            SortExpression="TEST_CD" UniqueName="TEST_CD" Visible="TRUE">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="REF_DESIGNATOR"
                                                            HeaderText="Reference Designator" SortExpression="REF_DESIGNATOR"
                                                            UniqueName="REF_DESIGNATOR">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="DEFECT_DESC" HeaderText="Defect"
                                                            SortExpression="DEFECT_DESC" UniqueName="DEFECT_DESC">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="DEFECT_CD" HeaderText="Defect"
                                                            SortExpression="DEFECT_CD" UniqueName="DEFECT_CD" Visible="TRUE">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="USER_UPDATED" HeaderText="USER_UPDATED"
                                                            SortExpression="USER_UPDATED" UniqueName="USER_UPDATED" Visible="False">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="DATE_ENTERED" DataType="System.DateTime"
                                                            HeaderText="DATE_ENTERED" SortExpression="DATE_ENTERED"
                                                            UniqueName="DATE_ENTERED">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridClientDeleteColumn ButtonType="LinkButton"
                                                            ConfirmText="Are you sure u want to delete?" Text="Delete">
                                                        </telerik:GridClientDeleteColumn>
                                                    </Columns>
                                                    <editformsettings>
                                                        <editcolumn filtercontrolalttext="Filter EditCommandColumn column">
                                                        </editcolumn>
                                                    </editformsettings>
                                                </telerik:GridTableView>
                                            </detailtables>
                                            <commanditemsettings exporttopdftext="Export to PDF" />
                                            <rowindicatorcolumn filtercontrolalttext="Filter RowIndicator column">
                                            </rowindicatorcolumn>
                                            <expandcollapsecolumn visible="True">
                                            </expandcollapsecolumn>
                                            <Columns>
                                                <telerik:GridBoundColumn DataField="SERIAL_NBR" HeaderText="Serial #"
                                                    SortExpression="SERIAL_NBR" UniqueName="SERIAL_NBR">
                                                </telerik:GridBoundColumn>
                                            </Columns>
                                            <editformsettings>
                                                <editcolumn filtercontrolalttext="Filter EditCommandColumn column">
                                                </editcolumn>
                                            </editformsettings>
                                        </mastertableview>
                                        <filtermenu enableimagesprites="False">
                                        </filtermenu>
                                    </telerik:RadGrid>                                   
                                </td>
                            </tr>
                        </table>                       
                    </td>      
                </tr>
            </table>
            </asp:Panel>    
        </telerik:RadAjaxPanel>
                            
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel" runat="server"
            height="200px" width="100%" Transparency="0" IsSticky="True" Skin="WebBlue" >
        </telerik:RadAjaxLoadingPanel>       
         
        <br />
    </div>
    </form>
</body>
</html>

Radoslav
Telerik team
 answered on 31 Oct 2011
3 answers
295 views

Hi,

Since I can't use radajaxpanel and RadAjaxManger controls with the Radupload control, can I use the RadAjaxLoadingPanel control with it, I mean, Is it possible to show the RadAjaxLoadingPanel control (the loading image) while processing the Submit button process until the postback event occures ?

If it is possible, can you please explain how can I do that?

Regards,
Bader

Maria Ilieva
Telerik team
 answered on 31 Oct 2011
1 answer
51 views
I have a line graph and I would like to have a line shown across the graph from left to right when the y value reaches a certain limit which I can set - how do I go about this?

Cheers
Gregor
Evgenia
Telerik team
 answered on 31 Oct 2011
1 answer
88 views
Steps to reproduce:
1) Open IE.
2) Open the RadEditor in the Design View.
3) Set "New Lines as" to "Paragraphs"
4) Type "Test", press Enter.
5) Type "Word. Sentence.". Set "Word." as bold.
6) Select the "Test "(with extra space)(when selecting with mouse, extra space is selected by defoult). Copy it.
7) Set the cursor before the "W" character.
8) Paste copied value.
9) Change the view to "HTML".
10) Change the view to "Design".

You wiil have the next:

Test

Test

Word. Sentence.

Sentence.

When expected:

Test

Test

Word. Sentence.


Note: It was tested on IE 8.

Could you please provide any solution or workaround?
Rumen
Telerik team
 answered on 31 Oct 2011
3 answers
106 views
We've got a weird situation.  We open a RadWindow to let the user input query criteria.  Within this RadWindow is a RadSplitter, within which are three RadPanes: header, input, footer.  Within the input RadPane are several asp Panels, each of which displays a different kind of input (text, date, address-type info, etc).  Depending on the type of field selected, we make the appropriate Panel visible.

Upon opening the RadWindow, we include a javascript file whose Load function calls this:
function SizeToFit() {
    window.setTimeout(
            function () {
                var oWnd = GetRadWindow();
                oWnd.autoSize();
            }, 250);
}

Here's the weird part: if the user selects a date-type of input, the RadPane wrapping the content gets rendered as:
<div id="RAD_SPLITTER_PANE_CONTENT_ParamPane" style="width: 1193046px; height: 300px; overflow: hidden;">

The Panel we make visible for date contains a checkbox and a PeterBlum  DateTextBox.

If I comment out the autoSize() call, the RadWindow sizes to whatever it's called with.  Of course, we want it to auto size depending on which Panel we make visible, so that's not a good option.

Note that 1193046 (base 10) = 123456 (base 16).  There's no way that's a coincidence; somehow, autosize is picking up a crazy default value.  Also note this weird behavior is IE-only.

I'm sure I've isolated it to interaction between PB DateTimeBox and RadPane; I've added a DateTimeBox to one of the other Panels to test, and the RadPane blows out.  Also, I've removed it from the date-time Panel and the RadPane's width renders more normally.

What the specific interaction between the two which causes the width to go wild is, I haven't been able to uncover yet.
Marin Bratanov
Telerik team
 answered on 31 Oct 2011
15 answers
456 views
Is there a way to control how many a user can select when using the multi-file selection feature for 2011.2.915?

1) limit the number of file selection in the file open dialogue?
2) preventing files from being uploaded after a set number of successful uploads?
3) hiding the selection control once a set number of files are uploaded successfully?

And is there a way to control what upload module to be used? e.g. I want to use Silverlight as much as possible.

Thanks in advance for any idea.
Koen
Top achievements
Rank 1
 answered on 31 Oct 2011
3 answers
71 views
Does RadEditor Lite support HTML5? Or will it strip out HTML5 tags like <video> or <nav> etc?
Stanimir
Telerik team
 answered on 31 Oct 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?