Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
135 views
Hello,

I have added NodeExpand event handler to my tree.
tree.NodeExpand += new RadTreeViewEventHandler(Tree_NodeExpand)

When I click on expand (+) button, then NodeExpand event is fired and Tree_NodeExpand method is performed.

But if I open node by calling expand() method at client side, then node is expanded but tree's NodeExpand event is not fired and event handler is not performed.

ExpandMode of my nodes is ServerSide and I work with RadAjaxManager and RadTreeView controls of Prometheus for ASP.NET.

How may I fix the problem?

Thanks,
Olga
Veselin Vasilev
Telerik team
 answered on 21 Mar 2008
0 answers
125 views
I tried searching but I couldn't find anything adding an image for the current node. I came up with this code which will add an image to the current node. I bet someone is going to responsd with an easier way to do this too lol.

Protected Sub RadMenu1_NodeCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadTreeNodeEventArgs) Handles RadMenu1.NodeCreated

If Request.Url.AbsolutePath.Contains(e.Node.NavigateUrl.Remove(0, 1)) Then

e.Node.ImageUrl =

"images/yourimage.jpg"

End If

End Sub

Chuck
Top achievements
Rank 1
 asked on 21 Mar 2008
13 answers
1.5K+ views
I am currently using RadGrid for ASP.NET in my production environment and am trying to make the transition to the Prometheus controls, specifically with the RadGrid control.

I have created a custom skin using the Office2007 as a template and changing minor things like font size, color, some images, etc. For the row css classes, the only difference between GridRow and GridAltRow is the background colour (white or gray) and font colour.

.GridRow_TelerikCustomSkin td 
{ 
    background-color:White; 
    color: #333333; 
    border-bottom: 1px solid #dedede; 
    border-right: 1px solid white; 
    padding-top:4px; 
    padding-bottom:4px; 
} 
 
.GridAltRow_TelerikCustomSkin td 
{ 
    background-color:#f2f2f2; 
    border-right: solid 1px #f2f2f2; 
    border-bottom: solid 1px #dedede; 
    padding-top:4px; 
    padding-bottom:4px; 
} 

In the current version of RadGrid for ASP.NET, I can customize the cssclass for certain records in the ItemDataBound event (e.g. showing cancelled records in red font, etc.) A custom cssclass like statusPurchaseOrderCancelled would look like this -

.statusPurchaseOrderCancelled td 
{ 
    color: red;     
    font-style: italic; 
} 

The original skin cssclass for each row would be preserved such that if it is a GridRow, it would still show up with a white background and the new red and italic font and if it is a GridAltRow, it would show up with a gray background with the new red and italic font. So the statusPurchaseOrderCancelled cssclass seemed to be APPENDED to any existing ones.

Unfortunately the new Prometheus controls don't work the same way and instead the new cssclass REPLACES the original GridRow_TelerikCustomSkin or GridAltRow_TelerikCustomSkin so that the default background colour, row height and padding is lost. In order to preserve the existing styling functionality I would have to create two css classes for every record "status" with each one duplicating the properties of the original class except for font color. For example there would be a statusPurchaseOrderCancelled_GridRow and statusPurchaseOrderCancelled_GridAltRow and I would have to add case statements in the ItemDataBound event to determine which one to use.

Is this the intended functionality of the Prometheus controls?


Dimo
Telerik team
 answered on 21 Mar 2008
1 answer
83 views
I need some help in determining what the best method is for generating a pop-up, context-like menu for items in a grid would be.

I have a grid that is populated with files.  What I'd like to do is have an AJAX'ed pop-up when a user clicks on a row in the grid (or possibly even just on row hover - I haven't totally made up my mind yet).  Based on certain conditions of the row, the pop-up will display certain actions that the user can do (ie - "Delete File", "Move File". "Open File", etc).  So, whatever the ultimate solution is, the pop-up should be created on the fly via AJAX, rather than created before.

My first inclination is to use the ToolTip due to the fact that it seems like there is more control over this and I like the appearance of this more than the Menu.  The biggest question, however, is will using a ToolTip ultimately be more difficult to accomplish than using a Menu?

Also, I'm having a little trouble determining exactly how to wire all this together, so any pointers on required components/methods to use would be greatly appreciated.

Thanks in advance,
Ryan
Sebastian
Telerik team
 answered on 21 Mar 2008
1 answer
153 views
Hi everyone!

In my site, you can make some queries against a database. After the search you're redirected to a searchResults.aspx and a querystring parameter is passed along with the search criteria.

I really need to have the "special" caracters not encoded, and it's working great.

The problem is that if I'm redirected to a result page with the following querystring param...

http://localhost:1504/wwwroot/searchResults.aspx?q=OiqfgWbKF+Cj00+gMYgbZ89dQs8C3h2FAKVvKAvzbNQmzlu5Oikn/19VPTUpq8MFl0okjNo1pKOPsM4ynr/DQg==


... the paging on the results Grid doesn't work anymore because it changes the special characters (for example: the equal sign "=" is encoded to "%3d")
to:

http://localhost:1504/wwwroot/searchResults.aspx?q=OiqfgWbKF+Cj00+gMYgbZ89dQs8C3h2FAKVvKAvzbNQmzlu5Oikn%2f19VPTUpq8MFl0okjNo1pKOPsM4ynr%2fDQg%3d%3d

Does anyone know how can I avoid this behaviour? I mean, can the paging mechanism keep my original URL without encoding it?

Thanks!
Rosen
Telerik team
 answered on 21 Mar 2008
1 answer
170 views
i'm completing the process of moving existing grid's to prometheus and have found that the asp.net version of grid would set the class of each cell in the grid footer row as well as setting the class for the <tr> row tag.

in prometheus, this isn't happening.

  <tr class="GridFooter_Grid">
   <td class="GridFooter_Grid">&nbsp;</td>

in prometheus this comes out as:
  <tr class="GridFooter_Grid">
   <td>&nbsp;</td>

internet explorer then gets choosy about setting borders on the footer. my grid skin sets a border-top which no longer appears (this is after adding the style into the skin as "tr.GridFooter_Grid" to go with the existing "td.GridFooter_Grid" - before i added that, the footer wasnt being styled at all).

any ideas?

Pavel
Telerik team
 answered on 21 Mar 2008
1 answer
105 views
Is there a way to programatically activate the premium Rad Editor for MOSS 2007? I have more than a hundred websites and that's a lot of clicks.
Rumen
Telerik team
 answered on 21 Mar 2008
3 answers
171 views
Using Q3-2007 1218 + hotfix.
I am having difficulties getting a custom object collection to sort, or more correclty to sort when paging to Page 2+.  From reading the docs this should ok since I am using the OnNeedDataSource to wire up the source and am using the supported IList binding.  According to the docs if done this way all sorting etc should be handled.

The custom collection will sort when the header is changed to either ascending or descending order correctly, but when using the paging control to move beyond page1 the dataset does not page at all.  When the datasource is a datatable the problem does not occur.

is there something I am missing?

Thanks,
Jason



using System;
using System.Collections.Generic;
using System.Data;
using System.Web.UI;
using Telerik.Web.UI;

namespace Test
{
    public partial class Test : Page
    {
        public string _alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

        protected void Page_Load(object sender, EventArgs e)
        {
        }

        /// <summary>
        /// Handles the ItemDataBound1 event of the RadGrid control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="T:Telerik.WebControls.GridItemEventArgs"/> instance containing the event data.</param>
        protected void Grid_ItemDataBound(object sender, GridItemEventArgs e)
        {
        }

        /// <summary>
        /// Handles the PageIndexChanged event of the RadGrid control.
        /// </summary>
        /// <param name="source">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void Grid_PageIndexChanged(object source, GridPageChangedEventArgs e)
        {
        }

        public List<Thing> ObjectList()
        {
            List<Thing> list = new List<Thing>();
            foreach (char c in _alphabet)
            {
                string str = c.ToString();
                list.Add(new Thing(str));
            }
            return list;
        }

        public DataTable ObjectListAsDataTable()
        {
            DataTable dt = new DataTable();
            dt.Columns.Add("Name", typeof (string));
            List<Thing> list = ObjectList();
            foreach (Thing t in list)
            {
                DataRow row = dt.NewRow();
                row["Name"] = t.Name;
                dt.Rows.Add(row);
            }
            return dt;
        }

        protected void Grid_NeedDataSource3(object source, GridNeedDataSourceEventArgs e)
        {
            uxGrid3.DataSource = ObjectList();
        }

        protected void Grid_NeedDataSource4(object source, GridNeedDataSourceEventArgs e)
        {
            uxGrid4.DataSource = ObjectListAsDataTable();
        }
    }

   
    public class Thing
    {
        public Thing(string name)
        {
            _name = name;
        }

        private string _name;
        public string Name
        {get
        {
            return _name;
        }
            set { _name = value;}
           
        }
    }
}



============================== aspx




<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Test.aspx.cs" Inherits="Test" %>
<%@ Import namespace="Telerik.Web.UI"%>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<html>
<head><title>Test</title></head>
<body>
<form runat="server" id="form1">
<asp:ScriptManager runat="server" ID="uxScriptManager"></asp:ScriptManager>
    <div>
    <telerik:RadAjaxManager ID="uxRadAjaxManager" runat="server">
       <AjaxSettings>
           <telerik:AjaxSetting AjaxControlID="uxGrid3">
               <UpdatedControls>
                   <telerik:AjaxUpdatedControl ControlID="uxGrid3" LoadingPanelID="uxRadAjaxLoadingPanel"/>
               </UpdatedControls>
           </telerik:AjaxSetting>
           <telerik:AjaxSetting AjaxControlID="uxGrid4">
           <UpdatedControls>
                   <telerik:AjaxUpdatedControl ControlID="uxGrid4" LoadingPanelID="uxRadAjaxLoadingPanel"/>
             </UpdatedControls>
           </telerik:AjaxSetting>
       </AjaxSettings>
   </telerik:RadAjaxManager>
   <telerik:RadAjaxLoadingPanel ID="uxRadAjaxLoadingPanel" runat="server" Height="75px" Width="75px" Transparency="25">
       <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' style="border:0;" />
   </telerik:RadAjaxLoadingPanel>

    After sorting, I Don't Work on Page 2. I am using a IList
<telerik:RadGrid EnableViewState="true" ID="uxGrid3" runat="server"
            ShowFooter="True" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" CssClass="RadGrid"
            ShowGroupPanel="False" MasterTableView-DataKeyNames="Name" HorizontalAlign="NotSet" Skin="Telerik" OnNeedDataSource="Grid_NeedDataSource3">
            <MasterTableView
                PageSize="10" GridLines="Vertical" DataKeyNames="Name"
                CommandItemDisplay="Bottom" HorizontalAlign="NotSet" AllowFilteringByColumn="False">
              <HeaderStyle CssClass="GridHeader" ></HeaderStyle>
                <RowIndicatorColumn UniqueName="RowIndicator" Visible="False">
                    <HeaderStyle Width="10px" />
                </RowIndicatorColumn>
                <Columns>
                <telerik:GridBoundColumn DataField="Name" DataType="System.String" HeaderText="Test" SortExpression="Name" UniqueName="LocDesc"></telerik:GridBoundColumn>
                    <telerik:GridTemplateColumn UniqueName="Name"
                        SortExpression="Name" HeaderText="Site">
                        <ItemTemplate>
                            <%# Eval("Name") %>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    </Columns>
                    </MasterTableView>
                    </telerik:RadGrid>

After sorting I work Fine, I am a datatable client.
<telerik:RadGrid EnableViewState="true" ID="uxGrid4" runat="server"
            ShowFooter="True" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" CssClass="RadGrid"
            ShowGroupPanel="False" MasterTableView-DataKeyNames="Name" HorizontalAlign="NotSet" Skin="Telerik" OnNeedDataSource="Grid_NeedDataSource4">
            <MasterTableView
                PageSize="10" GridLines="Vertical" DataKeyNames="Name"
                CommandItemDisplay="Bottom" HorizontalAlign="NotSet" AllowFilteringByColumn="False">
              <HeaderStyle CssClass="GridHeader" ></HeaderStyle>
                <RowIndicatorColumn UniqueName="RowIndicator" Visible="False">
                    <HeaderStyle Width="10px" />
                </RowIndicatorColumn>
                <Columns>
                <telerik:GridBoundColumn DataField="Name" DataType="System.String" HeaderText="Test" SortExpression="Name" UniqueName="LocDesc"></telerik:GridBoundColumn>
                    <telerik:GridTemplateColumn UniqueName="Name"
                        SortExpression="Name" HeaderText="Site">
                        <ItemTemplate>
                            <%# Eval("Name") %>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    </Columns>
                    </MasterTableView>
                    </telerik:RadGrid>
    </div>
</form>
</body>
</html>


Ves
Telerik team
 answered on 21 Mar 2008
1 answer
181 views

Hello, I just noticed that my RadEditors have a problem generating correct HTML Content when I use a toolsfile.  If I write a simple text in the editor, center it, change the font to a large size and change the color and push a button which posts back, the content gets generated as this:

"<p align=\"center\"><span>Test</span></p>\r\n"

But if I remove the reference to the toolsfile, the HTML content gets correctly generated like this

"<p align=\"center\"><strong><span style=\"font-size: 48px; color: #ff6666\">Test</span></strong></p>\r\n"


Here is my declaration in a plain vanilla aspx file:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="teleriktest.aspx.cs" Inherits="teleriktest" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
<script runat="server"></script>
</head>
<body>
    <form id="form1" runat="server">
   
    <asp:ScriptManager ID="scriptManager" EnablePartialRendering="true" runat="server" />

         <telerik:radeditor runat="server" id="radEditor" height="400px" toolsfile="~/Telerik/Editor/Toolsfile.xml"
        editmodes="Design" autoresizeheight="true" skin="Web20">
            <CssFiles>
                <telerik:EditorCssFile Value="~/Skins/Web20/EditorContentArea.css" />
                <telerik:EditorCssFile Value="~/Skins/Web20/Editor.Web20.css" />
               
            </CssFiles>
       
        </telerik:radeditor>
        <asp:Button runat="server" ID="btnimage" OnClick="onclicked" Text="submit" />
    </form>
</body>
</html>

and the toolsfile is this:

<root>
 <tools>
  <tool name="FindAndReplace"/>
  <tool name="Print"/>
  <tool name="AjaxSpellCheck"/>
  <tool separator="true"/>
  <tool name="Cut"/>
  <tool name="Copy"/>
  <tool name="Paste"/>

  <tool separator="true"/>
  <tool name="Undo"/>
  <tool name="Redo"/>
  <tool separator="true"/>
  <tool name="ImageManager"/>
  <tool name="InsertTable"/>
  <tool separator="true"/>
  <tool name="LinkManager"/>
  <tool name="Unlink"/>
  <tool name="InsertSymbol"/>
  <tool name="ToggleTableBorder"/>
 </tools>
 <tools>
  <tool name="Bold"/>
  <tool name="Italic"/>
  <tool name="Underline"/>
  <tool separator="true"/>
  <tool name="JustifyLeft"/>
  <tool name="JustifyCenter"/>
  <tool name="JustifyRight"/>
  <tool name="JustifyFull"/>
  <tool separator="true"/>
  <tool name="InsertOrderedList"/>
  <tool name="InsertUnorderedList"/>
  <tool name="Outdent"/>
  <tool name="Indent"/>
  <tool name="FormatBlock"/>
  <tool separator="true"/>
 </tools>
 <tools>
  <tool name="FontName"/>
  <tool name="FontSize"/>
  <tool name="ForeColor"/>
  <tool name="BackColor"/>
  <tool name="ApplyClass"/>
  <tool name="InsertCustomLink"></tool>
 </tools>
 <links>
  <link name="telerik" href="http://www.telerik.com">
   <link name="Products" href="http://www.telerik.com/products" />
   <link name="Purchase" href="http://www.telerik.com/purchase" />
   <link name="Support" href="http://www.telerik.com/support" />
   <link name="Client.Net" href="http://www.telerik.com/clientnet" />
  </link>
  <link name="Microsoft">
   <link name="Main Site" href="http://www.microsoft.com" />
   <link name="MSDN Online" href="http://msdn.microsoft.com" />
   <link name="Windows Update" href="http://windowsupdate.microsoft.com" />
  </link>
  <link name="Search Engines">
   <link name="Google" href="http://www.google.com" />
   <link name="Yahoo" href="http://www.yahoo.com" />
   <link name="AltaVista" href="http://www.altavista.com" />
  </link>
 </links>
</root>

Upon postback in the "onclicked" event, if you look at the radeditor.content you will notice the incorrect HTML when the toolsfile is used.  The incorrect values are random (sometimes it returns the correct value, sometimes it doesn't) but everything is fine as soon as your remove the reference to the toolsfile.  Another thing I noticed is that the font sizes change from points to numbers 1-7.  What's causing these two problems?

Thanks,
Erin

Rumen
Telerik team
 answered on 21 Mar 2008
1 answer
169 views
Am I missing something here or doesn't RadEditor have a tool or dialog to set the content's html title ?  (<title></title>)

Remco
Rumen
Telerik team
 answered on 21 Mar 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?