GridPanel visibility

  1. #1

    GridPanel visibility

    The page contains a Panel and a GridPanel inside it. I want to display or hide the GridPanel. It depends on some conditions.
    Here is the hanlder (at the server side ) of the GridPanel's RefreshData event

     protected void egrAttachments_RefreshData(object sender, StoreRefreshDataEventArgs e)
            {
                var dataSource =  GetDataSource();
                if (dataSource == null || !dataSource.Any())
                {
                    gridPanel.Visible = false;
                  // gridPanel.Reconfigure(); gridPanel.Refresh();
                }
    
                else
                {
                    MainStore.DataSource = dataSource;
                    MainStore.DataBind();
                    egrAttachments.Visible = true;
                }
            }
    It doesn't work as I want. Can I refresh the gridPanel and how can I do it?
    Last edited by AlexMaslakov; Aug 16, 2011 at 11:23 AM.
  2. #2
    Hi,

    Please use .Hidden instead of .Visible, see more info here:
    http://forums.ext.net/showthread.php...ll=1#post54033
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi,

    Please use .Hidden instead of .Visible, see more info here:
    http://forums.ext.net/showthread.php...ll=1#post54033
    Daniil, I've corrected my code. It works good. But I dunno one thing: Why does the property GridPanel.Hidden equal false before and after calling the method GridPanel.Hide() ?

    Look

    protected void egrAttachments_RefreshData(object sender, StoreRefreshDataEventArgs e) 
           { 
               var dataSource =  GetDataSource(); 
               if (dataSource == null || !dataSource.Any()) 
               { 
                  //gridPanel.Hidden == false  ???
                   gridPanel.Hide();
                  //gridPanel.Hidden == false ???
                  
               } 
     
               else 
               { 
                   MainStore.DataSource = dataSource; 
                   MainStore.DataBind(); 
                  
                 //gridPanel.Hidden == false  ???
                   gridPanel.Show(); 
                  //gridPanel.Hidden == false  ???
               } 
           }
  4. #4
    It is just config server side property, it doesn't synchronize with real client side state
  5. #5
    Quote Originally Posted by Vladimir View Post
    It is just config server side property, it doesn't synchronize with real client side state
    Can I get the real client state at the server side?
  6. #6
    You can any required information via ExtraParams of DirectEvent

Similar Threads

  1. Replies: 8
    Last Post: Apr 06, 2010, 7:20 AM
  2. [FIXED] [0.8.2] BoxLabel Visibility
    By Timothy in forum Bugs
    Replies: 7
    Last Post: Oct 08, 2009, 11:51 PM
  3. [CLOSED] LayoutRow visibility
    By state in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 25, 2009, 6:27 AM
  4. Replies: 2
    Last Post: Jul 30, 2009, 3:04 PM
  5. [FIXED] [V0.7] Visibility Bug
    By Timothy in forum Bugs
    Replies: 2
    Last Post: Nov 05, 2008, 9:48 AM

Tags for this Thread

Posting Permissions