Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
233 views
Hello all,

I've implemented an export all pages to Excel in my grid. My grid uses custom paging, template columns and is dynamically created on the server side.
I have a customer that tried to export all pages (80000 rows, not very big of a number) to Excel and his web server went to 100% CPU with over 1GB of RAM consumed for over 10 minutes. Then the CPU returned to normal but the memory stayed there for additional 20 minutes.Below please find the code snippet:
RadGrid GridReport = (RadGrid)GridPlaceHolder.FindControl("GridReport");
 
        if (GridReport.MasterTableView.Columns.FindByUniqueNameSafe("ObjectName") != null)
        {
            GridReport.MasterTableView.Columns.FindByUniqueName("ObjectName").Visible = false;
            GridReport.MasterTableView.Columns.FindByUniqueName("ObjectNameText").Visible = true;
        }
 
        //GridReport.ExportSettings.Excel.Format = GridExcelExportFormat.ExcelML;
        GridReport.ExportSettings.Excel.Format = GridExcelExportFormat.Html;
        GridReport.ExportSettings.IgnorePaging = true;
        GridReport.ExportSettings.OpenInNewWindow = true;
        GridReport.ExportSettings.ExportOnlyData = true;
 
         
        if (cbExportAllPages.Checked == true)
            GridReport.PageSize = GridReport.MasterTableView.VirtualItemCount;
 
        GridReport.DataSource = reportResult(Session["sqlStr"].ToString());
        GridReport.Rebind();
 
        GridReport.MasterTableView.ExportToExcel();

I searched all over the forums, saw that other people had this issue, but couldn't find a vaible solution.
Tried IgnorePaging flase and true. Tried Format of HTML and ExcelML. nothing.
The ExportToExcel() function simply kills the website.

Anyone has an idea?

Thanks,
T.
Antonio Stoilkov
Telerik team
 answered on 09 Apr 2012
6 answers
160 views
Hello,

   I am using the RadAsyncUpload in a grid. Everything works fine on the localhost. After i publish the app on server, when i try to  edit a row, it doesn't work. Same is the case with Add a record .It doesn't let me add a new row to the grid. However, i notice that the delete command is working. I followed the demo in the link below.

 http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandradasyncupload/defaultcs.aspx?product=grid

Am i missing something here?
Appreciate the help
Thanks

Jagat
Top achievements
Rank 1
 answered on 09 Apr 2012
3 answers
179 views
I am working on web page which has a radgrid similar to the one displayed on this page.  http://demos.telerik.com/aspnet-ajax/grid/examples/programming/detailtabledatabind/defaultcs.aspx

The grid datasources are business objects which are popupated from DB2 tables.

The business requirements are: 

In the Order Detail grid, the Quantity is displayed in a text box.  I am using

RadNumericTextBox in a GridTemplateColumn.

The user can update the Quantity on the Order Detail grid and click the Save button to save the Order Detail.  This Save button is displayed in the Order Detail NestedViewTemplate.

The user can update one Order Detail at a time which mean when he/she expands other Order node, the web page needs to display an alert or confirm to prompt the user to save the updated Quantity before expanding the next Order detail.

 

 

 


When the user expands the Customer Order node, I am retrieving and setting the datasource of the Order Detail grid in the RadGrid1_ItemCommand event handler.  Could someone please tell me is there a way to display an alert or confirm to prompt the user to save the updated Quantity before expanding the next Order detail?  Why does OnHierarchyExpanding client event requires HierarchyLoadMode="Client"?  I am not allowed to use databinding on the client side.

Thanks for your help!

 

Pavlina
Telerik team
 answered on 09 Apr 2012
3 answers
130 views
hi have a radtextbox with emptymessage it was working good until we update to the new version of telerik, now it looks weird, teh emptymessage exceeds the textbox and in the design it looks as i having to textbox how can i fix this???
Galin
Telerik team
 answered on 09 Apr 2012
1 answer
183 views
Hi All,

Is it possible to create a slider with logarithmic scale?

Anybody has experience with this?

Thnks.Marc
Slav
Telerik team
 answered on 09 Apr 2012
2 answers
155 views
I trying to reproduce this following scenario : I have 1 button(btnTest) outside an asp updatePanel, inside then i have 2 rad notifications, i have other as update panel with 2 radtextBox and 1 button(btnInsert), what i want is: i will click on the btnTest it will show 'Start Processing', and when done(after 8 seconds), appears 'Done!' (OK, this works), but lets suppose that i click on button, the Start Processing appears, and while the request running(doesnt appear 'Done!' yet), i click on the btnInsert, so i wanna the btnInsert, do what he need to do, and the request of btnTest keep running. Why my actual code doesnt work for that? Can someone point me to right direction, or help me provide a code?

thanzk
the asp code
<form id="form1" runat="server">
<telerik:RadScriptManager ID="Script" runat="server" />
<div id="divPrincipal">
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            function Start() {
                var notification = $find('<%= RadNotification1.ClientID %>');
                notification.show();
            }
        </script>
    </telerik:RadCodeBlock>
    <telerik:RadButton ID="btnTeste" runat="server" Text="Teste" OnClick="btnTeste_Click" OnClientClicked="Start" />
    <asp:UpdatePanel ID="updNotificacao" UpdateMode="Conditional" runat="server" ChildrenAsTriggers="false">
        <ContentTemplate>
            <telerik:RadNotification ID="RadNotification1" runat="server" EnableRoundedCorners="true"
                EnableShadow="true" Text="Começou a Processar" Title="Mensagem" Width="300" Height="100" />
            <telerik:RadNotification ID="RadNotification2" runat="server" EnableRoundedCorners="true"
                EnableShadow="true" Text="Execucao Concluida" Title="Mensagem" Width="300" Height="100" />
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btnTeste" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>
    <asp:UpdatePanel runat="server" ID="updForm" UpdateMode="Conditional" ChildrenAsTriggers="false">
        <ContentTemplate>
            <table>
                <tr>
                    <td>Codigo:</td>
                    <td>
                        <telerik:RadTextBox ID="txtNome" runat="server" TextMode="SingleLine" />
                    </td>
                </tr>
                <tr>
                    <td>Descricao:</td>
                    <td>
                        <telerik:RadTextBox ID="txtDescricao" runat="server" TextMode="SingleLine" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <telerik:RadButton ID="btnInserir" Text="Inserir" runat="server" OnClick="btnInserir_Click" />
                        <asp:Label Text="" ID="lblResultado" runat="server" />
                    </td>
                </tr>
            </table>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btnInserir" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>
</div>
</form>

the .cs code
protected void btnTeste_Click(object sender, EventArgs e)
{
    Task task = Task.Run(() =>
    {
        Thread.Sleep(8000);
        RadNotification2.Text = "Execução Concluída!";
        RadNotification2.Show();
    });
    task.Wait();
}
 
protected void btnInserir_Click(object sender, EventArgs e)
{
    C001 c = new C001();
    int i = c.RegistrarDados(txtDescricao.Text);
 
    if (i != 0)
    {
        lblResultado.Text = "Registro Inserido!";
    }
    else
    {
        lblResultado.Text = "Registro nao pode ser Inserido!";
    }
    updForm.Update();
}

In this actual scenario, if i click on the second button while the request of first button still running, apparently, the first request is canceled, because the msg of my radNotificaion will never appears.
Bruno
Top achievements
Rank 1
 answered on 09 Apr 2012
3 answers
294 views
Why does this line of code:
<telerik:RadAjaxLoadingPanel ID="InvDateLoadPanel" runat="server" ForeColor="#EEB211" BackImageUrl="~/images/ajax/BMGI_GoldLoading.gif" BackgroundPosition="Center" />

Produce 4 loading images across my loading panel??

Full code for Ajax Manager:
<telerik:RadAjaxManager ID="AjxMgr" runat="server">
 
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="pnl_InvDate">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="pnl_InvDate" LoadingPanelID="InvDateLoadPanel" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
 
    </telerik:RadAjaxManager>

and the control:
<asp:Panel ID="pnl_InvDate" runat="server">
     <table id="tbl_InvDate" border="0" cellpadding="4" cellspacing="0">
          <tr>
               <td>Invoice Date</td>
               <td>
                    <telerik:RadDatePicker ID="rdt_InvDate" runat="server" Skin="Hay" AutoPostBack="true" ShowPopupOnFocus="true" Width="100" OnSelectedDateChanged="selected" />
               </td>
          </tr>
   </table>
</asp:Panel>

Controls version: 2012.1.301.40

TIA
JB
Eyup
Telerik team
 answered on 09 Apr 2012
0 answers
154 views
Hello,
I am embeding DetailsView inside Telerik gridview.Now I want to bind Detailsview according to rowIndex of GridView.

Below are the code
.aspx page
---------------------------------------------------

<%

 

@ Page Language="C#" AutoEventWireup="true" CodeFile="G1.aspx.cs" Inherits="G1" %>

 

<%

 

@ Register TagPrefix="telerik" Namespace="Telerik.Charting" Assembly="Telerik.Web.UI" %>

 

<%

 

@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>

 

<!

 

 

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 id="Head1" runat="server">

 

 

 

 

<!-- custom head section -->

 

 

 

<style type="text/css">

 

 

 

.viewWrap

 

{

 

 

padding: 15px;

 

 

 

background: #2291b5 0 0 url(Img/bluegradient.gif) repeat-x;

 

}

 

 

 

.contactWrap

 

{

 

 

padding: 10px 15px 15px 15px;

 

 

 

background: #fff;

 

 

 

color: #333;

 

}

 

 

 

.contactWrap td

 

{

 

 

padding: 0 20px 0 0;

 

}

 

 

 

.contactWrap td td

 

{

 

 

padding: 3px 20px 3px 0;

 

}

 

 

 

.contactWrap img

 

{

 

 

border: 1px solid #05679d;

 

}

 

 

</style>

 

 

 

<!-- end of custom head section -->

 

</

 

 

head>

 

<

 

 

body>

 

 

 

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

 

 

 

<div>

 

 

 

<telerik:RadScriptManager runat="server" ID="RadScriptManager1" />

 

 

 

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

 

 

 

<AjaxSettings>

 

 

 

<telerik:AjaxSetting AjaxControlID="RadGrid1">

 

 

 

<UpdatedControls>

 

 

 

<telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />

 

 

 

</UpdatedControls>

 

 

 

</telerik:AjaxSetting>

 

 

 

</AjaxSettings>

 

 

 

</telerik:RadAjaxManager>

 

 

 

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />

 

<%

 

-- DataSourceID="SqlDataSource1"--%>

 

 

 

<telerik:RadGrid ID="RadGrid1" OnPreRender="RadGrid1_PreRender"

 

 

 

runat="server" AutoGenerateColumns="False" AllowSorting="True" AllowMultiRowSelection="False"

 

 

 

AllowPaging="True" PageSize="5" GridLines="None" ShowGroupPanel="true" OnItemCreated="RadGrid1_ItemCreated"

 

 

 

OnItemCommand="RadGrid1_ItemCommand">

 

 

 

<PagerStyle Mode="NumericPages"></PagerStyle>

 

<%

 

-- DataSourceID="SqlDataSource1"--%>

 

 

 

<MasterTableView DataKeyNames="SrNo" AllowMultiColumnSorting="True"

 

 

 

GroupLoadMode="Server">

 

 

 

<NestedViewTemplate>

 

 

 

<asp:Panel runat="server" ID="InnerContainer" CssClass="viewWrap" Visible="false">

 

 

 

<telerik:RadTabStrip runat="server" ID="TabStip1" MultiPageID="Multipage1" SelectedIndex="0">

 

 

 

<Tabs>

 

 

 

<telerik:RadTab runat="server" Text="Comment" PageViewID="PageView2">

 

 

 

</telerik:RadTab>

 

 

 

</Tabs>

 

 

 

</telerik:RadTabStrip>

 

 

 

<telerik:RadMultiPage runat="server" ID="Multipage1" SelectedIndex="0" RenderSelectedPageOnly="false">

 

 

 

<telerik:RadPageView runat="server" ID="PageView2" Width="460px">

 

 

 

 

<div class="contactWrap">

 

 

 

<table cellpadding="0" cellspacing="0">

 

 

 

<tr>

 

 

 

<td>

 

 

 

<asp:Label ID="Label1" Font-Bold="true" Font-Italic="true" Text='<%# Eval("SrNo") %>'

 

 

 

Visible="false" runat="server" />

 

 

 

<asp:DetailsView ID="DetailsView1" DataSourceID="SqlDataSource4" AllowPaging="true" GridLines="None" Width="100%"

 

 

 

runat="server" Font-Italic="true" AutoGenerateRows="false">

 

 

 

<Fields>

 

<%

 

-- <asp:BoundField DataFormatString="{0:MM/dd/yyyy}" HeaderText="BirthDate:" HtmlEncode="false"

 

DataField="BirthDate" HeaderStyle-Font-Italic="false" HeaderStyle-Font-Bold="true" />--

 

 

%>

 

 

 

<asp:BoundField HeaderText="Comment" DataField="Comment" HeaderStyle-Font-Italic="false"

 

 

 

HeaderStyle-Font-Bold="true" />

 

 

 

</Fields>

 

 

 

</asp:DetailsView>

 

 

 

<asp:SqlDataSource ID="SqlDataSource4" ConnectionString="<%$ ConnectionStrings:db_TempConnectionString %>"

 

 

 

ProviderName="System.Data.SqlClient" SelectCommand="Select comment from tbApproveHistorical where comment ='first changes'"

 

 

 

runat="server">

 

 

 

<SelectParameters>

 

 

 

<asp:ControlParameter ControlID="Label1" PropertyName="Text" Type="String" Name="SrNo" />

 

 

 

</SelectParameters>

 

 

 

</asp:SqlDataSource>

 

 

 

</td>

 

 

 

</tr>

 

 

 

</table>

 

 

 

</div>

 

 

 

</telerik:RadPageView>

 

 

 

</telerik:RadMultiPage>

 

 

 

</asp:Panel>

 

 

 

</NestedViewTemplate>

 

 

 

<Columns>

 

<%

 

-- <telerik:GridTemplateColumn Visible="false">

 

<asp:Label ID="Label1" Font-Bold="true" Font-Italic="true" Text='<%# Eval("SrNo") %>'

Visible="false" runat="server" />

</telerik:GridTemplateColumn>--

 

 

%>

 

 

 

<telerik:GridBoundColumn SortExpression="SrNo" HeaderText="SrNo" HeaderButtonType="TextButton"

 

 

 

DataField="SrNo" UniqueName="SrNo" Visible="false">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn SortExpression="Period" HeaderText="Period" HeaderButtonType="TextButton"

 

 

 

DataField="Period" UniqueName="Period">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn SortExpression="Name" HeaderText="Name" HeaderButtonType="TextButton"

 

 

 

DataField="Name" UniqueName="Name">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn SortExpression="Date" HeaderText="Date" HeaderButtonType="TextButton"

 

 

 

DataField="Date" UniqueName="Date">

 

 

 

</telerik:GridBoundColumn>

 

 

 

</Columns>

 

 

 

</MasterTableView>

 

 

 

<ClientSettings AllowDragToGroup="true" />

 

 

 

</telerik:RadGrid>

 

<%

 

-- <asp:SqlDataSource ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:db_TempConnectionString %>"

 

ProviderName="System.Data.SqlClient" SelectCommand="SELECT ROW_NUMBER() OVER(ORDER BY AH.UpdatedOn DESC) As SrNo,

PC.PeriodContextRef AS Period,

(UR.UserFirstName + ' ' + UR.UserLastName) AS Name,

AH.Comment,

CONVERT(varchar,AH.UpdatedOn,101) AS [Date]

FROM tbApproveHistorical AH WITH(NOLOCK)

LEFT OUTER JOIN dbIndigo_Central.dbo.tbPeriodCont PC WITH(NOLOCK)

ON (AH.PeriodContextRefId = PC.PeriodContextRefId)

LEFT OUTER JOIN dbIndigo_Central.dbo.tbUser UR WITH(NOLOCK)

ON (AH.LoginId = UR.LoginId)

ORDER BY UpdatedOn DESC"

runat="server"></asp:SqlDataSource>--

 

 

%>

 

 

 

</div>

 

 

 

</form>

 

</

 

 

body>

 

</

 

 

html>

 

-------------------------------------------------------------------------
.cs file

using

 

 

System;

 

using

 

 

System.Collections.Generic;

 

using

 

 

System.Linq;

 

using

 

 

System.Web;

 

using

 

 

System.Web.UI;

 

using

 

 

Telerik.Web.UI;

 

using

 

 

System.Web.UI.WebControls;

 

public

 

 

partial class G1 : System.Web.UI.Page

 

{

 

 

//protected void RadChart1_ItemDataBound(object sender, Telerik.Charting.ChartItemDataBoundEventArgs e)

 

 

 

//{

 

 

 

// e.SeriesItem.Name = (string)DataBinder.Eval(e.DataItem, "pName");

 

 

 

//}

 

 

 

 

protected void Page_Load(object sender, EventArgs e)

 

{

 

 

clsGetData obj = new clsGetData();

 

RadGrid1.DataSource = obj.GetData();

RadGrid1.MasterTableView.DataKeyNames =

 

new string[] { "SrNo" };

 

RadGrid1.MasterTableView.DataSource = obj.GetData();

 

}

 

 

protected void RadGrid1_PreRender(object sender, EventArgs e)

 

{

 

 

if (!Page.IsPostBack)

 

{

RadGrid1.MasterTableView.Items[0].Expanded =

 

true;

 

RadGrid1.MasterTableView.Items[0].ChildItem.FindControl(

 

"InnerContainer").Visible = true;

 

}

}

 

 

protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)

 

{

 

 

if (e.CommandName == RadGrid.ExpandCollapseCommandName && e.Item is GridDataItem)

 

{

((

 

GridDataItem)e.Item).ChildItem.FindControl("InnerContainer").Visible =

 

!e.Item.Expanded;

}

 

 

 

 

//clsGetData obj = new clsGetData();

 

 

 

//((GridDataItem)e.Item).ChildItem.FindControl("DetailsView1").DataSource = obj.GetData();

 

 

 

// ((GridDataItem)e.Item).ChildItem.FindControl("DetailsView1").DataBind();

 

 

 

//if (((GridDataItem)e.Item).ChildItem.FindControl("DetailsView1").ClientID=="")

 

 

 

//{ }

 

}

 

 

 

protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)

 

{

 

 

if (e.Item is GridNestedViewItem)

 

{

e.Item.FindControl(

 

"InnerContainer").Visible = ((GridNestedViewItem)e.Item).ParentItem.Expanded;

 

}

}

}


Thanks for any help
Satyajit Kadam.
Satyajit
Top achievements
Rank 1
 asked on 09 Apr 2012
1 answer
98 views
I want to hide >> and << button in  calendar and align the button added in the footertemplate to center?
Princy
Top achievements
Rank 2
 answered on 09 Apr 2012
2 answers
126 views
Guys i want to replace grid built in icon for next page that is > and prev page is <
which i have done as 
PagerTextFormat="Välj sida: <a onclick='javascript:openPreviousPage();'><img src='../Images/newimages/left_singel_arrow.png' style='cursor:pointer;' title='Previous' /></a> {4} <a onclick='javascript:openNextPage();'><img src='../Images/newimages/right_singel_arrow.png' style='cursor:pointer;' title='Next' /></a> &nbsp;&nbsp; Visar sida {0} av {1}, post {2} till {3} av {5}"

then i have hide the > and < as 
GridPagerItem pager = (GridPagerItem)e.Item;            
            hdnPageCount.Value = pager.Paging.PageCount.ToString();            
            pager.PagerContentCell.Controls[1].Visible = false; //&lt if page count = 5                        
            if (pager.Paging.PageCount <= 5)
            {
                if (pager.Paging.PageCount == 1)
                {
                    pager.PagerContentCell.Controls[5].Visible = false;//&gt if page count=1 then it is on 5
                }
                if (pager.Paging.PageCount == 2)
                {
                    pager.PagerContentCell.Controls[7].Visible = false;//&gt if page count=2 then it is on 7
                }
                if (pager.Paging.PageCount == 3)
                {
                    pager.PagerContentCell.Controls[9].Visible = false; //&gt if page count=3 then it is on 9
                }
                if (pager.Paging.PageCount == 4)
                {
                    pager.PagerContentCell.Controls[11].Visible = false; //&gt if page count=4 then it is on 9
                }
                if (pager.Paging.PageCount == 5)
                {
                    pager.PagerContentCell.Controls[13].Visible = false;//&gt if page count = 5 then 13 
                }                                
            }
but the problem is that  when there are thousands of pages, it is impossible to get pager control index.
how to hide parmanently &gt and &lt from pagerStyle.?????
Note: i have used my own Next Page and Prev Page images instead of built in <, > 
Nasir
Top achievements
Rank 1
 answered on 09 Apr 2012
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?