Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
274 views
I need to add history points in search pages of my application. The search is executed inside a RadAjaxPanel and displays the results in a RadGrid. When the user selects and item in the RadGrid they are sent to another page. When the user clicks the browser back button the RadGrid is empty. So I need to add a history point to re-populate the RadGrid.

Below is some code from a very simple test app that is similar to the architecture of my application. The RadScriptManager is in a master page and with a textbox and button in a user control.

When I place the textbox and button inside an UpdatePanel the Ajax EnableHistory works but the same code does not work with RadAjaxPanel. I have also tried using RadAjaxManager which also does not work. History points are added successfully using RadAjaxPanel and the ScriptManagerProxy.Navigate fires, but the textbox is not updated.

UpdatePanel has an Update method to force an update when its UpdateMode is Conditional but RadAjaxPanel does not have an Update method which is probably why UpdatePanel works.

What can I do to get the EnableHistory feature to work with RadAjaxPanel?

Thanks
Nate

Main.Master

<%

@ Master Language="VB" AutoEventWireup="false" CodeBehind="Main.master.vb" Inherits="AjaxEnableHistory.Main" %>

 

 

<!

 

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></title>

 

 

 

<asp:ContentPlaceHolder ID="head" runat="server">

 

 

 

</asp:ContentPlaceHolder>

 

 

 </

 

head>

 

 

 <

 

body>

 

 

<form id="form1" runat="server">

 

<div>

 

<telerik:RadScriptManager ID="scriptMgr" runat="server" EnableHistory="True" />

 

<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">

 

</asp:ContentPlaceHolder>

 

</div>

 

</form>

</

 

body>

 

 

</

 

html>

Default.aspx

 

 

<%

@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/Main.Master" CodeBehind="Default.aspx.vb" Inherits="AjaxEnableHistory._Default" %>

 

<%

@ Register Src="Default.ascx" TagName="Default" TagPrefix="uc1" %>

 

<

 

asp:Content ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

 

 

<uc1:Default ID="Default1" runat="server" />

</

 

asp:Content>

Default.ascx

 

<%

@ Control Language="vb" AutoEventWireup="false" CodeBehind="Default.ascx.vb" Inherits="AjaxEnableHistory._Default1" %>

 

<

 

asp:ScriptManagerProxy ID="scriptMgr" runat="server" />

 

 

 

 

 

<%

 

--<telerik:RadAjaxLoadingPanel ID="ajxLoading" runat="server">

 

Loading...</telerik:RadAjaxLoadingPanel>

<telerik:RadAjaxPanel ID="ajxPanel" runat="server" LoadingPanelID="ajxLoading">

<telerik:RadTextBox ID="txt" runat="server" />

<asp:Button ID="btn" runat="server" Text="Ajax Postback" />

</telerik:RadAjaxPanel>--

 

 

%>

 

 

<

 

asp:UpdateProgress ID="updProgress" runat="server" AssociatedUpdatePanelID="updPanel">

 

 

<ProgressTemplate>Loading...</ProgressTemplate>

</

 

asp:UpdateProgress>

 

<

 

asp:UpdatePanel ID="updPanel" runat="server" UpdateMode="Conditional">

 

 

<ContentTemplate>

 

 

<telerik:RadTextBox ID="txt" runat="server" />

 

 

<asp:Button ID="btn" runat="server" Text="Ajax Postback" />

 

 

</ContentTemplate>

</

 

asp:UpdatePanel>

Default.ascx.vb

 

Private

 

Sub btn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn.Click

 

    Threading.Thread.Sleep(3000)

    AddHistoryPoint()

 

End Sub

 

 

 

 

Private Sub scriptMgr_Navigate(ByVal sender As Object, ByVal e As System.Web.UI.HistoryEventArgs) Handles scriptMgr.Navigate

    Threading.Thread.Sleep(3000)

    txt.Text = e.State(txt.ID)

    updPanel.Update() 'Update method not available with RadAjaxPanel

 

End Sub

 

 

 

 

Protected Sub AddHistoryPoint()

 

 

    Dim sm As ScriptManager = ScriptManager.GetCurrent(Me.Page)

 

 

    If sm.IsInAsyncPostBack AndAlso Not sm.IsNavigating Then

 

 

        Dim state As New NameValueCollection()

        state(txt.ID) = txt.Text

        ScriptManager.GetCurrent(

Me.Page).AddHistoryPoint(state, "Test Title")

 

 

    End If

 

 

End Sub

 

 

 

 

 

Nate
Top achievements
Rank 1
 answered on 05 Feb 2009
1 answer
141 views
Is there a way to set the size of the text in a datagrid for a chart?  Seems an easy thing, but I've been digging around and haven't found anything.

Thanks,
Jamie
Velin
Telerik team
 answered on 05 Feb 2009
2 answers
141 views
I have a page with a grid and that grid uses the commanditemtemplate.  When the page first loads, it's in a "New" mode that I use in my code to hide the commanditemtemplate.  Essentially, the page loads and since the mode is "New," runs this code in the PreRender method of RadGrid1:

RadGrid1.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None; 

That part works fine.  However, I have a Save button above the grid (not part of the grid) that, when clicked, sets the mode to "Edit" and causes a page postback.  Now that the mode is "Edit," the PreRender method of RadGrid1 runs this code:

RadGrid1.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.Bottom; 

This is the part that's not working.  After the first page postback, a blue "footer" appears at the bottom of the grid that says "Ready," but I get no commanditemtemplate.  My CommandItemTemplate only contains a Button control aligned on the right side of the grid.  Interestingly enough, if I click the Save button again to cause a second page postback, I do get my commanditemtemplate along with the blue "footer" that says "Ready."

Any ideas?

Thank you,

Eric Skaggs
Eric Skaggs
Top achievements
Rank 2
 answered on 05 Feb 2009
1 answer
106 views
I have implemented a horizontal menu with the skin 'black', and it 'almost' fills the page width.
Really it would look much better if it fit 100% to the width, but setting the menu width property
only adds the flat background colour, rather than stretching the buttons to fit.

I could tweak font size to get the menu to fit in IE,  but then Safari shows the menu narrower,
due to slight differences in the rendering of font sizes in CSS.

One way to work around this would be to have the button 'image' as the menu background
and allow it to fill the space. Is there a neat way do do this?

Thanks for any help on this!

Clive
Yana
Telerik team
 answered on 05 Feb 2009
3 answers
135 views
Hi,

I am using RADAjax Manager inside some Sharepoint web parts. For all the pages that uses RADAjax Manager the Welcome <user> message in the screen goes one line above and appears weird. For all the other pages it is fine. Is there any issue in using RADAjaxManager with Sharepoint? Please let me know the work around for this. Any help is highly appreciated.

Sebastian
Telerik team
 answered on 05 Feb 2009
1 answer
307 views
Hi,

I have a problem with attributes add from server-side and access from client-side:

Into nodeBound event i set a attributes i set an attributes ID
    Private Sub rtvTagAvailable_NodeBound(ByVal o As Object, ByVal e As Telerik.Web.UI.RadTreeNodeEventArgs) Handles rtvTagAvailable.NodeDataBound 
            Dim node As RadTreeNode = e.Node 
            node.Attributes.Add("ID", orgTag.ID.ToString) 
    End Sub 
 
 

from client-side function (not connected on OnClientNodeClicked) i try to get this attribute value and it's always undefined (idTag)
            var treeView = $find("<%= rtvTagAvailable.ClientID %>"); 
            var selectedNode = treeView.get_selectedNode(); 
            if(selectedNode) 
            { 
                var idTag = selectedNode.get_attributes().getAttribute("ID"); 
                if (idTag)  
                { 
                   <%=RadAjaxPanel1.ClientID%>.ajaxRequest("Delete;" + idTag ); 
                } 
            } 
 
 

but, into my code-behind i have access to this same attribute, but not client-side??

ty

Yana
Telerik team
 answered on 05 Feb 2009
1 answer
98 views
Is it possible to use RadAjax for web user controls in a separate class library project?

I want the web user controls in a separate class library project so that the library can then be used by a variety of different web application projects?

But when I've tried to do this, I cannot see the RadControls on the design surface of the web user controls in the class library project. Is there an example of how to do this? What configuration settings are necessary for the app.config file?

Also is there an example for how to program the RadAjaxManagerProxy in a webUserControlBase class so that it is inherited by all the web user controls in the class library project? Will this work when the user controls of the library are then called by the web pages of the various web applications which have the RadAjaxManager in their master pages?
Rosen
Telerik team
 answered on 05 Feb 2009
2 answers
174 views
I recently changed all my asp:textbox for telerik:textbox. I just found that all my defaultfocus are not working.  

So I did a very simple test (code below) and found that it is really a telerik bug I think, when I set the defaultfocus on textbox1 or 2, it work (asp:textbox) but when I set it on textbox3 (telerik textbox), the focus do not go on the textbox3.  It reacts like if there were no defaultfocus property set.

<form id="form1" runat="server" defaultfocus="textbox2"
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server" /> 
    <asp:TextBox runat="server" ID="textbox1" Text="textbox1" /><br
    <asp:TextBox runat="server" ID="textbox2" Text="textbox2" /><br
    <telerik:RadTextBox ID="textbox3" runat="server" Text="textbox3" /> 
</form> 
 
 

Am I doing something wrong ?


Bridge24
Top achievements
Rank 1
Iron
Iron
 answered on 05 Feb 2009
4 answers
123 views
Hi,

     I need to limit the display size of a GridMaskedBox Column.  I actually need to limit the size of the textbox during editing.  The ItemStyle-Width is not working.  For that matter, I'm unable to set the display size for any of the Bound Columns.

Thanks

Ashok Sridhar
Top achievements
Rank 1
 answered on 05 Feb 2009
1 answer
134 views
Hi,

I am using a heirarchical grid which is nested till level 3 and want to show some rows in the inner detail grids to be expanded. I wish to do this programmatically if the rows match some criteria.

I tried the following but it does not seem to work-
protected void Page_PreRender(object sender, EventArgs e)  
{  
    foreach (GridDataItem masterItem in RadGrid1.MasterTableView.Items)  
    {  
        // loop through the element under each category  
        foreach (GridDataItem detailitem1 in masterItem.ChildItem.NestedTableViews[0].Items)  
        {  
            foreach (GridDataItem detailitem2 in detailitem1.ChildItem.NestedTableViews[0].Items)  
            {  
                if (...my criteria..)  
                {  
                    detailitem1.Expanded = true;  
                    //also tried the one below  
                    //RadGrid1.SelectedIndexes.Add(masterItem.ItemIndex, detailitem1.ItemIndex, detailitem2.ItemIndex);  
                }  
            }  
        }  
    }  

Can someone please help...

Thanks,
- Manoj
Princy
Top achievements
Rank 2
 answered on 05 Feb 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?