Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
165 views
Hello,

I've got a problem with refresh requests in a heavy page with many user controls,
The page is made of ten user controls in which there is a xml control that load some xml data and in one of those controls( now i'm going to call this control Control_A) ,and in this one there is another user control ( Control_B), and within the last one control there is a button. This button(in Control_B) make a request  to a wcf service and get some xml data from this; the problem is here, this data has to be renderized in the control ( Control_B ) with a partial render,and the Control_A is refreshed to change the visual style, but when I click the button the postback don't start , now I list steps that took place hours after the click :
1 - Click the button
2 - Page_Load is fired (of the page not within the user controls)
3 - the page is not in postback, so all the requests for the creation of the page start(the page now should be in postback in theory), because I check that the page is not in postback in the page_load to know if I have to create or update the page
4 - the request made by the button click event handler is fired
5 - all the page is refreshed, so I lost all the xml data in the user controls opposed by the Control_B and Control_A which refrersh correctly.

So this is the schema of the page:
Page    

    RadScriptManager

        RadAjaxManager (with only the settings for the buttons in the page, e.g the button that prints a pdf file of the page) 
    RadAjaxLoadingPanel ( with a user control with the refresh image inside, as in the telerik samples)
    Control_A
        RadAjaxLoadingPanel 
        RadAjaxManagerProxy
        XmlControl

 

 

 

 

        Control_B(with the button)            
            RadAjaxLoadingPanel 
            RadAjaxManagerProxy 
 

 

 

 

 

 

                      XmlControl
                        Button
        UserControl
        UserControl
        UserControl,ecc..(other user controls)

when I click the Button inside Control_B all the user controls are refreshed and the postback isn't be setted to true, so the page is all recreated and the Initial requests are remaked(and this is not correct)

what can I do to refresh only control_A and Control_B?With which radajax configuration can I do what I want?

Maria Ilieva
Telerik team
 answered on 26 Oct 2011
1 answer
85 views
Hi,

I have to create multiple grids dynamically with dynamic columns.(Grid genereated at code behind C#). I have created columns in onInit event of radgrid.I have two buttons outside the grid which is used to display and hide columns when clicked on that. In this scenario when i click any of the button it should hide some columns and show other columns for eg (if i click the second button it should hide first 5 columns and show next 5 columns. Initially the first 5 columns only shown on load other 5 are hidden).

The whole grid was created and all the maniplations are done in an ASCX file. This Control file is referred and created multiple times as per the requirement.

This control works fine if it has created for only one time. But i get some problems when it created more than once.

The problem is when i click on the button the grid needdatasource function should not be called, since i am using private function to hide and show columns and no grid rebind method or any thing related to ribind is written. But the problem when i have two or more grids the grid needdatasource method is fired and then creates the loads some unrelavent data. Eg (Binds some other grid data to some other grid and viseversa)

Please help me in this regards.

Kannan
Maria Ilieva
Telerik team
 answered on 26 Oct 2011
1 answer
80 views
I've reviewed the examples on the site and it's all a bit over my head. 

I've got a table called 'hits' in my database that simply stores the id of the item the hit is related to (in this case a property) and the time of the hit. 

What i want to do is have the months along the x-axis of my chart, and the number of hits on the y-axis.

At the moment i'm returning these from my database in a List(Of hit) where hit is a custom class i've written to store the hit information.

Can someone talk me through, or direct me towards an example on how to achieve this. 

At the moment i've got something like this:

For Each obj_hit As hit In hits 
            If Month(hit.date_created) = 1 Then 'jan
  
            ElseIf Month(hit.date_created) = 2 Then 'feb
  
            ElseIf Month(hit.date_created) = 3 Then 'march
  
            ElseIf Month(hit.date_created) = 4 Then '..
  
            ElseIf Month(hit.date_created) = 5 Then
  
            ElseIf Month(hit.date_created) = 6 Then
  
            ElseIf Month(hit.date_created) = 7 Then
  
            ElseIf Month(hit.date_created) = 8 Then
  
            ElseIf Month(hit.date_created) = 9 Then
  
            ElseIf Month(hit.date_created) = 10 Then
  
            ElseIf Month(hit.date_created) = 11 Then
  
            ElseIf Month(hit.date_created) = 12 Then
  
            End If
Next
Evgenia
Telerik team
 answered on 26 Oct 2011
1 answer
111 views
I have a grid using static headers and scrolling.  When I load up the page in a browser is looks perfect.  When I set the page to an IFRAME SRC the headers are misaligned slightly.  This appears to be the width of what would be a scroll bar.  At this point if I sort a column or initiate a resize of a column the alignment corrects itself.

What could possibly be causing the misalignment on page load?

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="frame.aspx.vb" Inherits="Maintenance_frame" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <iframe src="http://rome/mypage.aspx" 
    width="100%" style="overflow:hidden;overflow-y:hidden;overflow-x:hidden" height="500px" scrolling="no">Your browser does not suppport frames.</iframe>
    </div>
    </form>
</body>
</html>


And the Grid in mypage.aspx:

<telerik:RadGrid ID="rgVendor" runat="server" AllowSorting="True" AutoGenerateColumns="False"
  GridLines="None" PageSize="5" Skin="WebBlue" Width="100%" AllowFilteringByColumn="True"
  CellSpacing="0">
  <FilterMenu EnableImageSprites="False">
  </FilterMenu>
  <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default" EnableImageSprites="True">
  </HeaderContextMenu>
  <MasterTableView ClientDataKeyNames="vnd_code" TableLayout="Fixed" CommandItemDisplay="Top">
    <CommandItemSettings ExportToPdfText="Export to PDF" />
    <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
    </RowIndicatorColumn>
    <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
    </ExpandCollapseColumn>
    <EditFormSettings>
      <EditColumn FilterControlAltText="Filter EditCommandColumn column">
      </EditColumn>
    </EditFormSettings>
    <CommandItemTemplate>
      <table border="0" cellpadding="2" cellspacing="2" width="100%">
        <tr>
          <td nowrap style="width: 75px; text-align: left;">
            <asp:LinkButton ID="lnkAdd" runat="server" OnClientClick="add_onclick();return false;"
              Font-Underline="false" ToolTip="Add New Vendor Master" TabIndex="1"><img src="../Images/form-addnew.png" border="0" /> Add New</asp:LinkButton>
          </td>
          <td class="labelnorm" style="width: 80%; text-align: center; font-weight: bold">
            Vendor Master Entry
          </td>
          <td nowrap style="width: 40px">
            <asp:LinkButton ID="lnkClear" runat="server" CommandName="RemoveFilters" OnClientClick="javascript:$find('txtCode').set_value('');"
              Font-Underline="false" ToolTip="Clear Filters" TabIndex="1"><img src="../Images/form-clear.png" border="0" /> Clear</asp:LinkButton>
          </td>
          <td nowrap style="width: 5px;">
            -
          </td>
          <td nowrap style="width: 50px">
            <asp:LinkButton ID="lnkRefresh" runat="server" CommandName="RebindGrid" Font-Underline="false"
              ToolTip="Refresh Organization List" TabIndex="1"><img src="../Images/form-refresh.png" border="0" /> Refresh</asp:LinkButton>
          </td>
          <td nowrap style="width: 5px">
            -
          </td>
          <td nowrap style="width: 50px">
            <asp:LinkButton ID="lnkExcel" runat="server" CommandName="ExportToExcel" CssClass="clink"
              Font-Underline="false" ToolTip="Click To Export List To Excel" TabIndex="1"><img src="../Images/form-excel.png" border="0" /> XLS</asp:LinkButton>
          </td>
          <td nowrap style="width: 5px">
            -
          </td>
          <td nowrap style="width: 50px">
            <asp:LinkButton ID="lnkCSV" runat="server" CommandName="ExportToCSV" CssClass="clink"
              Font-Underline="false" ToolTip="Click To Export List To CSV" TabIndex="1"><img src="../Images/form-csv-export.png" border="0" /> CSV</asp:LinkButton>
          </td>
          <td nowrap style="width: 5px">
            -
          </td>
          <td nowrap style="width: 50px">
            <asp:HyperLink ID="lnkClose" runat="server" Font-Underline="false" ToolTip="Click To Close This Menu" TabIndex="1" Target="_top"><img src="../Images/form-close.png" border="0" /> Close</asp:HyperLink>
          </td>
        </tr>
      </table>
    </CommandItemTemplate>
    <Columns>
      <telerik:GridTemplateColumn UniqueName="TemplateColumn" AllowFiltering="false">
        <HeaderStyle Width="70px" />
        <ItemStyle Wrap="false" HorizontalAlign="Center" />
        <ItemTemplate>
        </ItemTemplate>
      </telerik:GridTemplateColumn>
      <telerik:GridBoundColumn DataField="vnd_code" HeaderText="Vendor Code" ReadOnly="True"
        SortExpression="vnd_code" UniqueName="vnd_code">
        <HeaderStyle Font-Bold="True" HorizontalAlign="Left" Width="80px" Wrap="False" />
        <ItemStyle HorizontalAlign="Left" Wrap="False" />
      </telerik:GridBoundColumn>
      <telerik:GridBoundColumn DataField="vnd_description" HeaderText="Description" SortExpression="vnd_description"
        UniqueName="vnd_description">
        <HeaderStyle Font-Bold="True" HorizontalAlign="Left" Wrap="False" />
        <ItemStyle HorizontalAlign="Left" Wrap="False" />
      </telerik:GridBoundColumn>
      <telerik:GridBoundColumn DataField="vnd_email" HeaderText="Email" SortExpression="vnd_email"
        UniqueName="vnd_email">
        <HeaderStyle Font-Bold="True" HorizontalAlign="Left" Width="200px" Wrap="False" />
        <ItemStyle HorizontalAlign="Left" Wrap="False" />
      </telerik:GridBoundColumn>
      <telerik:GridBoundColumn DataField="vnd_file_format" HeaderText="File Format" SortExpression="vnd_file_format"
        UniqueName="vnd_file_format">
        <HeaderStyle Font-Bold="True" HorizontalAlign="Center" Width="90px" Wrap="False" />
        <ItemStyle HorizontalAlign="Left" Wrap="False" />
      </telerik:GridBoundColumn>
    </Columns>
  </MasterTableView>
  <ClientSettings>
    <Scrolling AllowScroll="True" UseStaticHeaders="True" />
    <Selecting AllowRowSelect="True" />
    <Resizing AllowColumnResize="True" AllowResizeToFit="True" 
      EnableRealTimeResize="True" />
  </ClientSettings>
</telerik:RadGrid>
Pavlina
Telerik team
 answered on 26 Oct 2011
1 answer
101 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
141 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
99 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
278 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
73 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
64 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?