Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
123 views
Hi I have a toolbar work just fine in an aspx page.  I want to do the same on a user control.  So I copied and pasted my radtoolbar to a user control but for some reason, the bar only stretches up to the last button.  I tried style="width:100%" and Width="100%", none worked.  I tried to read the Telerik CSS article but not very helpful in my situation.  Can someone please tell me why it's doing that? 

My line of code in user control:
<telerik:RadToolBar ID="RadToolBar1" runat="server" Skin="Vista" style="display:block; float:none" Width="100%">     
        <Items>      
             <telerik:RadToolBarButton runat="server" ImageUrl="~/Style/Images/alarm1.gif"  CommandName="cmd1" /> 
             <telerik:RadToolBarButton runat="server" ImageUrl="~/Style/Images/alarm2.gif"  CommandName="cmd2"/>   
        </Items>     
    </telerik:RadToolBar> 
Yana
Telerik team
 answered on 25 Nov 2010
1 answer
108 views
Hi All,

I have used telerik RadGrid control and my problem is that the paging items are overlapping when I use the screen resolutions 1024x768. Is there any way to wrap the RadGrid paging in 2 lines when the screen resolution is 1024x768?

Please find the attachment for the screen shot of the RadGrid Paging section. The overlapping is pointed with the arrow.

Please let me know if anyone know the solution for this problem.

Veli
Telerik team
 answered on 25 Nov 2010
4 answers
66 views
Hi, I am getting the following error in my code:

Microsoft JScript runtime error: Sys.InvalidOperationException: Could not find UpdatePanel with ID 'RadListView1_ctrl0_Panel1Panel'. If it is being updated dynamically then it must be inside another UpdatePanel.

Here is the exact code to reproduce it:(press any of the buttons on the pages causes the error)

<%@ Page Theme="TSC" Language="C#" AutoEventWireup="true" CodeFile="Test2.aspx.cs" Inherits="rq2DN_Test2" %>
  
   
    <!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 id="Head1" runat="server">
        <title>Test</title>
    </head>
    <body>
    <form id="form1" runat="server">
     
  
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
     
  
    <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" />
  
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" Runat="server" >
    </telerik:RadAjaxLoadingPanel>
  
    <asp:HiddenField ID="hfCatalogueId" runat="server" />
    <asp:HiddenField ID="hfTemporary" runat="server" />
  
    <asp:Panel ID="ListViewPanel" runat="server">
        <telerik:RadListView ID="RadListView1" runat="server" DataKeyNames="StockNumber" DataSourceID="objCatalogue"
            onitemcreated="RadListView1_ItemCreated">
            <LayoutTemplate>
                <div class="RadListView RadListView_Default">
                    <div id="itemPlaceholder" runat="server">
                    </div>
                </div>
            </LayoutTemplate>
            <ItemTemplate>
                <table>
                    <tr>
                        <td>
                            <asp:Label ID="Label2" runat="server" Text='<%# Bind("StockNumber") %>'></asp:Label>
                        </td>
                        <td rowspan="2" valign="top">
                            <asp:Panel ID="Panel1" runat="server">
                                <asp:Label ID="Label1" runat="server" Text='<%# Bind("StockNumber") %>'></asp:Label>
                                <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
                            </asp:Panel>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label3" runat="server" Text='<%# Bind("StockNumber") %>'></asp:Label>
                        </td>
                    </tr>
                </table>
            </ItemTemplate>
        </telerik:RadListView>
    </asp:Panel>
  
    <asp:ObjectDataSource ID="objCatalogue" runat="server" OldValuesParameterFormatString="original_{0}"
        SelectMethod="getCatalogueWithShoppingInfo" TypeName="com.srb.rq2.CatalogueDAO"
        EnablePaging="True" SelectCountMethod="getRowCount">
        <SelectParameters>
            <asp:ControlParameter ControlID="hfCatalogueId" PropertyName="Value" Name="catalogueId" Type="Int32"/>
            <asp:ControlParameter ControlID="hfTemporary" PropertyName="Value" Name="searchText" Type="String"/>
        </SelectParameters>
    </asp:ObjectDataSource>
  
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"></telerik:RadAjaxManager>
  
    <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
    </telerik:RadAjaxManagerProxy>
  
    </form>
</body>
</html>

and here is the 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.Threading;
using Telerik.Web.UI;
using com.srb.rq2;
using com.srb.core.util;
  
public partial class rq2DN_Test2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
  
  
        if (!IsPostBack)
        {
            hfCatalogueId.Value = "18";
            hfTemporary.Value = "";
        }
    }
  
    protected void Button1_Click(object sender, EventArgs e)
    {
        Thread.Sleep(2000);
    }
    protected void RadListView1_ItemCreated(object sender, Telerik.Web.UI.RadListViewItemEventArgs e)
    {
        if (e.Item is RadListViewDataItem)
        {
            RadListViewDataItem item = (RadListViewDataItem)e.Item;
            Button button = (Button)e.Item.FindControl("Button1");
            Panel panel = (Panel)e.Item.FindControl("Panel1");
  
  
  
            RadAjaxManagerProxy1.AjaxSettings.AddAjaxSetting(button, panel, RadAjaxLoadingPanel1);
        }
    }
}
Radoslav
Telerik team
 answered on 25 Nov 2010
1 answer
143 views
(Working in VS 2010, C# 4.0, RadControls for ASP.NET AJAX 2010.2.929.40, Sql Server 2008)
When I have the following radgrid :
<telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" AllowPaging="True"
        AllowSorting="True" GridLines="None" OnNeedDataSource="RadGrid1_NeedDataSource"
        AutoGenerateColumns="true" AutoGenerateEditColumn="true">
</telerik:RadGrid>

and this in my code behind :

protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
    LinqDataSource ds = new LinqDataSource();
    ds.Selecting += (sd, evt) => evt.Result = new UserManager().GetAllUsers();
    RadGrid1.DataSource = ds;
}
3 queries are generated :
SELECT COUNT(*) AS [value]
FROM [dbo].[Portal_Users] AS [t0]
  
SELECT [t1].[Id], [t1].[FirstName], [t1].[LastName], [t1].[Email], [t1].[LastLogin], [t1].[Created]
FROM (
    SELECT ROW_NUMBER() OVER (ORDER BY [t0].[Id], [t0].[FirstName], [t0].[LastName], [t0].[Email], [t0].[LastLogin], [t0].[Created]) AS [ROW_NUMBER], [t0].[Id], [t0].[FirstName], [t0].[LastName], [t0].[Email], [t0].[LastLogin], [t0].[Created]
    FROM [dbo].[Portal_Users] AS [t0]
    ) AS [t1]
WHERE [t1].[ROW_NUMBER] BETWEEN @p0 + 1 AND @p0 + @p1
ORDER BY [t1].[ROW_NUMBER]
  
SELECT [t0].[Id], [t0].[FirstName], [t0].[LastName], [t0].[Email], [t0].[LastLogin], [t0].[Created]
FROM [dbo].[Portal_Users] AS [t0]

The first 2 queries are as expected but the 3rd one queries the whole users table. As this gives horrible performance with a large dataset I started digging around. Then I discovered that this :

<telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" AllowPaging="True"
    AllowSorting="True" GridLines="None" DataSourceID="linqDS"
    AutoGenerateColumns="true" AutoGenerateEditColumn="true">
</telerik:RadGrid>
<asp:LinqDataSource ID="linqDS" OnSelecting="selecting" runat="server" />
and this in my codebehind :
protected void selecting(object sender, LinqDataSourceSelectEventArgs e)
{
    e.Result = new UserManager().GetAllUsers();
}
only gives the first 2 queries of the aforementioned 3 which solves my problem.

However, I don't know why in the first case I get 3 queries instead of 2. I would expect only the 2 queries in both cases. More worrying, I can imagine forgetting (me or my colleagues) that I must declare the LinqDataSource in the aspx page and not in my codebehind and so end up querying the whole table.
Veli
Telerik team
 answered on 25 Nov 2010
1 answer
49 views
Hi!

I am using a user control to edit the values within a grid using

.MasterTableView.EditFormSettings.UserControlName =



Within the user control there is a table that is used to format the display and I want this table to be 100% of the width of the grid.  Is there a way to access the width of the grid from within the user control so that it can be set in codebehind.

Tsvetina
Telerik team
 answered on 25 Nov 2010
4 answers
297 views
Hi,

I have a scenario where i have to display No. characters entered in a multi line text box on a text box.I have done the following code.
<telerik:RadTextBox ID="txt_Comment" runat="server" TextMode="MultiLine" Width="50%" Height="50px" onKeyUp="txt_CharacterCount.value=this.value.length" MaxLength="255">
</telerik:RadTextBox>
  
<telerik:RadTextBox ID="txt_CharacterCount" ClientIDMode="Static" runat="server" ReadOnly="true" Width="40px">
</telerik:RadTextBox>

Its not working for Rad Textbox. but the same is working for aspText box. How do i fix this issue. Pls guide me.
Jidesh
Jidesh Guptha
Top achievements
Rank 1
 answered on 25 Nov 2010
1 answer
61 views
I get the following error:

[IndexOutOfRangeException: Cell index out of range: 1]
   Telerik.Web.UI.Scheduler.Views.Week.Model.GetSlotByIndex(String index) +927
   Telerik.Web.UI.Scheduler.Views.SchedulerModel.ProcessPostBackCommand(SchedulerPostBackEvent postBack) +184
   Telerik.Web.UI.RadScheduler.ProcessPostBackCommand(SchedulerPostBackEvent postBack) +4698
   Telerik.Web.UI.RadScheduler.RaisePostBackEvent(String eventArgument) +108
   Telerik.Web.UI.RadScheduler.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +42
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +176
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563

This happens when the following criteria are met:

1.  I have a <appointmentTemplate>
2.  I have two events with the same start-time on the same calendar.

All dates are draggable/resizable on the calendar view (day) until the appointment items end up with the same start date.

Once this happens,  resizing the one to the right (second in my case)  causes a javascript error adn or the above error.  It can no longer be resized or dragged.  I can double click the event to edit it,  and it will then move around the calendar as much as I want,  until I end up with the same start time again.  And then the error occurs again.

I can provide a test project if need be, but I would prefer you test.

Telerik : 2010.2.713.40
Veronica
Telerik team
 answered on 25 Nov 2010
3 answers
119 views
We're using the RadDateTimePicker to insert dates and times. When a user selects a date in the calendar, the user stille has to select the time in time in the input box to edit it.

Is there a way to automatically place the cursor at the possition of the time text when a date is selected so he/she can immediatly start typing a new time.

If possible, can you also add a mask to the time text?
Tsvetina
Telerik team
 answered on 25 Nov 2010
2 answers
164 views
Hi,

This is an interesting issue and I cannot seem to find a programmatic solution to it.

I have two grids (left and right), either side of a splitterbar (these components consume the entire browser window). The left grid items display a tooltip on rollover and the tooltip is displayed "MiddleRight", relative to the left grid item. This causes the tooltip to appear on the otherside of the splitterbar over the top of the second grid, which is correct.  When I move the splitter to the right and reduce the amount of visible grid on the right, the tool tip displays "MiddleLeft" which is correct as there is not enough room on the right to display the tooltip.

However ... The exact same browser on the occasional different machine always displays the tooltip on the "MiddleLeft". It's like the control is unable to calculate the available space on the right, or simply cannot retrieve that figure. Is there any way I can influence the calulcation for tooltip positioning? If it is unable to reference or calculate the required figure, perhaps I can get the width of the visible space on the right and set it manually?

This is an urgent issue for me as I'm nearing project end, I would appreciate any help you can provide at this time.

I thank you in advance,



Andrew Buxton.

Andrew Buxton
Top achievements
Rank 1
 answered on 25 Nov 2010
1 answer
70 views
Hi all,

Is there a control that keep track of things on client- and serverside.
So when a user is leaving that he gets prompted.

I have found an idea for default .NET controls on http://www.4guysfromrolla.com/webtech/100604-1.shtml but to keep track for all the rad controls then I will be busy to change the script.

So before I do that, Ill ask.

Regards,

Marco
Sebastian
Telerik team
 answered on 25 Nov 2010
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?