How to get the row count of the gridpanel?

Page 2 of 2 FirstFirst 12
  1. #11
    I guess you use Ext.NET v2 or v3, not v1?

    In v2 and v3 there is a default namespace. Please try to replace:
    Value="GridPanel1.getStore().getCount()"
    with
    Value="App.GridPanel1.getStore().getCount()"
    P.S. That is best to replace databases with some static data when posting on the forums.
  2. #12
    I am not sure what you are going to do with store's count ,but I provided a line of code in the following so that you can get the count of your store by alert window while you clicked on your button, I just provided this example in order to show you how and where you should get the count of your store, thus instead of ALERT you can use what other object you like :

    if you use it in tags as what you have provided in your example you should use this one in the end part of your code which was about your button:
    <ext:Button ID="Button1" runat="server" Text="Get count">
        <Listeners>
            <Click Handler="alert(App.GridPanel1.getStore().getCount());" />
        </Listeners>
    </ext:Button>
    also if you want to use it on server side as c# code you should write this one:

    Button1.Listeners.Click.Handler="alert(App.GridPanel1.getStore().getCount());";
    Last edited by nasim; Oct 29, 2015 at 12:31 PM.
  3. #13

    thank you

    I have solved counting problem by other means


    protected void StROOMData()
        {
            DataSet ds = GetData(queryStringROOMS);
            if (ds.Tables.Count > 0)
            {
                int num = ds.Tables[0].Rows.Count;// here is count of rows that will be in store
                ROOMCCB.DataSource = ds;
                ROOMCCB.DataBind();
            }
            else
            {
                // Unable to connect to database
            }
        }
    I think its resolved. Thanks
    Last edited by Daniil; Oct 19, 2015 at 9:55 AM. Reason: Please use [CODE] tags
Page 2 of 2 FirstFirst 12

Similar Threads

  1. [CLOSED] How to get selected rows count in gridpanel
    By egvt in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: May 31, 2012, 5:22 PM
  2. GridPanel showing data return Store.Count value 0
    By abhi_sheklohiya in forum 1.x Help
    Replies: 3
    Last Post: Mar 26, 2012, 7:06 PM
  3. Replies: 2
    Last Post: Feb 10, 2011, 6:43 PM
  4. [CLOSED] GridPanel + Dynamic Columns + Count
    By Zarzand in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Jul 10, 2009, 4:46 PM
  5. Gridpanel record count
    By ram in forum 1.x Help
    Replies: 0
    Last Post: Nov 13, 2008, 6:50 AM

Posting Permissions