Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
115 views
Hi all!  I have a simple RadMenu that displays a static (not pulled from any sort of datasource) list of menu items like so:
<telerik:RadMenu ID="RadMenu1" runat="server" EnableShadows="true">
    <Items>
        <telerik:RadMenuItem Text="" PostBack="false" ImageUrl="~/i/opendata.png" NavigateUrl="data.aspx">
            <Items>
                <telerik:RadMenuItem Width="400px">
                    <ItemTemplate>
                        <div id="CatWrapper" class="Wrapper" style="width: 380px;">
                            <h3> Our Data</h3>
                            <table>
                                <tr>
                                    <td valign="bottom"><a href="dfaq.aspx"><img src="i/faq_24.png" alt="FAQ" /></a>
                                    </td>
                                    <td width="175px"><a href="dfaq.aspx">Data FAQ</a></td>
                                    <td valign="bottom"><a href="maps.aspx"><img src="i/map_24.png" alt="Maps" /></a></td>
                                    <td><a href="mapcat.aspx">Maps</a></td>
                                </tr>
                                <tr>
                                    <td valign="bottom" align="right"><a href="dldsoptions.aspx"><img src="i/globe_download_24.png" alt="Dowload Datasets" /></a>
                                    </td>
                                    <td><a href="dldsoptions.aspx">Download Datasets</a></td>
                                    <td valign="bottom"><a href="otherdata.aspx"><img src="i/link_24.png" alt="Other Data Links" /></a>
                                    </td>
                                    <td><a href="otherdata.aspx">Other Data Links</a></td>
                                </tr>
                                <tr id="sde">
                                    <td valign="bottom" id="sdeimgcell" runat="server" visible="false"><a href="sde.aspx"><img src="i/_engine_24.png" alt="SDE" /></a></td>
                                    <td id="sdelinkcell" runat="server" visible="false"><a href="sde.aspx" >Access Data</a></td>
                                    <td></td>
                                    <td></td>
                                </tr>
                            </table>
                        </div>
                    </ItemTemplate>
                </telerik:RadMenuItem>
            </Items>
        </telerik:RadMenuItem>
    </Items>
</telerik:RadMenu>

The last item I have set to visible="false" because I want to ensure in the code-behind that the user SHOULD see it, based on a role.  I can't for the life of me figure out how to "find" the <td id="sdelinkcell"...>!  Anyone?  I need to make it visible for one role, but I'm stumped!
Kate
Telerik team
 answered on 26 Oct 2011
1 answer
153 views
Could anyone offer any ideas as to why when using Firefox only the first page prints when using a custom print button on a RadWindow?

In my case two pages are printed, but only the first page has the text being printed and the rest of text that should appear on the second page isn't there. My print settings in Firefox are set to print the page #s and Date/Time in the footer, and these do appear on the second page so I know it's not just a blank sheet of paper printing.

If I use Google Chrome, the full text prints as expected on two pages (although the last line on the first page is only the top-half of the sentence and the first line of the second page is the bottom-half of the same sentence).

If I use IE, it prints exactly as it should...the full text prints as expected, and the last line on the first page is not cut-off and appears properly on the second page.

I really need this print functionality to work properly for Firefox as that is the browsers our users are told to use.  If nothing else, at least Chrome as we do sometimes suggest that as alternative.

Note - our code for adding the custom print button is taken from the Telerik article "Adding a Custom Button to RadWindow Titlebar" (http://www.telerik.com/support/kb/aspnet-ajax/window/adding-a-custom-button-to-radwindow-titlebar.aspx)

Thanks!
Marin Bratanov
Telerik team
 answered on 26 Oct 2011
3 answers
112 views
Hi
Is there anyway to read RadDock's attributes by it's js APIs ? (like RadToolbar that has specific js APIs to get it's attributes)

THANK YOU FOR YOUR FEEDBACK
Slav
Telerik team
 answered on 26 Oct 2011
6 answers
329 views
We seem to be having a common problem with our web application; specifically that when the user attempts to click on a RadGrid, RadTabStrip or any other ajax enabled component on the page after the session has expired, an error occurs.  This is the specific error:

Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 12030


I've done several searches on this topic, and one of the solutions that was recommended was to set the  Response.RedirectLocation property in the Login page.  I have tried this to, but I have still been unsuccessful.

As a workaround, I added a timer to my master page.  My goal was to set the interval of the timer for the 15 minute session life and than automatically redirect the user to the Login page.  The only problem is I cannot reset the timer if the user remains active, so it simply expires in 15 minutes (or whatever interval it is set to) whether the user is active or not.  I am trying to use the following code to reset the timer:

protected void Page_Load(object sender, EventArgs e)
{
    SessionTimer.Enabled = false;
    SessionTimer.Interval = 30000;
    SessionTimer.Enabled = true;
}

The code is being called, but it is not effecting the timer. 

Any ideas on how to implement this solution?

Thanks,
Jerry


Maria Ilieva
Telerik team
 answered on 26 Oct 2011
2 answers
102 views
Q3
I need to do a integration with facebook and anothers social networks ...   is it possible i use Social Share control ? Could  you send me binary file as Beta Component ???
Svetlina Anati
Telerik team
 answered on 26 Oct 2011
1 answer
77 views
Hi all,

I use the following code in Server side to display error message.
The RadWindow is displayed successfully. However, I couldn't close it by OK button. Closed by using the red X works.
But when I release my project on IIS, I could close it by using OK button.
Have no idea what is going on.
Please help.

Dim myError  As String = "This is an error message."
RadAjaxManager1.ResponseScripts.Add("radalert('" + myError  + "', 430, 150);")

Thanks

Andy.  
Marin Bratanov
Telerik team
 answered on 26 Oct 2011
1 answer
102 views
I have a strip of tabs set out in the normal way in the code-in-front. I would like to be able to change the order of appearance of the tabs in the strip. e.g.

Tab 1 | Tab 2 | Tab 3 | Tab 4

but I want to programatically, with a postback, change the on screen order of these to

Tab 3 | Tab 1 | Tab 4 | Tab 2

(or whatever). Is this possible, i fiddled for a while but couldn't see how it was done.
Kate
Telerik team
 answered on 26 Oct 2011
1 answer
126 views
Hi, I have a page with 2 notifications object! Here the scenario, a page with three notifications objects. I have a link button, and by server side i call show of three objects.
How can i calculate offset for each object is necessary?
I've implemented "OnClientShowing" and "ONClientHidden", and works fine, but only If i used show notification from client side.
Any workaround?
Marin Bratanov
Telerik team
 answered on 26 Oct 2011
1 answer
89 views
Hi all!!

I'm working with a RadGrid with hierarchies, but I have a couple of problems, I've managed to show the internal grids but when I display information in an internal grid I can not do depending on the value that has the grid father, my question is:
How I can make the relationship between parent and child grid?, And how to make each internal grid have different information?


Here is my code:

<telerik:RadGrid ID="grdCompCliente" runat="server" OnItemCommand="grdCompCliente_ItemCommand1"
                        OnItemCreated="grdCompCliente_ItemCreated1" 
                        OnItemDataBound="grdCompCliente_ItemDataBound1" Skin="Windows7">
                        <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
                        </HeaderContextMenu>
                        <MasterTableView AllowMultiColumnSorting="True" EnableNoRecordsTemplate="true" 
                            GroupLoadMode="Server" ShowHeadersWhenNoRecords="false">
                            <NestedViewTemplate>
                                <asp:Panel ID="InnerContainer" runat="server" Visible="false">
                                    <telerik:RadGrid ID="grdPostores" runat="server" >
                                        <MasterTableView AutoGenerateColumns = "true">
                                            <Columns>
                                                <telerik:GridBoundColumn DataField="Nombre" HeaderText="Nombre del Postor">
                                                </telerik:GridBoundColumn>
                                            </Columns>
                                        </MasterTableView>
                                    </telerik:RadGrid>
                                    <telerik:RadButton ID="cmdAgregarPostor" runat="server" 
                                        CausesValidation="False" Text="Agregar Postores">
                                    </telerik:RadButton>
                                </asp:Panel>
                            </NestedViewTemplate>
                            <CommandItemSettings ExportToPdfText="Export to PDF" />
                            <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                            </RowIndicatorColumn>
                            <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" 
                                Visible="True">
                            </ExpandCollapseColumn>
                            <EditFormSettings>
                                <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                </EditColumn>
                            </EditFormSettings>
                        </MasterTableView>
                        <FilterMenu EnableImageSprites="False">
                        </FilterMenu>
                    </telerik:RadGrid>

protected void grdCompCliente_ItemDataBound1(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridNestedViewItem)
            {                
                try
                {
                    int id = Convert.ToInt32(Session["Prueba"]);
                    DataAccesCatalogos compCliente = new DataAccesCatalogos();
                    ((RadGrid)e.Item.FindControl("grdPostores")).DataSource = compCliente.GetBidders(id);
                    ((RadGrid)e.Item.FindControl("grdPostores")).DataBind();
                }
                catch { }
            }
        }
         
        protected void grdCompCliente_ItemCreated1(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridNestedViewItem)
            {
                e.Item.FindControl("InnerContainer").Visible = ((GridNestedViewItem)e.Item).ParentItem.Expanded;
            }
        }
  
        protected void grdCompCliente_ItemCommand1(object sender, GridCommandEventArgs e)
        {
            if (e.CommandName == RadGrid.ExpandCollapseCommandName && e.Item is GridDataItem)
                {
                    ((GridDataItem)e.Item).ChildItem.FindControl("InnerContainer").Visible = !e.Item.Expanded;
                      
                    string id_comp = (e.Item as GridDataItem)["ID"].Text;
                      
                    Session["Prueba"] = id_comp;
                    //Label1.Text = "id: " + Session["Prueba"].ToString();
                }
             
        }

Thankyou for your attention
Jayesh Goyani
Top achievements
Rank 2
 answered on 26 Oct 2011
1 answer
144 views
Greetings,
I try to make the exemple The telerik team has posted here :
http://www.telerik.com/community/code-library/aspnet-ajax/grid/display-radgrid-row-details-in-ajaxtoolkit-modalpopupextender.aspx


But i don't get anything when i click on an ID ( just a OK button which make a short apparition before vanishing )... My popup does not show itself...

Can anyone help me ?

<%@ Page Title="Page d'accueil" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeFile="Default.aspx.cs" Inherits="_Default" %>
 
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
   <style type="text/css">
        .modalBackground
        {
            background-color: Gray;
            filter: alpha(opacity=70);
            opacity: 0.7;
        }
        .PanelClass
        {
            background: white;
        }
        .DetailsViewHeader
        {
            border-bottom: 1px solid #41a901;
            padding-top: 8px;
            padding-bottom: 8px;
            background: olive;
            font-size: 13px;
            font-weight: normal;
            text-align: left;
            color: white;
        }
    </style>
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <ajaxToolkit:ToolkitScriptManager runat="server" ID="ScriptManager1">
    </ajaxToolkit:ToolkitScriptManager>
    <asp:DetailsView ID="DetailsView1" runat="server" DataSourceID="DetailsViewDataSource"
        AutoGenerateRows="False" Width="60%" HeaderText="Contact details">
        <HeaderStyle CssClass="DetailsViewHeader" />
        <Fields>
            <asp:BoundField DataField="Title" HeaderText="Title" />
            <asp:BoundField DataField="BirthDate" HeaderText="BirthDate" DataFormatString="{0:D}" />
            <asp:BoundField DataField="City" HeaderText="City" />
            <asp:BoundField DataField="Country" HeaderText="Country" />
        </Fields>
    </asp:DetailsView>
 
 
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
        onajaxrequest="RadAjaxManager1_AjaxRequest">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="DetailsView1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            function PopulateDetails(rowid) {
                $get("<%=btnPopUp.ClientID %>").click();
                $find("<%=RadAjaxManager1.ClientID %>").ajaxRequest(rowid);
 
                return false;
            }
        </script>
    </telerik:RadCodeBlock>
    <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1"
        AutoGenerateColumns="false" onitemcreated="RadGrid1_ItemCreated">
        <MasterTableView DataKeyNames="EmployeeID">
            <Columns>
                <telerik:GridTemplateColumn UniqueName="TemplateColumn" HeaderText="EmployeeID">
                    <ItemTemplate>
                        <asp:LinkButton ID="btnShowDetails" runat="server" CausesValidation="false" Text='<%#Eval("EmployeeID")%>' />
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridBoundColumn DataField="FirstName" HeaderText="First name" ReadOnly="True"
                    UniqueName="FirstName" />
                <telerik:GridBoundColumn DataField="LastName" HeaderText="Last name" ReadOnly="True"
                    UniqueName="LastName" />
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
        SelectCommand="SELECT EmployeeID, LastName, FirstName FROM Employees"></asp:SqlDataSource>
    <asp:SqlDataSource ID="DetailsViewDataSource" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
        ProviderName="System.Data.SqlClient" SelectCommand="SELECT Title, BirthDate, City, Country FROM Employees WHERE EmployeeID=@EmployeeID"
        runat="server">
        <SelectParameters>
            <asp:Parameter Name="EmployeeID" Type="Int16" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:Panel ID="Panel1" runat="server" CssClass="PanelClass" Style="display: none;">
        <asp:Button ID="btnOK" runat="server" Text="OK" />
    </asp:Panel>
    <ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender1" runat="server" PopupControlID="Panel1"
        OkControlID="btnOK" TargetControlID="btnPopUp" BackgroundCssClass="modalBackground"
        DropShadow="true">
    </ajaxToolkit:ModalPopupExtender>
    <asp:Button ID="btnPopUp" runat="server" Text="Show popup" Style="display: none"/>
</asp:Content>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
 
public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
 
    }
    protected void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
           if (e.Item is GridDataItem)
        {
            LinkButton btnDetails = e.Item.FindControl("btnShowDetails") as LinkButton;
            btnDetails.OnClientClick = string.Format("return PopulateDetails('{0}');", (e.Item as GridDataItem).GetDataKeyValue("EmployeeID").ToString());
        }
 
    }
    protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
    {
        int eventArgument = Convert.ToInt32(e.Argument);
        foreach (GridDataItem gridItem in RadGrid1.MasterTableView.Items)
        {
            if (Convert.ToInt32(gridItem.GetDataKeyValue("EmployeeID")) == eventArgument)
            {
                DetailsViewDataSource.SelectParameters["EmployeeID"].DefaultValue = eventArgument.ToString();
                DetailsView1.DataBind();
                return;
            }
        }
    }
}

Radoslav
Telerik team
 answered on 26 Oct 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?