Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
100 views
this one took me some time to figure out, but I am at a loss to understand what is happening.
I created the following class:
    /// <summary> 
    /// A data control to reference a method in the current page instance. 
    /// </summary> 
    public class PageMethodDataSource:ObjectDataSource 
    { 
        public PageMethodDataSource() 
        { 
            ObjectCreating += OnObjectCreating; 
        } 
        protected override void OnInit(System.EventArgs e) 
        { 
            base.OnInit(e); 
            TypeName = Page.GetType().BaseType.ToString(); 
        } 
 
        void OnObjectCreating(object sender, ObjectDataSourceEventArgs e) 
        { 
            e.ObjectInstance = Page; 
        } 
    } 

The purpose of this is to use methods in the page instance as data source for controls (in this case a RadGrid). This caused the web resource to stop loading, causing datepickers, timepickers etc to stop working (and the dreaded "Sys is not defined" and "Telerik" is not defined" javascript errors).
Can anyone spot what I may have violated to cause this behaviour?


Øyvind Skaar
Top achievements
Rank 1
 answered on 18 Feb 2010
1 answer
157 views
Just created a style and after I downloaded the style, I noticed the background sprite that I had upload was being referenced back to the telerik website.

 div.RadMenu_internalweb .rmItem .rmLink:hover .rmText { 
 
    background-image: url('http://stylebuilder.telerik.com//ImageHandler.ashx?mode=get&Skin=internalweb&Control=Menu&Suite=aspnet-ajax&file=internalwebsprite.png'); 
 
    background-position: 100% -26px; 
 
    padding-left: 0px; 
 
    height: 25px; 
 
    margin-top: 0px; 
 
    padding-right: 28px; 
 
    background-color: transparent; 
 
} 

Should it not reference the local copy of the image?
Alex Gyoshev
Telerik team
 answered on 18 Feb 2010
2 answers
326 views
Hello,
I'm really having too much troubles using RadListView. Now I'll try to briefly explain.
The project that I started to work on is a very specialized search engine using a complex data layer that can use one or more databases simultaneously. So I thought that was a good idea to use a RadListView with RadDataPager for a flexible paging.
Initially I was using the ASP.Net Controls version 2009.3.1103. Soon I realized that something was not going on as I expected: in fact, starting with no Data Source specified, after a postback initiated by another control, the data was not shown and the "no data template" was always presented. After a long search, finally I found a post in this forum that pointed me to this known bug.
Well, I did update the controls and the bug disappeared. But, unfortunately, now I'm stuck on the programmatic creation of the control. In fact I discovered that in design-time it is not possible to configure the RadListView via "smart tag option" since a valid data source is not specified.
A search engine cannot perform any query in a first page load, so I need to do all the data source job (dinamic query creation in response of the user parameter input) in a "if Page.IsPostBack then [...] End If" code block.
That's why I passed to the programmatic creation of the control.
Now, and this is the main problem to solve, it seems that there is no way to avoid this error message:
The RadListView control does not have an item placeholder specified.

For more clarity, this is the code-snippet in which I "try" to create the RadListView:

Private rlvResults As RadListView 
 
Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init 
 
        Me.BuildListView() 
 
 
End Sub 
 
Protected Sub BuildListView() 
 
        Me.rlvResults = New RadListView() 
        With Me.rlvResults 
            .AllowCustomPaging = False 
            .AllowCustomSorting = False 
            .AlternatingItemTemplate = New GooWayTemplates.AlternatingItemTemplate() 
            .EditItemTemplate = New GooWayTemplates.EditItemTemplate() 
            .InsertItemTemplate = New GooWayTemplates.EditItemTemplate() 
            .ItemTemplate = New GooWayTemplates.ItemTemplate() 
            .EmptyDataTemplate = New GooWayTemplates.EmptyDataTemplate() 
            .LayoutTemplate = New GooWayTemplates.LayoutTemplate() 
            .SelectedItemTemplate = New GooWayTemplates.ItemTemplate() 
            .ItemPlaceholderID = "itemPlaceholder" 
            AddHandler .NeedDataSource, AddressOf rlvResults_NeedDataSource 
            .AllowPaging = True 
        End With 
 
        Me.placeHListView.Controls.Add(Me.rlvResults) 
 
 End Sub 

Where am I wrong?
This is a fundamental step in a big project and I'm really confused :-)

Thanks in advance.
Giovanni Pulvirenti
Top achievements
Rank 1
 answered on 18 Feb 2010
1 answer
210 views
Hi, there's a problem with radtextbox.
I've 3 radtextblock with enabled property set false at design time in my .aspx page, a raddatepicker with a customvalidator and a button to start the validation.
When validation occours (on click button) the enabled property of the 3 textbox turn to true. Here an example:
<%@ Page Title="" Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="WebApplication1.Default2" %> 
 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head id="Head1" runat="server"> 
    <title>Titolo</title> 
    <telerik:RadStyleSheetManager ID="RadStyleSheetManagerMain" runat="server" /> 
</head> 
<body id="bodyBackgroundImage" runat="server"> 
    <center> 
        <form id="form1" runat="server"> 
        <telerik:RadScriptManager ID="RadScriptManagerMain" runat="server"> 
            <Scripts> 
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" /> 
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" /> 
            </Scripts> 
        </telerik:RadScriptManager> 
        <telerik:RadAjaxManager ID="RadAjaxManagerMain" runat="server" /> 
        <table class="bodytable" width="950" cellpadding="0" cellspacing="0" border="0"> 
            <!-- HEADER --> 
            <tr> 
                <td> 
                    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="headertable"> 
                        <tr> 
                            <td> 
                                <!--height="88"--> 
                                <table width="100%" class="headertable" border="0" cellpadding="0" cellspacing="0"> 
                                    <tr> 
                                        <td align="left"> 
                                        </td> 
                                         
                                    </tr> 
                                    <tr> 
                                         
                                    </tr> 
                                </table> 
                            </td> 
                        </tr> 
                        <tr> 
                            <td> 
                                    <table id="TableMenu" width="100%" cellspacing="0" cellpadding="0" border="0" class="maintitletable" 
                                        runat="server"> 
                                        <tr style="height: 33px;"> 
                                            <td width="20%"> 
                                            </td> 
                                            <td width="10%"> 
                                            </td> 
                                            <td align="right"> 
                                                <!-- HOME --> 
                                                <a id="A1" href="~/Default.aspx" runat="server">Home</a> 
                                            </td> 
                                        </tr> 
                                        <tr> 
                                            <td> 
                                                &nbsp; 
                                            </td> 
                                        </tr> 
                                    </table> 
                            </td> 
                        </tr> 
                    </table> 
                </td> 
            </tr> 
            <!-- BODY --> 
            <tr> 
                <td class="bodytable"> 
                    <table border="0" cellpadding="0" cellspacing="0"> 
                        <tr> 
                            <td id="leftColumn"> 
                                <div class="rightmain"> 
                                </div> 
                                <!-- Menu condiviso--> 
                                 
                            </td> 
                            <td> 
                                &nbsp; 
                            </td> 
                            <td id="centercolumn"> 
                                <div class="centermain"> 
<table> 
    <tr> 
        <td> 
            Field 1 
        </td> 
        <td colspan="2"> 
            <telerik:RadTextBox ID="RadTextBoxId1" runat="server" EmptyMessage="Text 1" 
                Width="280px" Enabled="False" > 
            </telerik:RadTextBox> 
             
        </td> 
    </tr> 
    <tr> 
        <td> 
            Field 2 
        </td> 
        <td colspan="2"> 
            <telerik:RadTextBox ID="RadTextBoxId2" runat="server" EmptyMessage="Text 2" 
                Width="280px" Enabled="False"> 
            </telerik:RadTextBox> 
        </td> 
    </tr> 
    <tr> 
        <td  > 
            Field 3 
        </td> 
        <td colspan="2"> 
            <telerik:RadTextBox ID="RadTextBoxId3" runat="server" EmptyMessage="Text 3" 
                Width="280px" Enabled="False"> 
            </telerik:RadTextBox> 
        </td> 
    </tr> 
    <tr> 
        <td style="width:280px;" > 
            Date (*) 
        </td> 
        <td colspan="2"> 
            <telerik:RadDatePicker ID="RadDatePickerDataInserimento" runat="server" Calendar-CultureInfo="Italian (Italy)" 
                    Calendar-RangeMaxDate="06/06/2079 00:00:00" Calendar-RangeMinDate="01/01/1900 00:00:00" 
                    MaxDate="06/06/2079 00:00:00" MinDate="01/01/1900 00:00:00" Width="280px" > 
                    <DateInput DisplayDateFormat="dd/MM/yyyy" DateFormat="dd/MM/yyyy" MaxDate="06/06/2079 00:00:00" MinDate="01/01/1900 00:00:00" /> 
                </telerik:RadDatePicker> 
            <asp:CustomValidator ID="CustomValidatorDataInserimento" runat="server" 
                    ValidationGroup="ButtonConferma" ErrorMessage="Error" 
                    OnServerValidate="CustomValidatorDatInserimento_ServerValidate"> 
                </asp:CustomValidator> 
        </td> 
    </tr> 
    
       <tr> 
        <td   /> 
        <td colspan="2"> 
            <asp:Button ID="ButtonConferma" runat="server" Text="Click" OnClick="ButtonConferma_Click" CausesValidation="true" ValidationGroup="ButtonConferma" /> 
        </td> 
    </tr> 
</table> 
                                </div> 
                            </td> 
                        </tr> 
                    </table> 
                </td> 
            </tr> 
            <!-- footer --> 
            <tr> 
                <td> 
                    <div> 
                        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="footertable"> 
                            <tr> 
                                <td class="footertable"> 
                                    &nbsp 
                                </td> 
                            </tr> 
                            <tr> 
                                <td> 
                                    <hr /> 
                                </td> 
                            </tr> 
                            <tr> 
                                <td class="footertable"> 
                                    <strong>Footer</strong> 
                                </td> 
                            </tr> 
                        </table> 
                    </div> 
                </td> 
            </tr> 
        </table> 
        </form> 
    </center> 
</body> 
</html> 
 
using System; 
using System.Web.UI; 
using System.Web.UI.WebControls; 
 
namespace WebApplication1 
{ 
    public partial class Default2 : Page 
    { 
        protected void Page_Load(object sender, EventArgs e) 
        { 
        } 
 
        protected void ButtonConferma_Click(object sender, EventArgs e) 
        { 
        } 
 
        protected void CustomValidatorDatInserimento_ServerValidate(object source, ServerValidateEventArgs args) 
        { 
            args.IsValid = false; 
        } 
    } 
} 

Any ideas?
Alessio
Top achievements
Rank 1
 answered on 18 Feb 2010
2 answers
178 views
I'm adding items to a RadComboBox server-side like so:

            foreach (ValueMapping mapping in ValueMappings) 
            { 
                RadComboBoxItem comboItem = new RadComboBoxItem(mapping.DisplayValue, mapping.DataValue); 
                this.Items.Add(comboItem); 
            } 

Then later I'm selecting the item I want to be initially selected in the combobox on the server-side too:

                RadComboBoxItem item = 
                    this.FindItemByValue(value); 
 
                if (item != null) 
                { 
                    item.Selected = true; 
                } 

I have registered a client-side event listener to the "OnClientSelectedIndexChanged" event. However, this event seems to be firing as soon as the page loads as if the user has selected a value using the combobox. Is this expected behaviour, something broken or me doing something wrong? I only want to be notified when the value has been changed by the user from the value selected server-side - how would I achieve this?

I am using version 2008.3.1314.20

Thanks,
James

Addendum: I've just realised that the client event only seems to be fired once when the page loads and never again. That is, the event is not being fired when the user selects a new item. Help!




Yana
Telerik team
 answered on 18 Feb 2010
1 answer
93 views
Hi,

I have a MasterPage where I have declared a RadAjaxManager

Into other pages I am using the RadAjaxManagerProxy .
In a form I have RadAjaxManagerProxy which update an <asp:Panel> which contains a FromView which contains a RadEditor.
After a "postback" the RadEditor loose its behavior.

I have search on you forrum, I have read your documentation but it doesn't work.

Best regards.
Pavel
Telerik team
 answered on 18 Feb 2010
3 answers
159 views
If you create an imagemap area in IE, it is transparent. If you do it in Safari, Firefox or Chrome it is not. Can you please fix this in the next version? Is it possible for me to fix this with a custom javascript?

Testet on demo http://demos.telerik.com/aspnet-ajax/editor/examples/default/defaultcs.aspx with Firefox 3.6



Rumen
Telerik team
 answered on 18 Feb 2010
1 answer
174 views
I updated to the latest version of RadControls for ASP.NET AJAX (2008.2 1001 - Oct 1, 2008) and now the header (HeaderTemplate) row will no longer show for all my RadComboBox controls when I do some type of data binding in the HeaderTemplate. If there is no data binding it works. Something broke in this last version and the basic "<%" usage is no longer supported.
 
Not working HeaderTemplate:
                            <HeaderTemplate> 
                                <table cellpadding="0" cellspacing="0" border="0">  
                                    <tr> 
                                        <td style="width:90px; vertical-align:top; text-align:left;"><%= ((SessionState.Language == Natr.Classes.Language.Spanish) ? "No. de Stock" : "Stock Number")%></td>  
                                        <td style="width:320px; vertical-align:top; text-align:left;"><%= ((SessionState.Language == Natr.Classes.Language.Spanish) ? "Descripción" : "Product Name")%></td>  
                                        <td style="width:50px; vertical-align:top; text-align:left;"><%= ((SessionState.Language == Natr.Classes.Language.Spanish) ? "Costo" : "Price")%></td>  
                                    </tr> 
                                </table> 
                            </HeaderTemplate>

 

 

 

 

Working HeaderTemplate:
                            <HeaderTemplate>    
                                <table cellpadding="0" cellspacing="0" border="0">     
                                    <tr>    
                                        <td style="width:90px; vertical-align:top; text-align:left;">Stock Number</td>     
                                        <td style="width:320px; vertical-align:top; text-align:left;">Product Name</td>     
                                        <td style="width:50px; vertical-align:top; text-align:left;">Price</td>     
                                    </tr>    
                                </table>    
                            </HeaderTemplate>    
 

 

Kalina
Telerik team
 answered on 18 Feb 2010
2 answers
94 views
I'm working with Telerik v. 2009.2.701.35

I have some buttons on a form rendering inside a table.  If I create them as <input type="button> they do not decorate at all.  If I change it to a <button> tag, it seems to pick up the css from the skin's style sheet and apply the correct background, but the right side border is missing.  This right side border is supposed to be the background of the <a> tag, based on what I've seen in the demo.

I tried using javascript to style the form in real time, and it works, but again it skips the buttons.  It styles the other form elements just fine. The example I followed to do this is here: http://www.telerik.com/support/kb/aspnet-ajax/formdecorator/decorate-dynamically-added-controls-by-using-radformdecorator.aspx

Here is an example of the HTML on my page in which buttons are not being decorated.
<table class="string-group-list"><tbody id="TestGroupedInputTable"><tr> 
            <th>One Header</th> 
            <th>Two Header</th> 
            <th>Three Header</th> 
            <td><button class="sgl-button" onclick="sglAddNew('TestGroupedInput', 3);" name="TestGroupedInputAddNew" type="button" id="TestGroupedInputAddNew">Add New</button></td> 
        </tr> 
        <tr id="TestGroupedInputRow0"> 
            <td><input type="text" class="sgl-input rfdDecorated" value="a" id="TestGroupedInputInput0_0" name="TestGroupedInputInput0_0"></td> 
            <td><input type="text" class="sgl-input rfdDecorated" value="s" id="TestGroupedInputInput0_1" name="TestGroupedInputInput0_1"></td> 
            <td><input type="text" class="sgl-input rfdDecorated" value="2" id="TestGroupedInputInput0_2" name="TestGroupedInputInput0_2"></td> 
            <td><button class="sgl-button" onclick="sglDelRow('TestGroupedInput','TestGroupedInputRow0');" name="TestGroupedInputDelete0" type="button" id="TestGroupedInputDelete0">Delete</button></td> 
        </tr> 
        </tbody></table> 

I don't think my CSS is causing this issue because like I said, the <a> tag wrappers are not being created at all.

Thanks for looking,
-Chris
Georgi Tunev
Telerik team
 answered on 18 Feb 2010
2 answers
158 views
Hi,
I need to set the DataNavigateUrlFormatString of the GridHyperLinkColumn to some thing like this.
http://xyz.com?id=rownumber.

Here rownumber is the number of the row in which the linkbutton will be there.

Eg: for a linkbutton in the third row,

the url should be like http://xyz.com?id=3.

How can this be achieved in the ascx file?( or even via code?)
vishesh kumar
Top achievements
Rank 1
 answered on 18 Feb 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?