Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
137 views
Hi,

I want to use seperator at my combobox. But i want to see this seperator like menu's one. Is it possible? If yes how?
Princy
Top achievements
Rank 2
 answered on 01 Apr 2011
4 answers
178 views
Hello,
I would like to use a RadToolTip to add, modify items from a RadGrid.
It works well but when I add to the radtooltip a RequiredFieldValidator and ValidationSummary, the radtooltip doesn't work.

Could you help me ?

Here are the javascript an HTML:

<

 

telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

 

 

    <script type="text/javascript">

 

        function

 

CloseToolTip()

 

 

        {

 

 

            var tooltip = Telerik.Web.UI.RadToolTip.getCurrent();

 

 

 

            if(tooltip)

 

 

                { tooltip.hide(); };

 

        }

        function

 

OkToolTip()

 

 

        {

 

            CloseToolTip();

 

            ajaxManager.ajaxRequest(

"RT_LOT");

 

 

        }

    </

 

script>

 

</

 

telerik:RadCodeBlock>

 


<

 

telerik:RadToolTip ID="RT_LOT" runat="server" HideEvent="FromCode" Modal="True"

 

 

Position="Center" RelativeTo="BrowserWindow" ShowCallout="False">

 

 

<br />

 

 

    <table style="border-color: #0000FF; border-width: 10px; width: 100%; text-align: left;">

 

 

        <tr>

 

 

            <td><asp:Label ID="RT_LOT_LibLabel" runat="server"></asp:Label></td>
            <td><asp:RequiredFieldValidator ID="RT_LOT_RFV" runat="server" Display="Dynamic" ErrorMessage="Erreur"

 

 

ControlToValidate="RT_LOT_Lib" SetFocusOnError="True">*</asp:RequiredFieldValidator></td>

 

 

            <td><asp:TextBox ID="RT_LOT_Lib" runat="server" Width="336px"></asp:TextBox></td>

 

 

        </tr>

 

 

        <tr>

 

 

            <td colspan="3"><asp:ValidationSummary ID="RT_LOT_ValidationSummary" DisplayMode="BulletList" runat="server" /></td>

 

 

        </tr>

 

 

        <tr>

 

 

            <td><input id="RT_LOT_Ok" runat="server" type="button" value="Ok" onclick="OkToolTip();"

 

 

                style="width: 80px; color: #008000; font-weight: bold;" /></td>

 

 

            <td></td>

 

 

            <td><input id="RT_LOT_AnnBt" type="button" value="Annuler" onclick="CloseToolTip();"

 

 

style="width: 80px; color: #FF0000; font-weight: bold;" /></td>

 

 

        </tr>

 

 

    </table>

 

 

</telerik:RadToolTip>

 


Here is the code behind:
// Ajaxifying

protected

 

void Page_Load(object sender, EventArgs e)

 

 

{

 

 

    try

 

    {
        

radAjaxManager.AjaxRequest += new RadAjaxControl.AjaxRequestDelegate(manager_AjaxRequest);

 

        radAjaxManager.AjaxSettings.AddAjaxSetting(toolBar, RT_LOT);
    }

 

    catch (Exception err)

 

 

    {...

}

 

 

}


// open the RadToolTip from a toolbar:

protected

 

void toolBar_ButtonClick(object sender, RadToolBarEventArgs e)

 

 

{

 

 

    try

 

    {

 

        switch (e.Item.Value)

 

 

        {

 

 

            case @"CRT":
                ...

 

                RT_LOT.Show();

 

                break;

 

        }

    }

 

    catch (Exception err)

 

 

        {...

}

 

}
// get the data from the RadToolTip

protected

 

void manager_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)

 

 

{

 

 

    try

 

    {

 

        if (e.Argument == @"RT_LOT")

 

 

        {

 ... };

 

 

    }

 

 

    catch (Exception err)

 

 

        { ...

}

 

 

}


Many thanks...
Bernard
Bernard
Top achievements
Rank 1
 answered on 01 Apr 2011
1 answer
102 views
Is there a way to hide the expand link on a radgrid if no data falls underneath the main grid.  People consitently pick on every expand link just to see no data associated with it, can this be changed to be hidden.  And is ther a way to change the picture of the expand link to a plus sign instead of an arrow.
Princy
Top achievements
Rank 2
 answered on 01 Apr 2011
6 answers
989 views
Is it possible to pass parameters other than row index, max rows, filter, and sort to the Web Method?  I can't seem to find any examples.  I have a RadGrid successfully using a Web Service to do client-side data binding, but I need it to pass in some extra parameters.

I'm thinking that I *might* be able to do this by passing the other parameters as part of the filter parameters and then handling that in the Web Service, but that just seems like a hack. :-)
Nicholas
Top achievements
Rank 1
 answered on 01 Apr 2011
8 answers
700 views
Hi there,

                I export the radgrid to excel. Using the following code...
 <ExportSettings FileName="Program_Accounts" OpenInNewWindow="true"  IgnorePaging="true"></ExportSettings>

RadGrid1.ExportSettings.ExportOnlyData = true;
RadGrid1.ExportSettings.IgnorePaging = true;
RadGrid1.ExportSettings.OpenInNewWindow = true;

This RadGrid1.ExportSettings.IgnorePaging = true is not exporting all the pages to excel. i can't figure out why?. While binding the grid all the records gets binded.

Is there any scenario only first page alone will be exported even after specifing IgnorePaging = true on design and codebehind

Please help me why after giving IgnorePaging = true its not exporting all the records in the grid.


Thanks!.
Daniel
Telerik team
 answered on 31 Mar 2011
4 answers
145 views
I have several grids that need to be exported to pdf and all would have the same style, color, font, etc...I just don't  want to define style in each grid's itemcreated event...
Is there any way that I could centrally define it which would then be available to all exports???

Thanks
Daniel
Telerik team
 answered on 31 Mar 2011
1 answer
138 views
Hi, i am facing really weird problem.  When i am trying to preview page from Visual Studio 2010 in debug/ or just view in browser mode
 i am not able  to fire events of expand/collapse button, cursor also is not changing when  moved over button.  Double clik on node- works fine. However when i deploy page o server and run it from server  in the same browser,  +/- bnutton works, as well as cursor is changing. 
Here is simple code of the page 
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="treeviewnew.aspx.cs" Inherits="treeviewnew" %>
  
  
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
  
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<head></head>
<body class="BODY">
 <form runat="server" id="mainForm" method="post">
 <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
 </telerik:RadScriptManager>
   
 <script type="text/javascript">
     //<!--
     function onClientContextMenuShowing(sender, args) {
         var treeNode = args.get_node();
         treeNode.set_selected(true);
         //enable/disable menu items
         setMenuItemsState(args.get_menu().get_items(), treeNode);
     }
  
     function onClientContextMenuItemClicking(sender, args) {
         var menuItem = args.get_menuItem();
         var treeNode = args.get_node();
         menuItem.get_menu().hide();
  
         switch (menuItem.get_value()) {
             case "New":
                 break;
             case "Edit":
                 treeNode.startEdit();
                 break;
               
                case "Delete":
                 var result = confirm("Are you sure you want to delete the item: " + treeNode.get_text());
                 args.set_cancel(!result);
                 break;
         }
     }
  
     //this method disables the appropriate context menu items
     function setMenuItemsState(menuItems, treeNode) {
         for (var i = 0; i < menuItems.get_count(); i++) {
             var menuItem = menuItems.getItem(i);
             switch (menuItem.get_value()) {
                 case "New":
                     formatMenuItem(menuItem, treeNode, 'New ');
                     break;
                 case "Edit":
                     formatMenuItem(menuItem, treeNode, 'Edit "{0}"');
                     break;
                 case "Delete":
                     formatMenuItem(menuItem, treeNode, 'Delete "{0}"');
                     break;
                 
             }
         }
     }
  
     //formats the Text of the menu item
     function formatMenuItem(menuItem, treeNode, formatString) {
         var nodeValue = treeNode.get_value();
         if (nodeValue && nodeValue.indexOf("_Private_") == 0) {
             menuItem.set_enabled(false);
         }
         else {
             menuItem.set_enabled(true);
         }
         var newText = String.format(formatString, extractTitleWithoutMails(treeNode));
         menuItem.set_text(newText);
     }
  
     //checks if the text contains (digit)
     function hasNodeMails(treeNode) {
         return treeNode.get_text().match(/\([\d]+\)/ig);
     }
  
     //removes the brackets with the numbers,e.g. Inbox (30)
     function extractTitleWithoutMails(treeNode) {
         return treeNode.get_text().replace(/\s*\([\d]+\)\s*/ig, "");
     }
     //-->
 </script>
  
  
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
 </telerik:RadAjaxLoadingPanel>
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
 <telerik:RadTreeView ID="RadTreeView1" runat="server"   
 OnContextMenuItemClick="RadTreeView1_ContextMenuItemClick" OnClientContextMenuItemClicking="onClientContextMenuItemClicking"
 OnClientContextMenuShowing="onClientContextMenuShowing" 
         OnNodeEdit="RadTreeView1_NodeEdit" DataFieldID="id" 
         DataFieldParentID="parentid" DataSourceID="SqlDataSource1" 
         DataTextField="description" DataValueField="value" MaxDataBindDepth="4" Skin="WebBlue"
         >
<ContextMenus>
 <telerik:RadTreeViewContextMenu ID="MainContextMenu" runat="server">
 <Items>
 <telerik:RadMenuItem Value="New" Text="New ..." >
 </telerik:RadMenuItem>
 <telerik:RadMenuItem Value="Edit" Text="Edit ..." >
 </telerik:RadMenuItem>
  <telerik:RadMenuItem Value="Delete" Text="Delete.." >
 </telerik:RadMenuItem>
 </Items>
 <CollapseAnimation Type="none" />
 </telerik:RadTreeViewContextMenu>
 <telerik:RadTreeViewContextMenu ID="EmptyFolderContextMenu" runat="server">
 <Items>
 <telerik:RadMenuItem Value="New" Text="New ">
 </telerik:RadMenuItem>
  
  
 </Items>
 <CollapseAnimation Type="none" />
 </telerik:RadTreeViewContextMenu>
 </ContextMenus>
  
 </telerik:RadTreeView>
 </telerik:RadAjaxPanel>
  
 <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
     ConnectionString="<%$ ConnectionStrings:ECMApp3 %>" SelectCommand="select distinct  isnull(state,'')+'state' as id, null as parentid, isnull(state,'no state')  as description, isnull(state,'')  as value from projects
  
union all 
select  cast(p.id as varchar(10))+'project' as id, isnull(p.state, '')+'state' as parentid , p.description, cast(p.id  as varchar(10)) from projects p 
  
union all 
select cast(l.id as varchar(10))+'location', cast(p.id as varchar(10))+'project', l.name ,cast( l.id as varchar(10)) from  locations l inner join projects p 
on l.project_id=p.id
  
union all
select cast (b.id as varchar(10))+'building', cast(l.id as varchar(10))+'location', b.building_name, cast(b.id as varchar(10)) from  buildings b inner join locations l on
 b.location_id=l.id 
 --where l.id <2"></asp:SqlDataSource>
  
  
 </form>
</body>
</html>
  
  
  
  
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
  
using Telerik.Web.UI;
using System.Text.RegularExpressions;
  
  
public partial class treeviewnew : System.Web.UI.Page
{
   
  
 protected const string unreadPattern = @"\(\d+\)";
 protected void Page_Load(object sender, EventArgs e)
 {
     SqlDataSource1.DataBind();
     SqlDataSource1.Select(DataSourceSelectArguments.Empty);
     //RadTreeView2.DataBind();
 }
 protected void RadTreeView1_ContextMenuItemClick(object sender, RadTreeViewContextMenuEventArgs e)
 {
     RadTreeNode clickedNode = e.Node;
  
     switch (e.MenuItem.Value)
     {
         case "New":
             RadTreeNode clonedNode = clickedNode.Clone();
             clonedNode.Text = string.Format("Copy of {0}", clickedNode.Text);
             clickedNode.InsertAfter(clonedNode);
             //set node's value so we can find it in startNodeInEditMode
             clonedNode.Value = clonedNode.GetFullPath("/");
             clonedNode.Selected = true;
             startNodeInEditMode(clonedNode.Value);
             break;
          
         case "Delete":
             clickedNode.Remove();
             break;
     }
 }
  
 private void startNodeInEditMode(string nodeValue)
 {
     //find the node by its Value and edit it when page loads
     string js = "Sys.Application.add_load(editNode); function editNode(){ ";
     js += "var tree = $find(\"" + RadTreeView1.ClientID + "\");";
     js += "var node = tree.findNodeByValue('" + nodeValue + "');";
     js += "if (node) node.startEdit();";
     js += "Sys.Application.remove_load(editNode);};";
  
     RadScriptManager.RegisterStartupScript(Page, Page.GetType(), "nodeEdit", js, true);
 }
  
 protected void RadTreeView1_NodeEdit(object sender, RadTreeNodeEditEventArgs e)
 {
     e.Node.Text = e.Text;
 }
  
 //this method is used by Mark All as Read and Empty this folder 
 protected void emptyFolder(RadTreeNode node, bool removeChildNodes)
 {
     node.Font.Bold = false;
     node.Text = Regex.Replace(node.Text, unreadPattern, "");
  
     if (removeChildNodes)
     {
         //Empty this folder is clicked
         for (int i = node.Nodes.Count - 1; i >= 0; i--)
         {
             node.Nodes.RemoveAt(i);
         }
     }
     else
     {
         //Mark all as read is clicked
         foreach (RadTreeNode child in node.Nodes)
         {
             emptyFolder(child, removeChildNodes);
         }
     }
 
}

 

Helen
Telerik team
 answered on 31 Mar 2011
1 answer
153 views
Hey guys, long time no post.   I have a RadBinaryImage and everything is working fine, but I want waht I render in HTML to work with AddThis - a plug for sharing to facebook.  Actually, FB does not recognize the image at all on the page.... I'm wondering what I can do to make this render the appropriate meta tags (I assume) do FB will pick this item image up and display it!  

I think it has something to do with the relative path in SRC= or meta tags... actually - any help you can give to help me generate the meta tag description and source to make it show up in FB as a share.

Hopefully you have come across this before, normally I would figure this out but I have to meet the love of my life and I have to drive an hour to see her. 

thanks - huge Fan!
Marty

 <telerik:RadBinaryImage runat="server" ID="RadBinaryImage1"
                        DataValue='<%#Eval("ImageContent") %>'
                        AutoAdjustImageControlSize="false"
                        ResizeMode="Fit"
                        CssClass="imageContainerLarge"/>

HTML

 <div>
                        <img id="ctl00_DefaultContent_ImageViewer1_RadListView1_ctrl1_RadBinaryImage1" class="imageContainerLarge" src="../../../Telerik.Web.UI.WebResource.axd?imgid=5480abe542ac4e1e86b7733c8b2d586b&amp;type=rbi" />
                    </div>
Veli
Telerik team
 answered on 31 Mar 2011
2 answers
232 views
Hello

Hope you can help, I have a RadGrid defined as follows:

<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
</telerik:RadScriptManager>
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
        function RowDblClick(sender, eventArgs) {
            sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());
        }
    </script>
</telerik:RadCodeBlock>
<telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" 
        AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" 
        GridLines="None"  Skin="Vista" 
        onneeddatasource="RadGrid1_NeedDataSource" ondeletecommand="RadGrid1_DeleteCommand" 
        oninsertcommand="RadGrid1_InsertCommand" 
    onupdatecommand="RadGrid1_UpdateCommand" 
    onitemdatabound="RadGrid1_ItemDataBound" >
      
    <ClientSettings EnableRowHoverStyle="true" AllowKeyboardNavigation="false">
        <Selecting AllowRowSelect="True" />
        <Scrolling AllowScroll="True" UseStaticHeaders="True" />
        <ClientEvents OnRowDblClick="RowDblClick" />
        <KeyboardNavigationSettings EnableKeyboardShortcuts="true" AllowActiveRowCycle="true" />
    </ClientSettings>
    <MasterTableView EditMode="PopUp"  CommandItemDisplay="Bottom">         
        <Columns>
            <telerik:GridBoundColumn  UniqueName="Id" visible="false" ReadOnly="true"
                    DataField="Id" HeaderText="Id" >
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="Nombre" AutoPostBackOnFilter="True" 
                    CurrentFilterFunction="Contains" DataField="Nombre" HeaderText="Nombre" 
                    ShowFilterIcon="False">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn  UniqueName="Precio" AutoPostBackOnFilter="True" 
                    CurrentFilterFunction="Contains" DataField="Precio" HeaderText="Precio" 
                    ShowFilterIcon="False">
            </telerik:GridBoundColumn>
            <telerik:GridButtonColumn ConfirmText="Borrar este método?" 
                ConfirmTitle="Borrar" ButtonType="ImageButton" CommandName="Delete" 
                Text="Borrar" UniqueName="DeleteColumn" ConfirmDialogType="RadWindow">
                <HeaderStyle Width="30px" />
                <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />
            </telerik:GridButtonColumn>
            <telerik:GridEditCommandColumn ButtonType="ImageButton">
                <HeaderStyle Width="30px" />
                <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />
            </telerik:GridEditCommandColumn>
        </Columns>
      
        <CommandItemSettings AddNewRecordText="Añadir nuevo registro" RefreshText="Refrescar" />
        <EditFormSettings EditColumn-CancelText="Cancelar" EditColumn-Display="True" EditFormType="AutoGenerated">
            <FormTableItemStyle Wrap="False"></FormTableItemStyle>
            <FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle>
            <FormMainTableStyle GridLines="None" CellSpacing="5" CellPadding="3" BackColor="White" Width="100%" />
            <FormTableStyle CellSpacing="0" CellPadding="2" Height="60px" BackColor="White" />
            <EditColumn ButtonType="ImageButton"
                InsertText="Guardar" UpdateText="Guardar cambios"
                UniqueName="EditCommandColumn1" CancelText="Cancelar edición" >
            </EditColumn>
            <FormTableButtonRowStyle HorizontalAlign="Right" CssClass="EditFormButtonRow"></FormTableButtonRowStyle>
            <PopUpSettings Modal="True"></PopUpSettings>
        </EditFormSettings>
    </MasterTableView>
</telerik:RadGrid>

When I start to edit a row I have a problem, if I try to hit the Enter key, it seems that the focus goes to the delete ImageButton and ask me about confirmation before delete an item.

I have no problems to visualize any data or if I update it with the mouse, with click on the update button. Only when I hit the Enter key while the focus is on editable field.

This behavior not care about the value of the param AllowKeyboardNavigation

Hope you can replicate my problem.
Thank you
Carlos
Top achievements
Rank 1
 answered on 31 Mar 2011
1 answer
115 views
Hi,

I have a RadListBox where i am binding the datasource like RadListBox.DataSource = GetItems() and call databind on Page_Load. i also had the radfilter by setting the FilterContinerID to the RadListBox's ID. But, when I browse the page and click on add expression icon it makes a request but filter doesnt appear on the screen. so, I had a FieldEditor like below:

<FieldEditors>
    <telerik:RadFilterTextFieldEditor DataType="System.String" DisplayName="Text" FieldName="ShipName" />
</FieldEditors>

Now the filter shows up. But when i type something and click apply it dont see any change in the RadListBox. Please let me know if I am missing something.

Thanks in advance!!!
Daniel
Telerik team
 answered on 31 Mar 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?