Telerik Forums
UI for ASP.NET AJAX Forum
8 answers
129 views
I have a radgrid with several pages, and on each page there are hyperlinked row values that navigate the user away from the grid to another page (like Google).  What I would like to do is persist the last page viewed so that when the user clicks the back button, I return to the last page viewed and not the first page.  Here's a sample page.

<%@ Page Language="vb" AutoEventWireup="false" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
<script runat="server">
 
    Protected Sub RadGrid1_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource
        Dim table As New System.Data.DataTable
        Dim i As Integer
        table.Columns.Add("ContactID")
        table.Columns.Add("FirstName")
        table.Columns.Add("LastName")
        table.Columns.Add("ContactType")
        table.Columns.Add("PostedDate")
        table.Columns.Add("Replied")
 
        For i = 1 To 50
            table.Rows.Add(i, i, i, i, DateTime.Now, i)
        Next
        RadGrid1.DataSource = table
         
    End Sub
     
    Protected Sub RadGrid1_PageIndexChanged(ByVal source As Object, ByVal e As Telerik.Web.UI.GridPageChangedEventArgs)
        RadScriptManager1.AddHistoryPoint("p", e.NewPageIndex)
    End Sub
 
    Protected Sub ScriptManager_Navigate(ByVal sender As Object, ByVal e As System.Web.UI.HistoryEventArgs) Handles RadScriptManager1.Navigate
        If e.State.Count <= 0 Then
            ' Default state
            RadGrid1.CurrentPageIndex = 0
        Else
            Dim key As String = e.State.AllKeys(0)
            If key = "p" Then
                Dim state As String = e.State(key)
                RadGrid1.CurrentPageIndex = CInt(state)
                RadGrid1.Rebind()
            End If
        End If
    End Sub
 
 
</script>
 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head id="Head1" runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
 
    <telerik:RadAjaxManager ID="RadAjaxManager1" DefaultLoadingPanelID="RadAjaxLoadingPanel1" EnableAJAX="true"
        runat="server">
        <AjaxSettings>
    <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">  
             <UpdatedControls>  
                   <telerik:AjaxUpdatedControl ControlID="RadGrid1" />  
             </UpdatedControls>  
    </telerik:AjaxSetting>  
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default">
    </telerik:RadAjaxLoadingPanel>
 
    <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" GridLines="None"
        AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True"
        AllowMultiRowSelection="true" PageSize="25" PagerStyle-Mode="NextPrevAndNumeric" EnableViewState="true">
        <PagerStyle AlwaysVisible="True" Position="TopAndBottom" />
        <ClientSettings>
            <Selecting AllowRowSelect="true" />
        </ClientSettings>
        <GroupingSettings CaseSensitive="false" />
        <MasterTableView DataKeyNames="ContactID,Replied">
            <RowIndicatorColumn>
                <HeaderStyle Width="20px"></HeaderStyle>
            </RowIndicatorColumn>
            <ExpandCollapseColumn>
                <HeaderStyle Width="20px"></HeaderStyle>
            </ExpandCollapseColumn>
            <HeaderStyle Font-Bold="true" />
            <Columns>
                <telerik:GridBoundColumn DataField="ContactID" HeaderText="ContactID" Visible="false"
                    UniqueName="ContactID">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="FirstName" HeaderText="First Name" UniqueName="FirstName"
                    Visible="true">
                </telerik:GridBoundColumn>
                <telerik:GridTemplateColumn HeaderText="LastName" UniqueName="TemplateColumn">
                    <ItemTemplate>
                        <a href='http://www.google.com'>
                            <%#Eval("LastName")%></a>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridBoundColumn DataField="ContactType" HeaderText="Contact Type" Visible="true"
                    UniqueName="ContactType" AllowFiltering="true">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="PostedDate" HeaderText="Posted Date" Visible="true"
                    UniqueName="PostedDate" AllowFiltering="false">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Replied" HeaderText="Replied" Visible="true"
                    UniqueName="Replied">
                </telerik:GridBoundColumn>
                <telerik:GridTemplateColumn HeaderText="Delete" UniqueName="Delete" AllowFiltering="false">
                    <ItemTemplate>
                        <asp:ImageButton ID="btnDelete" runat="server" ImageUrl="~/Images/deletes.gif" ToolTip="Delete"
                            CommandName="Deletes" Style="cursor: hand" />
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn HeaderText="Reply/View" UniqueName="View" AllowFiltering="false">
                    <ItemTemplate>
                        <asp:ImageButton ID="btnView" runat="server" ImageUrl="~/Images/views.gif" ToolTip="Reply/View"
                            CommandName="Reply" Style="cursor: hand" />
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                </telerik:GridTemplateColumn>
                <telerik:GridClientSelectColumn ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"
                    UniqueName="Chk_DeleteAll">
                    <HeaderStyle HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign="Center" />
                </telerik:GridClientSelectColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
    </form>
</body>
</html>

I've tried turning viewstate off on the grid but that doesn't seem to change the behavior.  Rebinding in the Navigate event doesn't update the grid (because it's ajaxed).  Maybe I'm overlooking something pretty simple and I'm open to alternative means of accomplishing the same behavior.  If anyone has some suggestions, I'm grateful.  Thanks.
Sebastian
Telerik team
 answered on 08 Dec 2010
5 answers
407 views
Hi,

I try to use a Radmenu inside a RadGrid's GridTemplateColumn.
The Result is shown on the attached Picture.
The Menuitems should do a Postback and depending on the selected Menuitem do some Action for the cuttent Row.

Unfortunately I have no idea on how to this.
Can anyone give me a hint, or maybe a better solution to implement this scenario.

Thank you

Thomas

Here is my current code snippet:

<telerik:RadAjaxManager ID="raManager" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="rgOrganisationAnsprechperson">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="rgOrganisationAnsprechperson" LoadingPanelID="ralpLoading" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
  
<telerik:RadAjaxLoadingPanel id="ralpLoading" runat="server" Skin="WebBlue" ></telerik:RadAjaxLoadingPanel>   
<telerik:RadGrid ID="rgOrganisationAnsprechperson" 
    DataSourceID="odsOrganisationAnsprechperson" runat="server" PageSize="20" 
    AllowSorting="True" AllowMultiRowSelection="False" AllowPaging="True" ShowGroupPanel="False"
    AutoGenerateColumns="false" GridLines="none" 
    onprerender="rgOrganisationAnsprechperson_PreRender" >
    <PagerStyle Mode="NextPrevNumericAndAdvanced"></PagerStyle>
    <MasterTableView Width="100%">
        <GroupByExpressions>
            <telerik:GridGroupByExpression>
                <SelectFields>
                    <telerik:GridGroupByField FieldAlias="Organisation" FieldName="Organisationsname" FormatString="{0:D}"
                        ></telerik:GridGroupByField>
                </SelectFields>
                <GroupByFields>
                    <telerik:GridGroupByField FieldName="co_id" SortOrder="Descending"></telerik:GridGroupByField>
                </GroupByFields>
            </telerik:GridGroupByExpression>
        </GroupByExpressions>
        <Columns>
            <telerik:GridTemplateColumn>
                <ItemTemplate>
                    <telerik:RadMenu ID="RadMenu1" runat="server" EnableRoundedCorners="true" EnableShadows="true" ExpandAnimation-Type="None" CollapseAnimation-Type="None" ExpandDelay="0" CollapseDelay="0">
                        <Items>
                            <telerik:RadMenuItem Text="Edit" Selected="false">
                                <GroupSettings ExpandDirection="Right"/>
                                <Items>
                                    <telerik:RadMenuItem Text="Personen Daten">
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuItem Text="Einstellungen">
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuItem Text="Zugangsdaten">
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuItem Text="arbeitet nicht mehr bei Firma">
                                    </telerik:RadMenuItem>
                                </Items>
                            </telerik:RadMenuItem>
                        </Items>
                    </telerik:RadMenu>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridBoundColumn DataField="Name" HeaderText="Name" ></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Position" HeaderText="Position" ></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Admin" HeaderText="Admin" ></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Anzeigen" HeaderText="Anzeigen" ></telerik:GridBoundColumn>
        </Columns>
    </MasterTableView>
      
    <ClientSettings AllowGroupExpandCollapse="True" >
    </ClientSettings>
</telerik:RadGrid>
waruni
Top achievements
Rank 1
 answered on 08 Dec 2010
28 answers
1.3K+ views
Hello,  I need guidance as to how to improve client side performance when using a lot of rad controls on one page.  I am creating an application that will be used by several hundred police officers in a county with a population of 380k so as you can see it needs to be very reliable and fast.

One major requirement for this application is that it should have all of the fields on one page without the need to navigate between pages to enter the information needed.  This is mainly due to the fact that many police officers may have several weeks to 2 months in between using the application so it has to be easy to use and navigate.

Subsequently, there are 2 RadMenu's, 38 RadTextBox's, 12 RadMaskedTextBox's, 2 RadDateInput's, 16 RadComboBox's, 5 RadGrid's, 2 RadEditor's, 3 RadWindow's, and 1 RadAjaxManager currently on one page.  There may be a few more controls added but that should be 95% of the fields.

I enabled tracing and the server side complets in 1 second exactly every time.  The problem is at the client side.  Once the page loads into the browser there is a long pause and I'm assuming it's some sort of Telerik initialization javascript code running.  During this pause the mask shows in the RadMaskedTexBox's and the page will not respond to events...as soon as the pause is over the masks disappear (as I have HideOnBlur set to true) and then the page will respond to clicks and you can begin using the form.  The pause lasts around 6 to 8 seconds on my computer, however, it's a very fast computer and I'm afraid slower PC's will be even worse.

Is there any general guidance you can give me to reduce this client-side pause?  Thank you.
Svetlina Anati
Telerik team
 answered on 08 Dec 2010
4 answers
310 views
Hi,

I populate the RadDateTimePicker with a default date on the server side.

The control is rendered and the user can modify the date, but should be able to restore the control to its default value.

I couldn't find a client side function which covers this. I have tried to use the defaultValue of the HTML textbox element which I can get via
- $find(dtp.ClientID).get_textBox() -
but the value is stored in the wrong format to do a Date.parse(datetime_string) and I don't want to spend lots of time on this issue.

What would be the suggested way?

Thanks.

Kind regards,
Christoph
Christoph
Top achievements
Rank 1
 answered on 08 Dec 2010
5 answers
351 views
Hi Telerik Guys !

Im using RAD FILE EXPPLORER Control in one of my project.

I have implemented the ARCHIVE BUTTON in the tree context menu of the RAD FILE EXPLORER.

When I clicked on to the  "ARCHIVED" button, the FOLDER from the TREE CONTEXT MENU gets archived in the database but the folder does not gets deleted form the TREENODE. 

I can only delete/archive that folder when I refresh my entire webpage.

Please help how to delete/archive(not to show) that folder with in the TREE CONTEXT MENU in RADFILE EXPLORER.

Please help

Ajay 
Fiko
Telerik team
 answered on 08 Dec 2010
2 answers
98 views
Dears,
Is it possible to open RadWindow in RTL direction including Toolbar and Scrollbar ?

Best Regards
Georgi Tunev
Telerik team
 answered on 08 Dec 2010
1 answer
293 views
I have implemented a solution that uses the RadFileExplorer and CustomFileSystemProvider similar to what is in this post:

http://www.telerik.com/support/kb/aspnet-ajax/fileexplorer/physical-paths-and-different-content-types.aspx

My issue is that when I try to open a file that has a number sign in the file name, the URL path that is passed to the FileSystemHandler.ashx is poorly formed, and loses everything after the first '#' character. I don't expect to see these kinds of characters in our file names, but this one was a valid file and breaks the FileSystemHandler.ashx at the response.write, because the path to the file is invalid.

Is there a way to intercept this file path URL and ensure that it stays well formed. I noticed in the OnClientFileOpen client event, the url looks fine, so checking it here doesn't help. It isn't until its passed to the handler code that it is missing data....
Fiko
Telerik team
 answered on 08 Dec 2010
3 answers
308 views
Hi ,

i am using radgrid control on my page and i want to get the text of the hyperlink column in view mode.
i am getting the control and all its property but not the text property of hyperlink control.

private void grid_ItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item is GridEditableItem && e.Item.IsInEditMode)
{
}
else
{
string tasknumber = ((GridHyperLinkColumn)((RadGrid)sender).MasterTableView.DetailTables[0].Columns[6]).Text;
((GridHyperLinkColumn)((RadGrid)sender).MasterTableView.DetailTables[0].Columns[6]).DataNavigateUrlFormatString = "../AIPSTaskSelector.aspx?SubActionId={0}&disableMaster=1&read=true";
}
}

how to get the text here...
string tasknumber = ((GridHyperLinkColumn)((RadGrid)sender).MasterTableView.DetailTables[0].Columns[6]).Text;

here in string tasknumber is empty.

Please help.
Princy
Top achievements
Rank 2
 answered on 08 Dec 2010
1 answer
80 views
Hi,

I would like this functionality:

series.ActiveRegionToolTip = String.Format("{0}: {1} ({2})", series.Name, "#Y", Convert.ToDateTime("#X") );

#X is a string representation of a DateTime as OADate. I am unable to convert it here as it is still just the string literal "#X" until run time.

What is the correct way of doing this?
Evgenia
Telerik team
 answered on 08 Dec 2010
1 answer
67 views

I know how to make the RadGrid do a postback ( RadGrid1_SelectedIndexChanged event ) when a single row is clicked and I know how to set the grid up to select multiple rows but I cannot figure out how to make it automatically do a postback after I have selected multiple rows.  Is there a way to do that?

Thanks

John

Shinu
Top achievements
Rank 2
 answered on 08 Dec 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?