Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
104 views
I have used example of grid virtual scrolling with client-side binding from this website. My RadGrid is disappearing for sometime whenever I pull the scroll down but come back to normal in 1 or 2 secs. Rest of the behaviour is fine except my grid disappears to fetch the data.

Below is my aspx page:
<%@ Page Title="" Language="C#" MasterPageFile="~/Secure/Secure.Master" AutoEventWireup="true"CodeBehind="~/App_code/CSCode/DueForDispose.aspx.cs" Inherits="CSAuctionUI.Units.DueForDispose" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
  </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnablePageMethods="true">
    </telerik:RadScriptManager>
  <telerik:RadAjaxLoadingPanel ID="LoadingPanel" runat="server"></telerik:RadAjaxLoadingPanel>
      
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
  
        <script type="text/javascript">
        //<![CDATA[
  
            function pageLoad(sender, args) {
                toggleLoadingPanel("<%= RadGrid1.ClientID %>", true);
            }
  
            function showLoadingPanel(sender, args) {
                toggleLoadingPanel(sender.get_id(), true);
            }
  
            function hideLoadingPanel(sender, args) {
                toggleLoadingPanel(sender.get_id(), false);
            }
  
            function toggleLoadingPanel(elementId, show) {
                var loadingPanel = $find("<%=LoadingPanel.ClientID %>");
                if (show) {
                    loadingPanel.show(elementId);
                }
                else {
                    loadingPanel.hide(elementId);
                }
            }
  
            function handleScrolling(sender, args) {
                //check if the items are scrolled to bottom and get additional items
                if (args.get_isOnBottom()) {
                    var master = sender.get_masterTableView();
                    if (master.get_pageSize() < master.get_virtualItemCount()) {
                        //changing page size causes automatic rebind
                        master.set_pageSize(master.get_pageSize() + 20);
                    }
                }
            }
            //]]>
  
        </script>
  
    </telerik:RadCodeBlock>
  
  
<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" PageSize="20" 
        CellSpacing="0" GridLines="None" Skin="Office2007">
        <PagerStyle Visible="false" />
        <MasterTableView TableLayout="Fixed">
            <Columns>
                <telerik:GridBoundColumn DataField="Sno" />
                <telerik:GridBoundColumn DataField="Unit_gkey" />
                <telerik:GridBoundColumn DataField="Unit_nbr"  />
                <telerik:GridBoundColumn DataField="Pkey"/>
                <telerik:GridBoundColumn DataField="Last_notice_sent" DataFormatString="{0:d}" />
                <telerik:GridBoundColumn DataField="Last_notice_id_sent" />
                <telerik:GridBoundColumn DataField="Category"/>
                <telerik:GridBoundColumn DataField="Bl_nbr" />
                <telerik:GridBoundColumn DataField="Ib_carrier"/>
            </Columns>
        </MasterTableView>
        <ClientSettings>
            <Scrolling AllowScroll="true" UseStaticHeaders="true"/>
            <ClientEvents 
                OnScroll="handleScrolling" 
                OnCommand="showLoadingPanel"
                OnDataBound="hideLoadingPanel" />
            <DataBinding Location="DueForDispose.aspx" SelectMethod="GetBl" SelectCountMethod="GetBlCount"
                StartRowIndexParameterName="startRowIndex" MaximumRowsParameterName="maxRows" />
        </ClientSettings>
    </telerik:RadGrid>
      
       
  
    <telerik:RadAjaxManager OnAjaxRequest="RadAjaxManager1_AjaxRequest" DefaultLoadingPanelID="LoadingPanel" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" 
                        LoadingPanelID="LoadingPanel" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
      
       
  
</asp:Content>

Below is my code:
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 Telerik.Web;
using System.Web.Services;
using Oracle.DataAccess.Client;
using PICT.Auction.DAL;
using System.Data;
  
namespace CSAuctionUI.Units
{
    public partial class DueForDispose : System.Web.UI.Page
    {
  
       
        protected void RadAjaxManager1_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)
        {
            if (e.Argument == "Rebind")
            {
                RadGrid1.MasterTableView.SortExpressions.Clear();
                RadGrid1.MasterTableView.GroupByExpressions.Clear();
                Response.Redirect(@"~/Secure/CustomerSupport/Auction/Units/DueForDispose.aspx");
                  
            }
        }
         
       
        [WebMethod]
        public static int GetBlCount()
        {
            return 200;
        
  
          
        [WebMethod]
        public static IEnumerable<Unit> GetBl(int startRowIndex, int maxRows)
        {
            string select = @"SELECT * FROM ( SELECT ROW_NUMBER() OVER (ORDER BY PKEY) AS ROW_NUMBER, auc.UNIT_GKEY,U.ID UNIT_NBR, AUC.PKEY, 
  
auc.LAST_NOTICE_SENT,AUC.LAST_NOTICE_ID_SENT ,DECODE(U.CATEGORY,'IMPRT','IMPORT') CATEGORY ,U.BL_NBR,U.IB_CARRIER FROM PACCS.CS_AUC_DES_UNITS 
  
auc,PACCS.VUE_AUC_DES_UNITS U where AUC.UNIT_GKEY = U.GKEY and AUC.DISPOSE_STATE ='DUE' and U.BL_NBR is not null ) foo WHERE ROW_NUMBER > :StartIndex AND 
  
ROW_NUMBER <= :EndIndex";
  
            Dictionary<string, object> parameters = new Dictionary<string, object>();
            parameters["StartIndex"] = Math.Max(startRowIndex, 0);
            parameters["EndIndex"] = Math.Max(startRowIndex + maxRows, maxRows);
            DBCommand cmd = new DBCommand();
  
            DataTable data = ExecuteSelect(select, parameters, cmd.ConnSettings.ConnectionString);
  
            foreach (DataRow row in data.Rows)
            {
                Unit u = new Unit();
                u.Sno = long.Parse(row["ROW_NUMBER"].ToString());
                u.Unit_gkey =long.Parse(row["UNIT_GKEY"].ToString()) ;
                u.Unit_nbr = row["UNIT_NBR"].ToString();
                u.Pkey = long.Parse(row["PKEY"].ToString());
                if(!string.IsNullOrEmpty(row["LAST_NOTICE_SENT"].ToString()))
                u.Last_notice_sent = DateTime.Parse(row["LAST_NOTICE_SENT"].ToString());
                u.Last_notice_id_sent = row["LAST_NOTICE_ID_SENT"].ToString();
                u.Category = row["CATEGORY"].ToString();
                u.Bl_nbr = row["BL_NBR"].ToString();
                u.Ib_carrier = row["IB_CARRIER"].ToString();
                yield return u;
            }
        }
  
        private static  DataTable ExecuteSelect(string selectCommand, Dictionary<string, object> parameters, string connectionString)
        {
            OracleConnection MyOraConnection = new OracleConnection(connectionString);
            OracleDataAdapter MyOraDataAdapter = new OracleDataAdapter();
  
            MyOraDataAdapter.SelectCommand = new OracleCommand(selectCommand, MyOraConnection);
              
            foreach (KeyValuePair<string, object> pair in parameters)
            {
                MyOraDataAdapter.SelectCommand.Parameters.Add(new OracleParameter(pair.Key, pair.Value));
            }
  
            DataTable data = new DataTable();
            MyOraConnection.Open();
  
            try
            {
                MyOraDataAdapter.Fill(data);
            }
  
            finally
            {
                MyOraConnection.Close();
            }
  
            return data;
        }
    public class Unit
    {
        private long sno;
        private long unit_gkey;
        private string unit_nbr ;
        private long pkey ;
        private DateTime last_notice_sent ;
        private string last_notice_id_sent ;
        private  string category ;
        private string bl_nbr ;
        private string ib_carrier;
  
        public long Sno
        {
            get { return sno; }
            set { sno = value; }
        }
        public long Unit_gkey
        {
            get { return unit_gkey; }
            set { unit_gkey = value; }
        }
        public string Unit_nbr
        {
            get { return unit_nbr; }
            set { unit_nbr = value; }
        }
        public long Pkey
        {
            get { return pkey; }
            set { pkey = value; }
        }
        public DateTime Last_notice_sent
        {
            get { return last_notice_sent; }
            set { last_notice_sent = value; }
        }
        public string Last_notice_id_sent
        {
            get { return last_notice_id_sent; }
            set { last_notice_id_sent = value; }
        }
        public string Category
        {
            get {return category; }
            set { category = value; }
        }
        public string Bl_nbr
        {
            get {return bl_nbr; }
            set { bl_nbr = value; }
        }
        public string Ib_carrier
        {
            get { return ib_carrier; }
            set { ib_carrier = value; }
        }
          
    }
  
    }
}

Thanks for reading my question.
Radoslav
Telerik team
 answered on 29 Feb 2012
2 answers
140 views
Hi,
I have recently updated telerik from Q3 2009 to Q1 2012, and i am facing some problems.
I have used for example document.getElementById('ctl00_PlaceHolderMain__rdtxtFirstName_text') to get the value of _rdtxtFirstName from client side.
but now when changed to Q1 2012, the id is showing ctl00_PlaceHolderMain__rdtxtFirstName insted of ctl00_PlaceHolderMain__rdtxtFirstName_text.
and i have used a css file to set the width of rad textbox and other controls, and now the controls' width is not showing as mentioned in css class.
How can i fix these issues?
Antonio Stoilkov
Telerik team
 answered on 29 Feb 2012
2 answers
273 views
HI,

I installed URL Rewrite module on IIS 7. After I added DB provider and outbound rule, RAD controls stop working, for instance, menu is not opening.
Underneath is copy of rewrite configuration section:
  
<rewrite>
  <providers>
    <provider name="Theme" type="DbProvider, Microsoft.Web.Iis.Rewrite.Providers, Version=7.1.761.0, Culture=neutral, PublicKeyToken=0545b0627da60a5f">
      <settings>
        <add key="ConnectionString" value="Data Source=.;Initial Catalog=db;Integrated Security=false;uid=sa;password=pass" />
        <add key="StoredProcedure" value="UrlTheme" />
        <add key="CacheMinutesInterval" value="10" />
      </settings>
    </provider>
  </providers>
  <rules>
    <clear />
    <rule name="ThemeRewrite">
      <match url="Theme/([a-z]{2,3})(?:[a-z\/]*)?" />
      <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
      <action type="Rewrite" url="theme.aspx?theme={R:1}" />
    </rule>
  </rules>
  <outboundRules>
    <clear />
    <rule name="Theme" enabled="true" stopProcessing="false">
      <match filterByTags="None" pattern="theme\.aspx\?theme=([a-z]{2,3})+" />
      <conditions logicalGrouping="MatchAll" trackAllCaptures="true">
        <add input="{Theme:{R:1}}" pattern="(.+)" />
      </conditions>
      <action type="Rewrite" value="Theme/{C:1}" />
    </rule>
  </outboundRules>
</rewrite>
Saeid Kdaimati
Top achievements
Rank 2
 answered on 29 Feb 2012
5 answers
146 views
Hello,

We have successfully deployed RadComboBox in production on SharePoint 2010 server.    The RadComboBox works fine in production and another one of our staging environments.  However in one of our staging environments, all our RadComboBoxes are not enabled.  We confirmed that Telerik.Web.UI and Telerik.Web.Design was in the GAC (Global Assembly Cache) of our SharePoint server.  We validated the web.config and confirmed SafeControls and handlers added.   When we attempt to load the pages we get the following:

Message: 'Sys' is undefined

Message: 'Type' is undefined

Message: Object doesn't support this property or method

Message: Object expected

Can you provide us with a suggestion to resolve our RadComboBox in the one environment?

Kalina
Telerik team
 answered on 29 Feb 2012
4 answers
118 views
I get the following Javascript error:
Error: Unable to set value of the property 'control': object is null or undefined
When I add a MultiPageView control to the <UpdatedControls> list in RadAjaxManager.

<telerik:AjaxSetting AjaxControlID="RadGridUser" >
<UpdatedControls>  

<telerik:AjaxUpdatedControl ControlID="RadMultiPage1"/>

</UpdatedControls>

</telerik:AjaxSetting>


On ItemSelected event of RadGridUser, I want to be able to refresh (content and selected page index) of the RadMultiPage control.

 
Maria Ilieva
Telerik team
 answered on 29 Feb 2012
1 answer
83 views
Hi All,

          I have a Rad-grid within the Rad-grid i have template-column where i used a literal control in item-plate and a rad combo box.I need to load the rad combo box during the update of each row i need to load the rad combo box dynamically. How to do this ? 

Thanks in Advance.
Princy
Top achievements
Rank 2
 answered on 29 Feb 2012
2 answers
72 views
Strange things are happening with RadButtons, IE9, and Visual Studio 2010.

I started a project and created a webform based on a master page. I added 4 radbuttons, 2 for users and 2 for admins.

The admin buttons are enabled=false and visible=false and will be enabled and visible if user is an admin. The user buttons are also disabled (still visible though) and the text is changed IF the user logged in is an admin.

Initial page load works as desired and if the page is refreshed it works as desired.

Now begins the bizarre behavior.

1. User loads the page and only sees the two user buttons (the admin buttons are invisible). Correct :)
2. User navigates off the page.
3. User clicks back button.
4. ALL 4 buttons are visible and all 4 buttons are in a state as if an admin is logged in. What?
5. Click refresh and all is fine.

Frustrated I started ripping my code apart to try and find where this was happening and nothing I am doing changes this behavior in the slightest. I went as far as completely removing ANY code for three of the buttons (they should not exist at all) and yet steps 2-5 above are the same every time. How can these buttons be on the page after clicking the back button on the browser when they no longer exist in my code? Where the heck are they coming from?
Slav
Telerik team
 answered on 29 Feb 2012
1 answer
54 views
Hi , if this is correct to find RadComboBox in PagerTemplate?
<PagerTemplate>
<telerik:RadComboBox ID="ddlMoveToFolder" Runat="server"
                                            EnableLoadOnDemand="False" EnableVirtualScrolling="false" 
                                            ShowMoreResultsBox="False"  >
                                            <Items>
                                                <telerik:RadComboBoxItem Text="Select Folder" Value="Select Folder" />
                                            </Items>
</telerik:RadComboBox> 
</PagerTemplate>

protected void grdMessage_PreRender(object sender, EventArgs e)
{
GridPagerItem pagerItem = (GridPagerItem)grdMessage.MasterTableView.GetItems(GridItemType.Pager)[0];
        RadComboBox customFolderDDL = (RadComboBox)pagerItem.FindControl("ddlMoveToFolder");
}
Shinu
Top achievements
Rank 2
 answered on 29 Feb 2012
4 answers
424 views
I've found quite a few threads talking about the Display and Visible properties of ExpandCollapseColumn. Several describe work-arounds for hiding this column, but none explain why 2 properties which the documentation says should show/hide the column seem to do nothing at all.

http://www.sitefinity.com/help/developer-manual/radgrid.net2-telerik.webcontrols.gridexpandcolumn_members.html 

Please, either make sure these properties do what the documentation says, or fix the documentation. I should not have to write code to do what the documentation says can be done by setting a property.

Thanks

Ross Crawford
Radoslav
Telerik team
 answered on 29 Feb 2012
3 answers
146 views
there is RadAjaxLoadingPanel which has radgrid.
after displaying duplicate message from server side using

 

ScriptManager.RegisterStartupScript(),grid does not retain the inline mode i.e. row for adding new record gets disappears.
is there any solution to retain inlin einsert mode after postback also.
i tried

 

e.Item.OwnerTableView.IsItemInserted = true;

 

 

 

RadGrid.Rebind()

but its not working

Pavlina
Telerik team
 answered on 29 Feb 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?