Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
239 views
Hi Telerik,

    I am having 2 raddatepickers. When I am done with setting the date of the first date picker, the second datepicker must display a date 14 days lesser than the selected date of raddatepicker1. Also, I must be able to edit the RaddatePicker2

    I would like to do this in javascript.

    Thanks for your help.

Regards,
Raj
Radoslav
Telerik team
 answered on 18 May 2011
2 answers
223 views
Hi.
I have a problem with my radmenu 2009.
when i set a DefaultGroupSetting for my menu, for exmaple :

<

 

telerik:RadMenu ID="FarsiMenu" Runat="server" DataFieldParentID="MenuParentID" dir="rtl"

 

 

DataNavigateUrlField="AdminValue" DataSourceID="sdsMenuBuilder"

 

 

 

DataTextField="MenuText" DataValueField="Value" DataFieldID="MenuID" Width="650px"

 

 

 

onprerender="FarsiMenu_PreRender"

 

 

 

style="position:absolute;right:40px;" EnableOverlay="False" AutoScrollMinimumHeight="100" EnableAutoScroll="True">

 

 

 

<DefaultGroupSettings Height="200px" RepeatColumns="1" />

 

 

 

</telerik:RadMenu>

 


When my submenu items height is less thatn 200px, the submenu window is 200px with some empty space.
how can i solbe this problem?
i want when my items heght is less than 200px, the submenu window height be fit to these items.

Thank u all.
Armin
Top achievements
Rank 1
 answered on 18 May 2011
1 answer
42 views
Hi,

In case, we use the Empty value option, RadChart has supported for Area, Bar, Pie, Buble, Point, Line, SpLine, StackedArea, StackedArea100 chart-type, except for StackedBar and StackedBar100. It's work-as-design of RadChart, isn't it?

Thanks / Phong Dang.
Yavor
Telerik team
 answered on 18 May 2011
3 answers
207 views
Hi,

We are using Teleric Rad Editor for contnet areas in SHarePoint 2007.
 
While editing Rad Editpr HTML content, if the HTML markup is not properly formed, the editor doesnt give any messages for malformed HTML markup.
 
We are planning to use a custom button there to validate the HTML and specify the errors if any. This button internally will call a web service or use some tool on the server, pass the HTML content to it and shows the errors/messages if any returned from the service/tool.

Is there any add-on or something Telerik provides for Rad Editor for HTML markup validation?

If not, can you please suggest us some tool/web service which we can use with Rad Editor? For some security reasons we do not want to use validator.w3c.org web service. Please suggest us some other web service or tool which suites rad editor more. Also it would be great help if you can tell us what steps we can follow to achieve this customization.

Regards,
Mahavir
Stanimir
Telerik team
 answered on 18 May 2011
1 answer
131 views

 

When I drag and drop a selected row from ASP.NET Ajax (Telerik.web.ui) Radgrid (inside a usercontrol) to a RadTreeview node (inside a usercontrol),

I am able to capture the Datakeyitem of the Radgrid on the RowDrop serverside event of the Radgrid, like

   Private Sub grdEquipments_RowDrop(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridDragDropEventArgs) Handles grdEquipments.RowDrop

        Dim dataItem As GridDataItem = e.DraggedItems(0)

        Dim s As String = dataItem.OwnerTableView().Items(dataItem.ItemIndex).GetDataKeyValue("ID")

    End Sub

But I am not able to get the refrence to the Treeview Node  on which the Item is being dropped.
Do you have any sample projects where you have this functinality.

 please note that these two controls are in separate usercontrols.

 

Thanks
Madhu Rao

Shinu
Top achievements
Rank 2
 answered on 18 May 2011
3 answers
127 views
Hi sir,
context menu not disappearing after select an option from the menu, also context menu is not working in firefox, the sample code is shown below, please help me
.aspx page
<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<!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>
<telerik:RadScriptBlock>
    <script language="javascript" type="text/javascript">
        function ClientContextMenuItemClicking(sender, eventArgs)
        {
            var node = eventArgs.get_node();   
            var item = eventArgs.get_menuItem();
                               
            if (item.get_text() == "Add Category")
            {       
                document.getElementById("uxAddCategoryTextBox").value="";
                document.getElementById("uxAddCategorypanel").style.display="";
                document.getElementById("uxEditCategorypanel").style.display="none";
                document.getElementById("uxDeleteCategorypanel").style.display="none";
            }
            else if (item.get_text() == "Edit Category")
            {       
                document.getElementById("uxEditCategoryTextBox").value=node.get_text();
                document.getElementById("uxAddCategorypanel").style.display="none";
                document.getElementById("uxEditCategorypanel").style.display="";
                document.getElementById("uxDeleteCategorypanel").style.display="none";
            }
            else if (item.get_text() == "Delete Category")
            {       
                document.getElementById("uxAddCategorypanel").style.display="none";
                document.getElementById("uxEditCategorypanel").style.display="none";
                document.getElementById("uxDeleteCategorypanel").style.display="";
            }
        }
    </script>
    </telerik:RadScriptBlock>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>

<table width="820px" cellpadding="0" cellspacing="0">
    <tr>
        <td colspan="2" style="padding-top:10px;">
            <h3 class="ms-standardheader ms-WPTitle">        
                <asp:Label ID="uxCaption2" Text="Additional Custom Community Categories" runat="server"></asp:Label>&nbsp;
            </h3>
        </td>
    </tr>
    <tr>
        <td colspan="2" style="padding-top:10px;">
            <asp:Label ID="uxPageDescription2" Text="Custom Categories to be added to your seller's booths in addition to the default collection" runat="server"
             Font-Bold="False" Font-Names="Verdana" Font-Size="8pt" Height="15px"></asp:Label>
        </td>
    </tr>
    <tr>
        <td style="padding-top:10px;">
            <Telerik:RadTreeView ID="uxCustomCategories" BorderWidth="1px" ShowLineImages="false" runat="server"
                Height="212px"  Font-Bold="true" Font-Size="9" Font-Names="Verdana"  OnClientContextMenuItemClicking="ClientContextMenuItemClicking">
              
                <ContextMenus>
                    <Telerik:RadTreeViewContextMenu runat="server" ID="HelpDeskMenu" ClickToOpen="True"
                        Skin="Telerik">
                        <Items>
                            <Telerik:RadMenuItem Text="Add Category" Value="Add">
                            </Telerik:RadMenuItem>
                            <Telerik:RadMenuItem Text="Edit Category" Value="Edit">
                            </Telerik:RadMenuItem>
                            <Telerik:RadMenuItem Text="Delete Category" Value="Delete">
                            </Telerik:RadMenuItem>
                        </Items>
                    </Telerik:RadTreeViewContextMenu>
                </ContextMenus>
                <Nodes>
                </Nodes>
            </Telerik:RadTreeView>
        </td>
        <td style="padding-top:10px; padding-left:10px;" valign="top">
            <asp:Panel ID="uxAddCategorypanel" runat="server" BorderWidth="1" Height="150px" Width="450px">
                <table Width='100%' cellpadding='0' cellspacing='0' style='padding-left:0px;padding-right:0px;padding-top:0px;padding-bottom:0px; border:0; font-family:Verdana; font-size:11px;'>
                    <tr>
                        <td style="padding-left:5px;" colspan="2">
                            <h3 class="ms-standardheader ms-WPTitle">        
                                Add Category
                            </h3>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:5px; padding-top:10px; width:100px;">
                            Name
                        </td>
                        <td style="padding-top:10px;">
                            <asp:TextBox ID="uxAddCategoryTextBox" runat="server" Width="240px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td style="width:100px; padding-top:10px;">
                        </td>
                        <td style="padding-top:10px;">
                            <asp:Button  Text="Submit" runat="server" ID="uxAddCategorySubmit"/>&nbsp;
                            <asp:Button Text="Cancel" runat="server" ID="uxAddCategoryCancel" />
                        </td>
                    </tr>
                </table>
            </asp:Panel>
            
            <asp:Panel ID="uxEditCategoryPanel" runat="server" BorderWidth="1" Height="150px" Width="450px">
                <table Width='100%' cellpadding='0' cellspacing='0' style='padding-left:0px;padding-right:0px;padding-top:0px;padding-bottom:0px; border:0; font-family:Verdana; font-size:11px;'>
                    <tr>
                        <td style="padding-left:5px;" colspan="2">
                            <h3 class="ms-standardheader ms-WPTitle">        
                                Edit Category
                            </h3>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:5px; padding-top:10px; width:100px;">
                            Name
                        </td>
                        <td style="padding-top:10px;">
                            <asp:TextBox ID="uxEditCategoryTextbox" runat="server" Width="240px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td style="width:100px; padding-top:10px;">
                        </td>
                        <td style="padding-top:10px;">
                            <asp:Button  Text="Sumbit" runat="server" ID="uxEditCategorySubmit"/>&nbsp;
                            <asp:Button Text="Cancel" runat="server" ID="uxEditCategoryCancel" />
                        </td>
                    </tr>
                </table>
            </asp:Panel>
            
            <asp:Panel ID="uxDeleteCategoryPanel" runat="server" BorderWidth="1" Height="150px" Width="450px" >
                <table Width='100%' cellpadding='0' cellspacing='0' style='padding-left:0px;padding-right:0px;padding-top:0px;padding-bottom:0px; border:0; font-family:Verdana; font-size:11px;'>
                    <tr>
                        <td style="padding-left:5px;" colspan="2">
                            <h3 class="ms-standardheader ms-WPTitle">        
                                Delete Category
                            </h3>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" style="padding-left:30px; padding-top:10px;">
                            Are you sure,you want to delete the category Buisness & Industrial ?
                        </td>
                    </tr>
                    <tr>
                        <td style="width:20px; padding-top:10px;">
                        </td>
                        <td style="padding-top:10px;">
                            <asp:Button Text="OK" ID="uxDeleteCategoryOK" runat="server" Width="50px"/>&nbsp;
                            <asp:Button Text="Cancel" ID="uxDeleteCateGoryCancel" runat="server" />
                        </td>
                    </tr>
                </table>
            </asp:Panel>
        </td>
    </tr>
</table>
    </div>
    </form>
</body>
</html>


CS code


using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Telerik.Web.UI;

public partial class _Default : System.Web.UI.Page
{
    protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);

        AddCategoryNodes();

    }

    protected void AddCategoryNodes()
    {
        DataTable dtCustomCategories = new DataTable();
        dtCustomCategories.Columns.Add("CategoryName");
        dtCustomCategories.Rows.Add("Category1");
        dtCustomCategories.Rows.Add("Category2");
        dtCustomCategories.Rows.Add("Category3");
        dtCustomCategories.Rows.Add("Category4");

        for (int i = 0; i < dtCustomCategories.Rows.Count; i++)
        {
            RadTreeNode categories = new RadTreeNode();
            categories.Text = dtCustomCategories.Rows[i][0].ToString().Trim();
            categories.Value = dtCustomCategories.Rows[i][0].ToString().Trim();
            categories.ExpandMode = Telerik.Web.UI.TreeNodeExpandMode.ClientSide;
            uxCustomCategories.Nodes.Add(categories);
        }
    }
}

Veronica
Telerik team
 answered on 18 May 2011
1 answer
168 views
is there any way to have treeview node contain multiple line of text?
Shinu
Top achievements
Rank 2
 answered on 18 May 2011
1 answer
93 views
I am getting the following cast error,
Cannot cast 'RadPanelBar1.FindItemByValue("QuickSearch").FindControl("txtFirstName")' (which has an actual type of 'Telerik.Web.UI.RadTextBox') to 'System.Web.UI.WebControls.TextBox'

 

protected void imSearch_Click(object sender, EventArgs e)

 

 

{

 

 

TextBox txtFirstName = (TextBox)RadPanelBar1.FindItemByValue("QuickSearch").FindControl("txtFirstName");

 

 

 

}

 

<telerik:RadPanelBar runat="server" ID="RadPanelBar1" Width="100%" ExpandMode="SingleExpandedItem" Skin="Windows7" >

 

 

<Items>

 

 

<telerik:RadPanelItem Text="Quick Search" Expanded="True" runat="server" >

 

 

<Items>

 

 

<telerik:RadPanelItem runat="server" Value="QuickSearch" BorderColor="Red" >

 

 

<ItemTemplate>

 

 

 

<asp:Label ID="lblSearch" style="text-align:center" runat="server" Text="First Name:" Font-Bold="True" />

 

 

 

<telerik:RadTextBox ID="txtFirstName" runat="server" EmptyMessage="Search First Name" Skin="WebBlue" Width="130px"/>

 

Can anybody tell me what I'm missing.

Shinu
Top achievements
Rank 2
 answered on 18 May 2011
1 answer
120 views
Greetings,
A while ago I quickly threw together a quick tool to manage our admin users and provide our support staff with the ability to reset users passwords.  It uses a RadGrid, bound to a collection of objects, and there is a GridTemplateColumn that holds an EditItemTemplate that has a textbox to collect the new password.  It used to work, and when we found the textbox in the ItemUpdated event handler, the textbox.text would be new password, and life would be good.  No longer though, now the text is always empty.  We recently updated our telerik controls to 2011.1.413.40, although this could have stopped working before then (it's a rarely used function apparently).  Below is the RadGrid definition and ItemUpdated Event handler.  If anyone has any ideas, that would rock.

<telerik:RadGrid ID="rgUsers" BorderColor="#cccccc" runat="server" AutoGenerateColumns="false"
     OnItemCommand="ItemCommand" OnUpdateCommand="ItemUpdated" AllowAutomaticUpdates="false">
     <MasterTableView DataKeyNames="adminuser_id" Width="100%" EnableViewState="false"
         EditMode="PopUp">
         <Columns>
             <telerik:GridBoundColumn DataField="email" HeaderText="Email Address" HeaderStyle-Width="25%"
                 ItemStyle-VerticalAlign="Top" ReadOnly="true" />
             <telerik:GridTemplateColumn HeaderText="Password" Visible="false" UniqueName="colPassword">
                 <EditItemTemplate>
                     <asp:TextBox ID="tbPassword" runat="server" MaxLength="30" />
                 </EditItemTemplate>
             </telerik:GridTemplateColumn>
             <telerik:GridEditCommandColumn ButtonType="LinkButton" ItemStyle-CssClass="gridaction" EditText="Reset Password" HeaderStyle-Width="15%" />
         </Columns>
     </MasterTableView>
     <ClientSettings>
         <Selecting AllowRowSelect="False" EnableDragToSelectRows="false" />
         <Scrolling AllowScroll="true" UseStaticHeaders="true" />
     </ClientSettings>
 </telerik:RadGrid>

protected void ItemUpdated( object sender, GridCommandEventArgs args )
{
    AdminUser user = args.Item.DataItem as AdminUser;
 
    TextBox tbPassword = args.Item.FindControl( "tbPassword" ) as TextBox;
 
    SqlExecutor.Execute( delegate( SqlConnection connection )
    {
        user.password = tbPassword.Text;
        user.Persist( connection );
    }, logger );
}

Thank you in advance if you have any ideas on this,
Francis
Shinu
Top achievements
Rank 2
 answered on 18 May 2011
4 answers
254 views
Hi Team,

I have to bind datas to radgrid where the number of columns are more which leads to very slow performance. Below is the code snippet that am using.
string connString = ConfigurationManager.ConnectionStrings["AnswergenDB"].ConnectionString;
            SqlConnection sconn = new SqlConnection(connString);
            sconn.Open();
            SqlCommand sqlcmd = new SqlCommand("sp_Pivot", sconn);
            sqlcmd.CommandType = CommandType.StoredProcedure;            
            sqlcmd.Parameters.Add("@pivot", "column84");
            sqlcmd.Parameters.Add("@table", "Level_Zero");
            sqlcmd.Parameters.Add("@expr1", "SUM(Level_Zero.Column35)");
            sqlcmd.Parameters.Add("@expr2", "SUM(Level_Zero.Column52)");
            sqlcmd.Parameters.Add("@expr3", "SUM(Level_Zero.Column33)");
            sqlcmd.Parameters.Add("@exprcolumn1", "Payroll");
            sqlcmd.Parameters.Add("@exprcolumn2", "Total Billed");
            sqlcmd.Parameters.Add("@exprcolumn3", "Op Income");
            SqlDataReader pvtdr = sqlcmd.ExecuteReader(CommandBehavior.CloseConnection);
            DataTable pvtdt = new DataTable();
            pvtdt.Load(pvtdr);
            string pvtqry = string.Empty;
            foreach (DataRow row in pvtdt.Rows)
            {
                for (int i = 0; i < pvtdt.Columns.Count-1; i++)
                {
                    pvtqry += row[i].ToString();
                }                
            }
            pvtqry = pvtqry.Substring(0, pvtqry.Length - 1);
            pvtqry = "select column2, " + pvtqry + " from level_zero group by column2 order by column2";
            sconn.Open();
            sqlcmd = new SqlCommand(pvtqry, sconn);
            sqlcmd.CommandType = CommandType.Text;
            pvtdr = sqlcmd.ExecuteReader(CommandBehavior.CloseConnection);
            DataTable pvttable = new DataTable();
            pvttable.Load(pvtdr);
            PivotGrid.DataSource = pvttable;
            PivotGrid.DataBind();

 

 

The above query returns 1024 columns with 400 rows which takes about 6 to 7 minutes to bind the datas to radgrid. The query is getting executed in 8 secs, but binding it to the grid takes time. Since the query building is dynamic, there are possiblities to have more columns binded. Can some one suggest me in binding the records faster.

Thanks in advance.
Sangeetha

 

 

BRK
Top achievements
Rank 1
 answered on 18 May 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?