Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
153 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
85 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
117 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
250 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
2 answers
105 views
Hi everyone,
Currently I have around 450 rad comboboxes inside radgrid on web page. The number of comboboxes may increase to any number in future. Issue is the loading of the web page which is taking sometime for current situation. So it will be a big problem in near future when number of comboboxes increases.
Please help me in this with code or any configuration to be done to handle the performance issue.
Thanks in advance.
Anirudh
anirud
Top achievements
Rank 1
 answered on 18 May 2011
3 answers
163 views
When I set "#ffff99" to SelectedItemStyle-BackColor,
after the grid was selected color is "#ffff99", but select the second records, the first record of the color is still "#ffff99", but I use red or other colors to work.

1.see example.png
2.I use radcontrol for asp.net q1 2010, 2010.1.415.35

aspx:
 
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="WebApplication1._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">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
        <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" AutoGenerateColumns="true"
            PagerStyle-AlwaysVisible="true" GridLines="None" PageSize="8" SelectedItemStyle-BackColor="#ffff99"
            Skin="Web20">
            <PagerStyle Mode="NextPrevAndNumeric" PageButtonCount="8" />
            <ClientSettings>
                <Selecting AllowRowSelect="True" />
            </ClientSettings>
        </telerik:RadGrid>
    </div>
    </form>
</body>
</html>
 
vb:
Imports System.Data
Imports System.Data.SqlClient
 
Partial Public Class _Default
    Inherits System.Web.UI.Page
 
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Try
            Dim cn As New SqlConnection("Data Source =(local);Initial Catalog = test;User id = sa;Password = test@123")
            Dim da As New SqlDataAdapter("select * from t", cn)
            Dim ds As New DataSet
            da.Fill(ds, "dt")
 
            RadGrid1.DataSource = ds.Tables(0)
        Catch ex As Exception
 
        End Try
    End Sub
 
End Class


Arthur Wu
Top achievements
Rank 1
 answered on 18 May 2011
2 answers
104 views

This is the problem I'm having:
I have

 

 

<

 

 

telerik:RadSplitter

 

 

 

 

    <telerik:RadPane

 

 

 

 

        <telerik:RadTabStrip

The Tabstrip is connected to MultiPage.
One of the pages has RadTreeVew with its content being populated dynamically.

When I expand the tree nodes to the point the their height exceeds the height of the panel the scroll bar apprears but when I scroll it the tabs scroll alone with it.

I believe the tabs should stay in their position.

I believe the scroll bar belongs to the panel on which the Tree is located but I believe that the TreeView's scroll bar should be displayed.



 

 

<%

 

@ Control Language="C#" AutoEventWireup="true" CodeFile="ContentPanel.ascx.cs" Inherits="ContentPanel" %>

 

 

<%

 

 

@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>

 

 

 

 

 

 

 

<

 

 

 

telerik:RadSplitter ID="RadSplitter1" Runat="server" Width="100%"

 

 

 

 

 

 

 

 

 

 

 

Skin="Vista">

 

 

 

 

 

 

 

 

 

 

 

<telerik:RadPane ID="RadPane1" Runat="server" width="30%" Scrolling="Both">

 

 

 

 

 

 

 

 

 

 

 

<telerik:RadTabStrip ID="TOCTab" runat="server" SelectedIndex="3" MultiPageID="MultiPageProjects"

 

 

 

 

 

 

 

 

 

 

 

Skin="Web20" PerTabScrolling="True" ScrollChildren="True">

 

 

 

 

 

 

 

 

 

 

 

<tabs>

 

 

 

 

 

 

 

 

 

 

 

<telerik:RadTab runat="server" Text="TOC" ScrollChildren="true">

 

 

 

 

 

 

 

 

 

 

 

</telerik:RadTab>

 

 

 

 

 

 

 

 

 

 

 

<telerik:RadTab runat="server" Text="Figures">

 

 

 

 

 

 

 

 

 

 

 

</telerik:RadTab>

 

 

 

 

 

 

 

 

 

 

 

<telerik:RadTab runat="server" Text="Tables">

 

 

 

 

 

 

 

 

 

 

 

</telerik:RadTab>

 

 

 

 

 

 

 

 

 

 

 

<telerik:RadTab runat="server" Text="Search" Selected="True">

 

 

 

 

 

 

 

 

 

 

 

</telerik:RadTab>

 

 

 

 

 

 

 

 

 

 

 

</tabs>

 

 

 

 

 

 

 

 

 

 

 

</telerik:RadTabStrip>

 

 

 

 

 

 

 

 

 

 

 

<telerik:RadMultiPage ID="MultiPageProjects" runat="server" SelectedIndex="3"

 

 

 

 

 

CssClass="multiPage" ScrollBars="Auto">

 

 

 

 

 

 

 

 

 

 

 

<telerik:RadPageView ID="PageViewTOC" runat="server" Width="100%"

 

 

 

 

 

Selected="True">

 

 

 

 

 

 

 

 

 

 

 

<telerik:RadTreeView ID="TOCTree" Runat="server" Skin="Hay">

 

 

 

 

 

 

 

 

 

 

 

</telerik:RadTreeView>

 

 

 

 

 

 

 

 

 

 

 

</telerik:RadPageView>

 

 

 

 

 

 

 

 

 

 

 

<telerik:RadPageView ID="PageViewExchanges" runat="server"

 

 

 

 

 

CssClass="pageViewEducation" Width="100%" Height="100%">

 

 

 

 

 

 

 

 

 

 

 

</telerik:RadPageView>

 

 

 

 

 

 

 

 

 

 

 

<telerik:RadPageView ID="RadPageView3" runat="server">

 

 

 

 

 

 

 

 

 

 

 

</telerik:RadPageView>

 

 

 

 

 

 

 

 

 

 

 

<telerik:RadPageView ID="RadPageView4" runat="server" Width="100%"

 

 

 

 

 

 

 

 

 

 

 

Height="100%">

 

 

 

 

 

 

 

 

 

 

 

</telerik:RadPageView>

 

 

 

 

 

 

 

 

 

 

 

</telerik:RadMultiPage>

 

 

</

 

 

 

telerik:RadPane>

 

 

 

 

 

 

 

 

 

 

 

<telerik:RadSplitBar ID="RadSplitBar1" runat="server">

 

 

 

 

 

 

 

 

 

 

 

</telerik:RadSplitBar>

 

 

 

 

 

 

 

 

 

 

 

<telerik:RadPane ID="RadPane2" Runat="server">

 

 

 

 

 

 

 

 

second pane

 

 

 

 

</telerik:RadPane>

 

 

 

 

 

 

 

 

 

 

 

</telerik:RadSplitter>

 

 

 

 

 

 


K.
Top achievements
Rank 1
 answered on 18 May 2011
0 answers
69 views
I have a databound RadMenu, bound to a datatable that comes from SQL Server.  For rows that should be separators, I check a "ItemType" property on DataBound, and set the RadMenuItem accordingly:

Protected Sub Menu_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadMenuEventArgs) Handles Menu.ItemDataBound
       Dim menuItem = DirectCast(e.Item.DataItem, dsAdmin.MenuItemRow)
       If menuItem.MenuItemType = "Separator" Then
           e.Item.IsSeparator = True
       End If
   End Sub

So what I'm trying to achieve is to be able to put in a horizontal separator in between items.  The problem is that this renders perfectly fine in Firefox and Safari, but IE 8 does not render the horizontal separators. 

I've tried adding and removing Text to the RadMenuItem designated as the separator, tried adjusting its Height, among other things, and can't seem to get it to render.  I'm using Web20 skin, no special CSS applied to any telerik controls. 

Any thoughts on the matter? 
Anthony
Top achievements
Rank 1
 asked on 17 May 2011
3 answers
168 views
I have been experimenting with images in the backgrounds of the chart axis labels

  1. They seem to be rendered larger then they actually are. (see attached screen capture showing the image in a table outside the chart and as an axis label background image set to align mode) 
  2. Can I control the displayed size of the aligned background image without recreating the image and saving a smaller version of it? I do need to also display the text in the axis label as well as seen in the attached image.  
  3. I know I can limit the size of the image if I use the stretch option and limit the size of the textbox but I don't want the image to interfere with the space used by the text and overlap. I used the stretch option on the 3rd instance of the logo in the attached file and it works for me in that case because I am not using any text on that label - the icon is sufficient for that chart. 

To clarify what you see in the attached image is:
Icon instance 1 and 2 came from the same page - but instance 1 is not part of the chart but instance 2 is part of the chart and the chart one seems bigger and I don't know why. Icon instance 3 is scaled down by using the stretch option of the label background and limiting the size of the label text area. 

The following is the code I'm currently using to insert the image in the chart.

ChartAxisItem xItem = RadChartRiding.PlotArea.XAxis[i];
 
xItem.TextBlock.Text = string.Format("{2}{0}\n{1}", r["firstName"], r["lastName"], (i == d.Rows.Count - 1 ? " - LEADER -\n" : ""));
xItem.TextBlock.Appearance.FillStyle.FillType = Telerik.Charting.Styles.FillType.Image;
xItem.TextBlock.Appearance.FillStyle.FillSettings.BackgroundImage = string.Format("images/elections/{0}Icon.png", barCode[i]);
xItem.TextBlock.Appearance.Dimensions.AutoSize = false;
 
xItem.TextBlock.Appearance.FillStyle.FillSettings.ImageDrawMode = Telerik.Charting.Styles.ImageDrawMode.Align;
xItem.TextBlock.Appearance.FillStyle.FillSettings.ImageAlign = Telerik.Charting.Styles.ImageAlignModes.TopLeft;
xItem.TextBlock.Appearance.Position.AlignedPosition = Telerik.Charting.Styles.AlignedPositions.TopRight;
xItem.TextBlock.Appearance.Dimensions.Height = 75;
xItem.TextBlock.Appearance.Dimensions.Width = 330;
xItem.TextBlock.Appearance.Dimensions.Paddings.Top = (i == d.Rows.Count - 1 ? 10 : 20);


 
Gimmik
Top achievements
Rank 1
 answered on 17 May 2011
1 answer
317 views
Hi, i have a radtoolbar, with 5 button.

when i click on a button i want to change teh background color of the clicked button.

my button:
A=red-> response.redirect(a.aspx)
B=blue->response.redirect(b.aspx)
C=green
D=black
E=purple

if i click on A button, A button must become red
if i click on B button, B button must become blue.

The toolbar is in a MasterPage, when i click on a button i do a response.redirect to a specific page linked to the button.

if i click on A button i redirect to A.aspx page, and in masterpage the A button on radtoolber must become red.

how i can do it ?
Kate
Telerik team
 answered on 17 May 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?