Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
230 views
Hello,

I have a data export screen which is exporting about 30,000 records in one scenario.  In this scenario, the data query takes about 2-3 seconds from the database when we run it in SQL, but it's taking 3-7 minutes to generate the Excel file.  In my page, I bind the grid when I have the results and the page spins while it generates the Excel file.

I'm generating the excel file from code via:

this

.rgResults.DataSource = set.Tables[0];

this.rgResults.DataBind();

this.rgResults.MasterTableView.ExportToExcel();


So I'm binding a data table.  The grid is statically on the page.  The UI of the grid is generated using AutoGenerateColumns, so I'm using whatever columns are there.  Getting the data from the adapter into the table is fast, so that isn't the issue.  The issue is the rendering of the data.

Can I speed that up somehow?  Or how can I debug this?  What might be affecting the slowness?  Is it just related to the amount of data?

Thanks.
Brian Mains
Top achievements
Rank 1
 answered on 05 Mar 2010
4 answers
368 views
I'm trying to accomplish a few things - and I can't get the last 20%.

I have a RadTabStrip (& MultiPage), a RadGrid and a button on my page.  Currently if you click the button, it will (via client-side JavaScript function), switch to the 2nd tab, set the RadGrid to insert a new record, and focus on the first box.

What I'd like to do is to populate a few of the RadTextBoxes with some values (which were passed to the function when the button was clicked).  However, since the process to change the RadGrid so that it can insert a new record is a server-side hit...I can't figure out how to do this.

Suggestions?
Kris
Top achievements
Rank 1
 answered on 05 Mar 2010
4 answers
682 views
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateEditColumn="True" DataSourceID="SqlDataSource1" 
    GridLines="None" PageSize="15" OnItemDataBound="RadGrid1_ItemDataBound" AllowPaging="True" 
    OnItemCreated="RadGrid1_ItemCreated" AllowSorting="True" Skin="Vista" OnItemCommand="RadGrid1_ItemCommand" 
    OnPreRender="RadGrid1_PreRender" AllowAutomaticUpdates="True" >  
    <MasterTableView AutoGenerateColumns="False" DataSourceID="SqlDataSource1" DataKeyNames="ticket_id, id" 
        CommandItemDisplay="Top"> 
        <CommandItemTemplate> 
            <table> 
                <tr> 
                    <td> 
                        <asp:ImageButton ImageUrl="~/image/AddRecord.gif" ID="btnAllTickets" runat="server" 
                            CommandName="AllFiles" /> 
                        All Tickets 
                    </td> 
                    <td> 
                        <asp:ImageButton ImageUrl="~/image/AddRecord.gif" ID="btnUnansweredTickets" runat="server" 
                            CommandName="Unanswered" /> 
                        Unanswered Tickets </asp:LinkButton> 
                    </td> 
                </tr> 
            </table> 
        </CommandItemTemplate> 
        <RowIndicatorColumn> 
            <HeaderStyle Width="20px"></HeaderStyle> 
        </RowIndicatorColumn> 
        <ExpandCollapseColumn> 
            <HeaderStyle Width="20px"></HeaderStyle> 
        </ExpandCollapseColumn> 
        <Columns> 
            <telerik:GridBoundColumn DataField="id" HeaderText="id" SortExpression="id" UniqueName="id" 
                DataType="System.Int64" Visible="false"> 
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="t_id" HeaderText="t_id" ReadOnly="True" 
                SortExpression="ticket_id" UniqueName="ticket_id" Visible="false"> 
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="username" HeaderText="Username" SortExpression="username" 
                UniqueName="username"> 
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="subject" HeaderText="Subject" SortExpression="subject" 
                UniqueName="subject"> 
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="department" HeaderText="department" SortExpression="department" 
                UniqueName="department" Visible="false"> 
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="priority" DataType="System.Int32" HeaderText="priority" 
                SortExpression="priority" UniqueName="priority" Visible="false"> 
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="status" HeaderText="status" SortExpression="status" 
                UniqueName="status" DataType="System.Int32" Visible="false"> 
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="last_replier" HeaderText="last_replier" SortExpression="last_replier" 
                UniqueName="last_replier" Visible="false"> 
            </telerik:GridBoundColumn> 
        </Columns> 
        <DetailTables> 
           
            <telerik:GridTableView DataKeyNames="ticket_id, id" DataSourceID="SqlDataSource2" 
                Width="100%" runat="server" AutoGenerateColumns="false" OnSelectedIndexChanged="RadGrid1_SelectedIndexChanged"> 
                <ParentTableRelation> 
                    <telerik:GridRelationFields DetailKeyField="ticket_id" MasterKeyField="ticket_id" /> 
                </ParentTableRelation> 
                <Columns> 
                    <telerik:GridBoundColumn DataField="id" Visible="false" HeaderText="ID" ReadOnly="True" 
                        SortExpression="id" UniqueName="id"> 
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="ticket_id" HeaderText="ticket_id" Visible="False" 
                        ReadOnly="True" SortExpression="ticket_id" UniqueName="ticket_id"> 
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="tdate" HeaderText="Date" UniqueName="tdate"> 
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="message" HeaderText="Message" UniqueName="message"> 
                    </telerik:GridBoundColumn> 
                </Columns> 
                 <DetailTables> 
                 
                    <telerik:GridTableView DataSourceID="SqlDataSource3" Width="100%" DataKeyNames="ticketChildID" Name="ThirdTable" 
                        runat="server"  AutoGenerateColumns="False" CommandItemDisplay="Top" oninsertcommand="RadGrid1_InsertCommands"> 
                        <ParentTableRelation> 
                            <telerik:GridRelationFields DetailKeyField="id" MasterKeyField="ticket_id" /> 
                        </ParentTableRelation> 
                        <EditFormSettings EditFormType="Template" > 
                           
                            <FormTemplate> 
         
                                    <telerik:RadUpload ID="radup1" runat="server" AllowedFileExtensions=".zip,.jpg,.jpeg" /> 
                                    </telerik:RadUpload> 
                                    <asp:Button ID="b1" runat="server"  Text="Upload" CommandName="InsertForm" /> 
                      
                            </FormTemplate> 
                            <PopUpSettings ScrollBars="None" /> 
                        </EditFormSettings> 
                       <Columns> 
                        <telerik:GridBoundColumn DataField="filetitle" HeaderText="Attachment" UniqueName=" filetitle"> 
                    </telerik:GridBoundColumn> 
                       </Columns> 
                    </telerik:GridTableView> 
                </DetailTables> 
            </telerik:GridTableView> 
        </DetailTables> 
    </MasterTableView> 
</telerik:RadGrid> 
protected void RadGrid1_PreRender(object sender, EventArgs e) 
    { 
            for (int i = 0; i < RadGrid1.MasterTableView.Items.Count; i++) 
            { 
                RadGrid1.MasterTableView.Items[i].Expanded = true; 
            } 
          
        
    } 

It only expand the first Detail Table. how do i expand all child detail table?
Schlurk
Top achievements
Rank 2
 answered on 05 Mar 2010
1 answer
212 views
Hi there,

I am trying to use the method to explicitly show/hide the loading panel. My code is:

<

 

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

 

 

<AjaxSettings>

 

 

<telerik:AjaxSetting AjaxControlID="btnImport">

 

 

<UpdatedControls>

 

 

<telerik:AjaxUpdatedControl ControlID="Panel5" LoadingPanelID="LoadingPanel1" />

 

 

</UpdatedControls>

 

 

</telerik:AjaxSetting>

 

 

</AjaxSettings>

 

 

<ClientEvents OnRequestStart="RequestStart" OnResponseEnd="ResponseEnd" />

 

 

</telerik:RadAjaxManager>

 

 

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

 

 

Skin="Vista">

 

 

</telerik:RadAjaxLoadingPanel>

 

 

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

 

 

<script type="text/javascript">

 

 

var currentLoadingPanel = null;

 

 

var currentUpdatedControl = null;

 

 

function RequestStart(sender, args) {

 

alert(

"Should Load");

 

currentLoadingPanel = $find(

"<%= RadAjaxLoadingPanel1.ClientID %>");

 

 

if (args.get_eventTarget() == "<%= btnImport.UniqueID %>") {

 

currentUpdatedControl =

"<%= Panel5.ClientID %>";

 

}

 

 

 

 

//show the loading panel over the updated control

 

currentLoadingPanel.show(currentUpdatedControl);

}

 

function ResponseEnd() {

 

 

//hide the loading panel and clean up the global variables

 

 

if (currentLoadingPanel != null)

 

currentLoadingPanel.hide(currentUpdatedControl);

currentUpdatedControl =

null;

 

currentLoadingPanel =

null;

 

}

 

</script>

 

 

</telerik:RadCodeBlock>

And I try and call it by:

 

RadAjaxManager1.ResponseScripts.Add(

"RequestStart();");

But i can't get it to show.
Can someone help figure out what Im doing wrong?

Thanks

 

robertw102
Top achievements
Rank 1
 answered on 05 Mar 2010
3 answers
852 views
I am having an issue trying to get the RadComboBox's Selected Value on the SelectedIndexChanged event.  The odd thing is that during the SelectedIndexChanged event when I check e it has the old value (e.OldValue) and the old text (e.OldText) but the e text (e.Text) shows up correctly but the e.Value turns to null or "".  Why is my selected value turning to an empty string/null on SelectedIndexChange?


See my code below.  Thanks for any help.
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SCRDropDown.ascx.cs" Inherits="AMC.OnlineSCR.Web.UserControls.SCRDropDown" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<link href="../stylesheets/tkComboBox.css" rel="stylesheet" type="text/css" /> 
<!-- content start --> 
<asp:Label runat="server"  
    ID="lblSelectASCR"  
    AssociatedControlID="cbSelectASCR" 
    Text="Select A SCR:" /> 
 
<telerik:RadComboBox  
    runat="server" 
    AutoPostBack="true"  
    ID="cbSelectASCR"  
    DataTextField="SCR_NUMBER" 
    EnableLoadOnDemand="True" 
    Width="670px"  
    Height="190px" 
    HighlightTemplatedItems="true"  
    OnDataBound="cbSelectASCR_DataBound"  
    OnItemDataBound="cbSelectASCR_ItemDataBound" 
    OnSelectedIndexChanged="cbSelectASCR_SelectedIndexChanged" 
    OnItemsRequested="cbSelectASCR_ItemsRequested"> 
    <HeaderTemplate> 
        <ul> 
            <li class="col1">SCR Number</li> 
            <li class="titleCol">Title</li> 
            <li class="col3">Status</li> 
            <li class="col1">Date Submitted</li> 
        </ul> 
    </HeaderTemplate> 
    <ItemTemplate> 
        <ul> 
            <li class="col1"> 
                <%# DataBinder.Eval(Container.DataItem, "SCR_NUMBER") %></li> 
            <li class="titleCol"> 
                <%# DataBinder.Eval(Container.DataItem, "TITLE") %></li> 
            <li class="col3"> 
                <%# DataBinder.Eval(Container.DataItem, "STATUS_NAME") %></li> 
            <li class="col1"> 
                 <%# DataBinder.Eval(Container.DataItem, "DATE_OF_SUBMITTAL", "{0:dd MMM yyyy}") %></li> 
        </ul> 
    </ItemTemplate> 
    <FooterTemplate> 
        A total of 
        <asp:Literal runat="server" ID="cbSelectASCRCount" /> 
        items 
    </FooterTemplate> 
</telerik:RadComboBox> 
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; 
using System.Data; 
using System.IO; 
using AMC.OnlineSCR.BusinessLayer.BusinessObjects; 
using AMC.OnlineSCR.BusinessLayer.Facade; 
using AMC.OnlineSCR.Web.Components; 
 
namespace AMC.OnlineSCR.Web.UserControls 
{ 
    public partial class SCRDropDown : System.Web.UI.UserControl 
    { 
        private ISCRMainDataFacade SCRMainFacade = new SCRMainDataFacade(); 
        int m_SCRID; 
 
        public int SCRID 
        { 
            get { return m_SCRID; } 
            set { m_SCRID = value; } 
        } 
 
        protected void Page_Load(object sender, EventArgs e) 
        { 
            DataSet ds = SCRMainFacade.GetMiniSCRAll(); 
            cbSelectASCR.DataSource = ds; 
            cbSelectASCR.DataBind(); 
        } 
 
        protected void cbSelectASCR_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) 
        { 
            SCRID = Convert.ToInt16(e.Value.ToString()); 
            //SCRID = ((DataRowView)e.Item.DataItem)["SCR_NUMBER"].ToString(); 
        } 
 
        protected void cbSelectASCR_DataBound(object sender, EventArgs e) 
        { 
            //set the initial footer label 
            ((Literal)cbSelectASCR.Footer.FindControl("cbSelectASCRCount")).Text = Convert.ToString(cbSelectASCR.Items.Count); 
        } 
 
        protected void cbSelectASCR_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e) 
        { 
            //get all customers whose name starts with e.Text 
            DataSet ds = SCRMainFacade.GetMiniSCRAllLike(e.Text); 
            cbSelectASCR.DataSource = ds; 
            cbSelectASCR.DataBind(); 
        } 
 
        protected void cbSelectASCR_ItemDataBound(object sender, RadComboBoxItemEventArgs e) 
        { 
            //set the Text and Value property of every item 
            //here you can set any other properties like Enabled, ToolTip, Visible, etc. 
            e.Item.Text = (((DataRowView)e.Item.DataItem)["SCR_NUMBER"].ToString()) + " - " + (((DataRowView)e.Item.DataItem)["TITLE"].ToString()); 
            e.Item.Value = ((DataRowView)e.Item.DataItem)["SCR_ID"].ToString(); 
        } 
    } 
} 

Stephen Kumor
Top achievements
Rank 1
 answered on 05 Mar 2010
2 answers
135 views
Hi
I have OnClientClick set to some dynamic js on a RadGrid and it is to calls js in a RadScriptBlock.  But it does not work.  I take the js out of the RadScriptBlock and then it works.  What is the problem?
Phil
Phil
Top achievements
Rank 2
 answered on 05 Mar 2010
2 answers
121 views
The following video will show you how links working in radpane. The content result will not show in the radpane but the in the new whole page. Is that a bug or the web page problem?
http://www.youtube.com/watch?v=_tvz1WvC8YA
Stephen Lam
Top achievements
Rank 1
 answered on 05 Mar 2010
1 answer
131 views
Hi,

I have one page that contains radAjaxPanel needing custom client settings from the UC loaded. Exist some way to get the RadAjaxPanel from the loded usercontrol similar to RadAjaxManager ajaxManager = RadAjaxManager.GetCurrent(this.Page) to register from the UC events like ClientEvents-OnRequestStart and prevent ajax troubles using RadUploader.

Romi
Pierre
Top achievements
Rank 1
 answered on 05 Mar 2010
2 answers
147 views
Hello,

I'm a new customer of Telerik and I'm using the ListBox tool for the first time.  When I add items to the ListBox they're displayed with about 20 pixels of padding along the left-edge.

It looks like this:
http://screencast.com/t/ZjM0NTUzMDIt

How do I adjust that?  At first I thought the ListBoxItems needed to have "Checkable" set to false, but that didn't do the trick. 

Other suggestions?

Thanks,

Michael
Michael Markham
Top achievements
Rank 1
 answered on 05 Mar 2010
1 answer
104 views
Hi,
   There are cases when the grid is sorted. In that request, i dont want to go to the database.
   How ever, when the refresh button is pressed or the grid is loaded for the first time, I want to go to the database.

   How can i identify the difference between these 2 requests.

Currently the signature of the function is

public

 

static List<Employee> getAllEmployee(string sortExpression)
{..}
comming from object datasource mapped to the grid

 

<asp:ObjectDataSource ID="dsEmployee" runat="server" SelectMethod="getAllEmployee" 
        TypeName="Employee" DataObjectTypeName="Employee" 
        SortParameterName="sortExpression"></asp:ObjectDataSource> 

Daniel
Telerik team
 answered on 05 Mar 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?