Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
148 views
hi,
i am looking for a solution like as following,
filter sample (from another 3. party solution)

is it possible to set a client side filter on telerik treeview ?

thanks..
Yana
Telerik team
 answered on 21 Oct 2010
3 answers
260 views
How can I detect (server side) which transfer button was clicked during a RadListBox "Transferring" event?

I have a RadTreeView in the ItemTemplate of a RadListBox and another RadListBox on the destination side.  I have DragAndDrop and Transfer working both ways except TransferAll from the RadTreeView side does not work.  To Transfer from that side I had to loop through the SelectedNodes from the RadTreeView and I intend to simply set all the Nodes to Selected but how can I detect that the "TransferAll" button was clicked?

Thanks,
Dan

Yana
Telerik team
 answered on 21 Oct 2010
2 answers
84 views
I have a simple page that when I add a OnRowSelected client site event handler, it breaks the $find command for finding the RadGrid  

If I remove the ClientSettings section and just use a button to execute the same javascript it works fine.  I don't understand why adding the client settings is breaking $find.  When the client settings are there $find always returns null. 

Master Page File
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs" Inherits="radWindowExample.SiteMaster" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head runat="server">
    <title></title>
    <link href="~/Styles/Site.css" rel="stylesheet" type="text/css" />
    <asp:ContentPlaceHolder ID="HeadContent" runat="server">
    </asp:ContentPlaceHolder>
</head>
<body>
    <form runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
    </telerik:RadScriptManager>
    <div class="page">
        <div class="header">
            <div class="title">
                <h1>
                    My ASP.NET Application
                </h1>
            </div>
            <div class="loginDisplay">
                <asp:LoginView ID="HeadLoginView" runat="server" EnableViewState="false">
                    <AnonymousTemplate>
                        [ <a href="~/Account/Login.aspx" ID="HeadLoginStatus" runat="server">Log In</a> ]
                    </AnonymousTemplate>
                    <LoggedInTemplate>
                        Welcome <span class="bold"><asp:LoginName ID="HeadLoginName" runat="server" /></span>!
                        [ <asp:LoginStatus ID="HeadLoginStatus" runat="server" LogoutAction="Redirect" LogoutText="Log Out" LogoutPageUrl="~/"/> ]
                    </LoggedInTemplate>
                </asp:LoginView>
            </div>
            <div class="clear hideSkiplink">
                <asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" EnableViewState="false" IncludeStyleBlock="false" Orientation="Horizontal">
                    <Items>
                        <asp:MenuItem NavigateUrl="~/Default.aspx" Text="Home"/>
                        <asp:MenuItem NavigateUrl="~/About.aspx" Text="About"/>
                    </Items>
                </asp:Menu>
            </div>
        </div>
        <div class="main">
            <asp:ContentPlaceHolder ID="MainContent" runat="server"/>
        </div>
        <div class="clear">
        </div>
    </div>
    <div class="footer">
         
    </div>
    </form>
</body>
</html>

Webform Markup
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="WebForm4.aspx.cs" Inherits="radWindowExample.WebForm4" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
 
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
 
    <script language="javascript">
        var messageId;
        var grid;
 
 
 
        function PreventRowSelection(index) {
            if ((this.Rows[index].ItemType == "Item" || this.Rows[index].ItemType == "AlternatingItem")) {
                return false;
            }
        }
 

        //------dgMessages.ClientID is returning NULL ----THIS IS THE ERROR-----------//
        function CheckSelections() {
            //added the line below
            alert($find("<%= RadGrid1.ClientID %>").get_masterTableView().get_dataItems().length);
             
            //var MasterTable = grid_1.get_masterTableView();
            //var srows = MasterTable.get_selectedItems();
 
            messageId = "";
 
            if (srows.length == 1) {
                messageId = srows[0].KeyValues["ID"];
                DisableButtons(false, false);
            }
            else if (srows.length > 1) {
                DisableButtons(true, false);
            }
            else {
                DisableButtons(true, true);
            }
        }
        </script>
 
    <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" AllowSorting="True"
    CellPadding="0"  EnableAJAX="True"
    EnableAJAXLoadingTemplate="True" GridLines="None" PageSize="25"
        AllowMultiRowSelection="True">
    <CommandItemStyle />
    <ExportSettings>
        <Pdf PageBottomMargin="" PageFooterMargin="" PageHeaderMargin="" PageHeight="11in"
        PageLeftMargin="" PageRightMargin="" PageTopMargin="" PageWidth="8.5in" />
    </ExportSettings>
 
    <PagerStyle BackColor="#6699CC" HorizontalAlign="Justify" />
    <ClientSettings >
        <Selecting AllowRowSelect="True" EnableDragToSelectRows="False" />
        <Scrolling AllowScroll="False" />
        <Selecting AllowRowSelect="True" EnableDragToSelectRows="False"></Selecting>
        <ClientEvents OnRowSelected="CheckSelections()" />
    </ClientSettings>
     
    <HeaderStyle BorderColor="#6699CC" BorderStyle="Solid" BorderWidth="0px" HorizontalAlign="Left" />
 
     <PagerStyle NextPageText="Next &gt;" PrevPageText="&lt; Prev" />
    <FilterMenu></FilterMenu>
</telerik:RadGrid>
<input type="button" onclick="CheckSelections(); return false;" value="Hello" />
</asp:Content>

Code Behind
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
namespace radWindowExample
{
    public partial class WebForm4 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            DataTable dtRagGrid = new DataTable();
             dtRagGrid.Columns.Add("name");
            dtRagGrid.Columns.Add("id");
             dtRagGrid.Rows.Add("john", "1");
            dtRagGrid.Rows.Add("Mark", "2");
             RadGrid1.DataSource = dtRagGrid;
         }
    }
}
Marcus Kellermann
Top achievements
Rank 1
 answered on 21 Oct 2010
5 answers
158 views
i am stuck i need to export a selected row using item template of RadGrid
please help me to export a row from the grid on clicking the button
Daniel
Telerik team
 answered on 21 Oct 2010
1 answer
126 views
Hi all,

how do i find the immdiate children of a parent node???, is this supported by telerik?

Thanks
-Nen
Shinu
Top achievements
Rank 2
 answered on 21 Oct 2010
2 answers
51 views
Hello,

I have a problem with paging in a Web Content Form.
The problem is that when you click on next page or you click on a number or you select page size, you see on the bottom left that it's loading but the grid is not changing.

In the project there is a MasterPage. There is nothing in there except a RadScriptManager.
<head runat="server">
    <title></title>
    <asp:ContentPlaceHolder ID="cphHead" runat="server">
    </asp:ContentPlaceHolder>
</head>
<body>
    <form id="form1" runat="server" style="width: 980px;">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
    <div>
        <asp:ContentPlaceHolder ID="cphContext" runat="server">
        </asp:ContentPlaceHolder>
    </div>
    </form>
</body>

Then I have a Web Content Form that uses the MasterPage.
In the Web Content Form there is a UpdatePanel and in the UpdatePanel there is a RadGrid.

On the grid there is a filter on each column and a groupheader. Those 2 work fine.
I tried using a basic grid with non of the fancy things but that didn't work.

Then I take the whole content of the Web Content Form and put it in a Web Form, not using the MasterPage, then paging works just fine.

Any ideas guys?

Regards,

Auke
Auke Wilstra
Top achievements
Rank 1
 answered on 21 Oct 2010
5 answers
111 views
Hi,

Has anyone had any experience with or created the RadGrid drag/drop demo with XML?  I can't seem to get the GetOrders function correct which is my starting point.  Telerik doesn't seem to have a solution for this either.

I have an XML document that needs to be transformed using an xslt file before binding to the RadGrid.  I would like to use a save button that saves both the shipped and the pending order grids to two different XML documents (not new ones) that they're both initially pulling data from.  This seems like a fairly simple concept, but I've been working on this for several days and can't get past the GetOrders function that would create and assign variables for each element and attribute.  I can't even seem to create the right dataset that gets transformed.  However, I'm not opposed to using something besides a dataset.  I'm using VB, but don't mind converting the C# if anyone knows how to do this.  I'm desperate for some help fairly quickly.  I can easily create a datasource control with the xmldocument and xmlcompiledtransform, but I don't know how to create a reader that would iterate through the elements and attributes to pull the relevant nodes to assign them to variables.

Here's my xmldoc

<?xml version="1.0" encoding="utf-8"?>
<banner>
  <globals width="658" height="162" currentItem="0" radius="4" showButtons="true" buttonLocation="right" blurX="15" blurY="15" showContent="true" bgColor="#000000" bgAlpha="0.8" bgPaddingBottom="0" titleColor="#FFFFFF" titleFontSize="16" descriptionColor="#999999" descriptionFontSize="11" cssFile="css/banner.css">
    <buttonTitleColor default="#000000" rollOver="#CD0000" current="#FFFFFF" />
    <buttonDescriptionColor default="#444444" rollOver="#FF0000" current="#BBBBBB" />
  </globals>
  <item src="images/1.jpg" transition="x" timer="7">
    <buttonTitle><![CDATA[Wseat Field]]></buttonTitle>
    <buttonDescription><![CDATA[Beautiful scene of European weath field at sunset]]></buttonDescription>
    <title><![CDATA[Yellow Weath Field]]></title>
    <description><![CDATA[The Pannonian Plain is a large plain in <a href="http://www.test.com" target="_blank">Central Europe</a> that remained when the Pliocene Pannonian Sea dried out. It is a geomorphological subsystem of the Alps-Himalaya system.]]></description>
    <link>http://www.test.com<;/link>
    <target>_blank</target>
  </item>
  <item src="images/2.swf" transition="x" timer="6">
    <buttonTitle><![CDATA[Balco Lamp]]></buttonTitle>
    <buttonDescription><![CDATA[SWF Usage Example]]></buttonDescription>
    <title><![CDATA[<font color="#FFFFFF" size="36">You can use SWF</font>]]></title>
    <description><![CDATA[Sample SWF file.]]></description>
    <link>http://www.test.com/<;/link>
    <target />
  </item>
  <item src="images/3.jpg" transition="y" timer="5">
    <buttonTitle><![CDATA[Balcoon Lamp]]></buttonTitle>
    <buttonDescription><![CDATA[This Car is Sweet!]]></buttonDescription>
    <title><![CDATA[Detroit - Jan 2006]]></title>
    <description><![CDATA[This <a href="http://www.test.com" target="_blank">Infiniti Coupe</a> Concept debuted at the North American Auto Show in Detroit in Jan 2006. Rumors hint at a 325hp V-6 or an optional V-8 engine.]]></description>
    <link>http://www.test.com<;/link>
    <target>_blank</target>
  </item>
  <item src="images/4.jpg" transition="x" timer="4">
    <buttonTitle><![CDATA[farn Lamp]]></buttonTitle>
    <buttonDescription><![CDATA[Open Lamp in Evening]]></buttonDescription>
    <title><![CDATA[Open Lamp in Evening]]></title>
    <description><![CDATA[My favorite farm house nearby.]]></description>
    <link>http://www.test.com<;/link>
    <target />
  </item>
  <item src="images/5.jpg" transition="x" timer="7">
    <buttonTitle><![CDATA[Shs for Vacation]]></buttonTitle>
    <buttonDescription><![CDATA[We finally got the great shadow of blue rain drops]]></buttonDescription>
    <title><![CDATA[Car Roof Rain Drops]]></title>
    <description><![CDATA[Car Roof Rain Drops by <a href="http://www.flashcomponents.net/" target="_blank">The Great Shadow</a>. After waiting for a long time... We Finally got what we wanted, something that someone countries they wish it stops because it destroys everything and its a disaster.]]></description>
    <link>http://www.test.com<;/link>
    <target>_blank</target>
  </item>
  <item src="images/6.png" transition="alpha" timer="8">
    <buttonTitle><![CDATA[Ships for Vacation]]></buttonTitle>
    <buttonDescription><![CDATA[]]></buttonDescription>
    <title>
    </title>
    <description>
    </description>
    <link>http://www.test.com<;/link>
    <target>_blank</target>
  </item>
  <item src="images/7.jpg" transition="x" timer="4">
    <buttonTitle><![CDATA[e machine]]></buttonTitle>
    <buttonDescription><![CDATA[Historical machine]]></buttonDescription>
    <title><![CDATA[]]></title>
    <description>
    </description>
    <link>http://www.test.com<;/link>
    <target>_blank</target>
  </item>
  <item src="images/8.jpg" transition="alpha" timer="8">
    <buttonTitle><![CDATA[Red Heart & Autumn]]></buttonTitle>
    <buttonDescription><![CDATA[The Alps]]></buttonDescription>
    <title><![CDATA[European Mountains]]></title>
    <description><![CDATA[The highest mountain in the Alps is Mont Blanc, at 4,808 metres]]></description>
    <link />
    <target />
  </item>
</banner>


Here's my xslt:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
>
    <xsl:output method="xml" indent="yes"/>
  
    <xsl:template match="banner">
        <xsl:element name="item">
            <xsl:apply-templates/>
        </xsl:element>
    </xsl:template>
      
    <xsl:template match="item">
        <xsl:element name="item">
            <!-- place isbn attribute first -->
            <xsl:attribute name="src">
                <xsl:value-of select="@src"/>
            </xsl:attribute>
            <xsl:attribute name="transition">
                <xsl:value-of select="@transition"/>
            </xsl:attribute>
            <xsl:attribute name="timer">
                <xsl:value-of select="@timer"/>
            </xsl:attribute>
            <xsl:attribute name="dateExp">
                <xsl:value-of select="@dateExp"/>
            </xsl:attribute>
            <xsl:attribute name="dateStart">
                <xsl:value-of select="@dateStart"/>
            </xsl:attribute>
  
            <!--  convert elements to attributes -->
            <xsl:for-each select="*">
                <xsl:attribute name="{name()}">
                    <xsl:value-of select="."/>
                </xsl:attribute>
            </xsl:for-each >
        </xsl:element>
    </xsl:template>
</xsl:stylesheet>

It's the <item> node with it's attributes and elements that I'd like to use.  Please if someone knows or can help me, I'd really appreciate it.

The original GetOrders function that needs to use the above xml info:
Protected Function GetOrders() As IList(Of Order)
           Dim results As IList(Of Order) = New List(Of Order)()
           Using connection As IDbConnection = DbProviderFactories.GetFactory("System.Data.SqlClient").CreateConnection()
               connection.ConnectionString = ConfigurationManager.ConnectionStrings("NorthwindConnectionString").ConnectionString
               Using command As IDbCommand = connection.CreateCommand()
                   command.CommandText = "SELECT o.OrderID, o.CustomerID, o.RequiredDate, c.CompanyName FROM orders o INNER JOIN customers c on o.customerID = c.customerID"
                   connection.Open()
                   Try
                       Dim reader As IDataReader = command.ExecuteReader()
                       While reader.Read()
                           Dim id As Integer = DirectCast(reader.GetValue(reader.GetOrdinal("OrderID")), Integer)
                           Dim customerID As String = IIf((Not reader.IsDBNull(reader.GetOrdinal("CustomerID"))), DirectCast(reader.GetValue(reader.GetOrdinal("CustomerID")), String), String.Empty)
                           Dim requiredDate As DateTime = IIf((Not reader.IsDBNull(reader.GetOrdinal("RequiredDate"))), DirectCast(reader.GetValue(reader.GetOrdinal("RequiredDate")), DateTime), DateTime.MinValue)
                           Dim companyName As String = IIf((Not reader.IsDBNull(reader.GetOrdinal("CompanyName"))), DirectCast(reader.GetValue(reader.GetOrdinal("CompanyName")), String), String.Empty)
                           results.Add(New Order(id, customerID, companyName, requiredDate))
                       End While
                   Catch ex As SqlException
                       results.Clear()
                   End Try
               End Using
           End Using
           Return results
       End Function

The other issue is that I'm using CDATA in some of the elements.  I do know that I can use the following to save the CDATA which I've done in an update/edit form, but I'm not sure how this will impact the rest of the code.  I thought I'd include it, in case it's of help:

Dim buttonTitle As RadTextBox = CType(FormView1.FindControl("buttonTitleTextBox"), RadTextBox)
DirectCast(xmlnode.SelectSingleNode("buttonTitle").FirstChild, XmlCDataSection).Value = buttonTitle.Text

Please anyone, I could really use some help with this.  Thanks.
Tsvetina
Telerik team
 answered on 21 Oct 2010
1 answer
51 views
This is a 2 part question:
1) When a row is in edit mode, I want the dropdowncolumn to be read-only, the person can't change the selected item in the dropdown.
2) I want the datasource for the column to behave differently depending on if you are in edit mode or not.  For instance, my dropdown contains a list of categories.  Once you pick a category, it can't be used in other rows.  So if you had row1 and the category is fish, when the user adds a new record, the category dropdown would not have the fish entry in the list, just all the other categories.  So the user picks meat from the category drop down.  They save the row and try to add another row.  When they go to create this other row, the category drop down would not have fish and meat.  Of course, if you delete the row where you had selected fish, then fish would now be available in the category dropdown.  Any ideas on how to accomplish something like this?  Thanks.
Radoslav
Telerik team
 answered on 21 Oct 2010
1 answer
133 views
I'm using ASP.NET AJAX v.2010.1.519.35.

I have an issue where the Minimize and Restore commands cause the content window to be refreshed on Web-kit based browsers.

Here's the parent (default.aspx):

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Default" %>
 
<!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>
    <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <%--Needed for JavaScript IntelliSense in VS2010--%>
            <%--For VS2008 replace RadScriptManager with ScriptManager--%>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    </telerik:RadAjaxManager>
  
    <telerik:RadSkinManager ID="RadSkinManager1" Runat="server" Skin="Office2007">
    </telerik:RadSkinManager>
    <telerik:RadWindowManager id="WindowManager" runat="server" VisibleStatusBar="false" Behaviors="Close,Move,Resize" KeepInScreenBounds="True" ShowContentDuringLoad="True" Modal="true" Overlay="true">
        <Windows>
            <telerik:RadWindow runat="server" ID="Window1" Height="700px" Width="500px" Behaviors="Close,Move,Resize,Minimize,Maximize" RestrictionZoneID="chartTabsFrame" MinimizeZoneID="taskbar" Modal="false" InitialBehavior="Maximize"></telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>
    <telerik:RadWindow ID="Window" runat="server"></telerik:RadWindow>
    <div>
        <a href="#" class="test-dynamic">Test Dynamic</a>
        <a href="#" class="test-static">Test Static</a>
    </div>
        <script type="text/javascript">
            window.onbeforeunload = function() { return 'Test'; }
            $('a.test-dynamic').click(function(e) {
                var mgr = GetRadWindowManager();
                var win = mgr.open(null, null);
                win.setSize(700,700);
                // Fixes onbeforeunload issue with IE
                win.add_show(function(wnd) {
                    var elem = wnd.get_popupElement();
                    elem.onclick = function (e)
                    {
                        return $telerik.cancelRawEvent(e);
                    }
                });
                win.set_behaviors(Telerik.Web.UI.WindowBehaviors.Move + Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Resize +  Telerik.Web.UI.WindowBehaviors.Maximize +  Telerik.Web.UI.WindowBehaviors.Minimize);
                win.setUrl('Window.aspx');
                win.show();
                win.maximize();
                return false;
            });
            $('a.test-static').click(function(e) {
                var win = GetRadWindowManager().getWindowByName('Window1');
                win.setUrl('Window.aspx');
                win.show();
                win.maximize();
                return false;
            });
        </script>
    </form>
</body>
</html>

Where Window.aspx has:

<%@ Page Language="C#" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<script runat="server">
 
</script>
 
<head runat="server">
    <title>Window</title>
</head>
<body>
    <form id="Form" runat="server">
    <div>
    Window
    </div>
    </form>
    <script type="text/javascript">
        alert(new Date());
    </script>
</body>
</html>

When I click on "Test Dynamic", it seems to work fine. When I click on "Test Static", it refreshes when I minimize or restore.
Georgi Tunev
Telerik team
 answered on 21 Oct 2010
1 answer
100 views
Hi,

I am using RADToolBar.I have filled RADToolBar with 3 RADToolBarButton Items which have text as Copy,Paste,Cut

I want to know which button is clicked on server side and want to dispaly in a label

like "Copy" Button is Clicked.
How can i do this
Princy
Top achievements
Rank 2
 answered on 21 Oct 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?