GridPanel with BufferedRenderer plugin do not display data

  1. #1

    GridPanel with BufferedRenderer plugin do not display data

    Hi all,

    I have a problem with the BufferedRenderer plugin. I have a UserControl which has a gridpanel inside. This gridpanel just displays data, no editing or sorting or filtering available there.
    Because I have a lot of data in this gridpanel (about 2500 records) I want to use the BufferedRenderer plugin. But if I enable this plugin no data will be displayed in the gridpanel.

    Here is my ascx:
    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Control1.ascx.cs" Inherits="MyWeb.UserControls.Control1" %>
    
    <script>
    
        var getRowClass1 = function (record) {
            if (record.data.RowType == "SummaryRow") {
                return "summary-row";
            }
    
            return "";
        };
    
    
    </script>
    
    <ext:Container ID="GemeindeEinzugsgebietContainer" runat="server">
        <LayoutConfig>
            <ext:VBoxLayoutConfig Align="Stretch" />
        </LayoutConfig>
    	<Items>
    		<ext:GridPanel ID="MyGridPanel" runat="server" Layout="AnchorLayout" MinHeight="200" SortableColumns="False" MarginSpec="20 0 0 0" EnableColumnHide="False" EnableColumnMove="False" >
    			<Store>
    				<ext:Store ID="MyStore" runat="server">
    					<Model>
    						<ext:Model runat="server" IDProperty="Id">
    			                <Fields>
    				                <ext:ModelField Name="Year" Type="String" />
    							    <ext:ModelField Name="Desc" Type="String" />
    								<ext:ModelField Name="Weight" Type="Float"  />
                                    <ext:ModelField Name="Population1" Type="Int" />
    				                <ext:ModelField Name="Population2" Type="Int" />
    				                <ext:ModelField Name="Total1" Type="Int" />
    				                <ext:ModelField Name="Total2" Type="Int" />
    				                <ext:ModelField Name="Part" Type="Float" />
                                    <ext:ModelField Name="RowType" Type="String" />
    							</Fields>
    						</ext:Model>
    					</Model>
    				</ext:Store>
    			</Store>
    			<ColumnModel runat="server">
    				<Columns>
                        <ext:Column runat="server" DataIndex="Year" MinWidth="50" Flex="1" Header="Year" Sortable="false" />
                        <ext:Column runat="server" DataIndex="Desc" MinWidth="80" Flex="2" Header="Desc" Sortable="false" />
                        <ext:Column runat="server" DataIndex="Population1" MinWidth="85" Align="Right" Flex="1" Header="Population1" Sortable="false" />
                        <ext:Column runat="server" DataIndex="Population2" MinWidth="85" Align="Right" Flex="1" Header="Population2" Sortable="false" />
                        <ext:Column runat="server" DataIndex="Total1" MinWidth="150" Align="Right" Flex="1" Header="Total1" Sortable="false" />
                        <ext:Column runat="server" DataIndex="Total2" MinWidth="210" Align="Right" Flex="1" Header="Total2" Sortable="false" />
                        <ext:Column runat="server" DataIndex="Part" MinWidth="85" Align="Right" Flex="1" Header="Part" Sortable="false" />
                        <ext:Column runat="server" DataIndex="Weight" MinWidth="85" Align="Right" Flex="1" Header="Weight" Sortable="false" />
    				</Columns>
    			</ColumnModel>
    			<View>
    				<ext:GridView runat="server" LoadMask="False" StripeRows="False">
    					<GetRowClass Fn="getRowClass1" />
                    </ext:GridView>
    			</View>
                <Plugins>
                    <ext:BufferedRenderer runat="server" />
                </Plugins>
    		</ext:GridPanel>
    	</Items>
    </ext:Container>
    And here is the code behind:
    using System;
    using System.Collections;
    using System.Collections.Generic;
    using Domain.Entities;
    using System.Linq;
    using System.Web.UI;
    using Ext.Net;
    
    namespace MyWeb.UserControls
    {
        public partial class Control1 : UserControl
        {
            #region Public Methods
    
            public void Show()
            {
    			BindGridpanel(2500);
            }
    
            #endregion
    
            #region Private Methods
    
    	    private void BindGridpanel(int count)
    	    {
    		    string[] year = { "2010", "2011", "2012", "2013", "2014", "2015", "2016", "2017", "2018", "2019", "2020" };
    		    string[] desc = { "Wood", "Lewis", "Scott", "Parker", "Ross", "Garcia", "Bell", "Kelly", "Powell", "Moore", "Cook" };
    
    		    var data = new object[count];
    		    var rnd = new Random();
    
    		    for (int i = 0; i < count; i++)
    		    {
    			    var yearId = rnd.Next(year.Length);
    			    var descId = rnd.Next(desc.Length);
    
    			    var yearString = year[yearId];
    			    var descString = desc[descId];
    
    			    data[i] = new
    						  {
    							  Year = yearString,
    							  Desc = descString,
    							  Population1 = i,
    							  Population2 = i,
    							  Total1 = i + i,
    							  Total2 = i + i,
    							  Part = (decimal)i,
    							  Weight = (decimal)i,
    							  RowType = "Type1"
    						  };
    		    }
    
    
    		    MyStore.DataSource = data;
    		    MyStore.DataBind();
    
    	    }
    
            #endregion
        }
    }
    Any idea why it doesn't work?

    Regards
    Marco
  2. #2
    Where Show method is called? Did you set height for 'GemeindeEinzugsgebietContainer' or does its size is managed by layout of parent widget?
    You need to provide runable sample instead part of code
  3. #3
    Hi Vladimir,

    I know I should post only runable code, but our web applications has a master page, then an aspx site and in this aspx site we have a container (user control). Therefore it's a bit complicated to post all the code.

    But I hope it's enough when I post the code of the container.

    BTW: I tried to set a height for GemeindeEinzugsgebietContainer, but I didn't change anything..

    Do you have another idea?

    The container has the following code:

    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Container.ascx.cs" Inherits="MyWeb.UserControls.Container" %>
    
    <%@ Register TagPrefix="uc" TagName="Control1" Src="~/UserControls/Control1.ascx" %>
    
    <ext:Container runat="server">
    	<Items>
    	    <ext:Hidden ID="hidId" runat="server" />
    
    		<ext:Panel runat="server" Border="False" BodyPaddingSummary="5" BodyStyle="border:0">
    			<TopBar>
    				<ext:Toolbar runat="server">
    					<Items>
    						<ext:Label runat="server" Cls="toolbar-title" Text="Control1" />
    					</Items>
    				</ext:Toolbar>
    			</TopBar>
    		</ext:Panel>
    
    		<ext:TabPanel runat="server" Flex="1" Border="False">
    			<Items>
    				<ext:Panel ID="Tab1" runat="server" Border="false" BodyPadding="5" Title="Details" />
                    <ext:Panel ID="Tab2" runat="server" Border="false" BodyPadding="5" Layout="Fit" Title="Control1">
    					<Content>
    					    <uc:Control1 ID="Control1" runat="server" />
    					</Content>
                        <DirectEvents>
    						<Show OnEvent="ShowControl1" Failure="Ext.MessageBox.alert(loadFailed, errorDuringAjaxEvent);" />
                        </DirectEvents>
    				</ext:Panel>
    			    <ext:Panel ID="RechnungenTab" runat="server" Border="false" BodyPadding="5" Title="Rechnungen" />
    			</Items>
    		</ext:TabPanel>
    	</Items>
    </ext:Container>
    using System;
    using System.Linq;
    using System.Web.UI;
    using Ext.Net;
    
    namespace MyWeb.UserControls
    {
    	public partial class Container : UserControl
    	{
    		private Guid Id
    		{
    			get { return hidId.Text.ToGuidSave(); }
    			set { hidId.Text = value.ToString(); }
    		}
    
    		#region Event Handlers
    
    		protected void ShowControl1(object sender, DirectEventArgs e)
    		{
    			Control1.Show();
    		}
    
    		#endregion
    	}
    }
    Last edited by Willimaendu; Aug 22, 2014 at 8:20 AM.
  4. #4
    No idea what I can do?

Similar Threads

  1. [CLOSED] Editable gridpanel with summery and celledit plugin and remote data
    By matrixwebtech in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Jun 30, 2014, 11:40 AM
  2. [CLOSED] GridPanel with BufferedRenderer: ScrollTo an added row
    By HansWapenaar in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Jan 28, 2014, 10:59 AM
  3. [CLOSED] GridPanel with BufferedRenderer Bug
    By elisa in forum 2.x Legacy Premium Help
    Replies: 12
    Last Post: Aug 23, 2013, 6:21 PM
  4. Replies: 0
    Last Post: Mar 04, 2013, 7:41 AM
  5. GridPanel cannot display data list?
    By xhbgq in forum 2.x Help
    Replies: 2
    Last Post: Oct 05, 2012, 4:45 PM

Tags for this Thread

Posting Permissions