Hide detail tables

7 posts, 1 answers
  1. Joel
    Joel avatar
    166 posts
    Member since:
    Oct 2006

    Posted 03 Nov 2008 Link to this post

    We want to make the ability to see detailtables permission based.  some may get no detail tables, some may get detailtable 0 and others detailtable 1.  Users with no permissions should not see the "+" at all

     grid1.MasterTableView.DetailTables(0).Visible = False

    doesn't seem to get the job done.  Any ideas?  Permissions won't be set until after a postback.
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 03 Nov 2008 Link to this post

    Hi Joel,

    Try with the following approach and see if it helps.

    CS:
     protected void RadGrid1_PreRender(object sender, EventArgs e) 
        { 
            foreach (GridDataItem item in RadGrid1.MasterTableView.Items) 
            { 
                if (item.Expanded) 
                { 
                    //Check for the Permission here and then set visibility 
                    item.ChildItem.NestedTableViews[0].Visible = false
                    
                } 
            } 
        } 


    Thanks
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Joel
    Joel avatar
    166 posts
    Member since:
    Oct 2006

    Posted 04 Nov 2008 Link to this post

    Thank you Shinu.

    I had seen similar attempts in other postings.  This hides the contents of the detail table, but only after expansion.  What I am looking for is the mastertable to not have the the expansion column at all.   Having a "+" that does nothing will be kicked back as a bug.  Any other ideas?

    -Joel




  5. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 04 Nov 2008 Link to this post

    Hi Joel,

    Here is the code snippet to hide the Expand/Collapse image in the Expand/Collapse column of a Hierarchical Grid.

    CS:
     protected void RadGrid1_PreRender(object sender, EventArgs e) 
        { 
            foreach (GridDataItem item in RadGrid1.MasterTableView.Items) 
            { 
                TableCell cell = item["ExpandColumn"]; 
                cell.Controls[0].Visible = false
            } 
     
             
        } 


    Thanks
    Shinu.
  6. Idrise
    Idrise avatar
    2 posts
    Member since:
    May 2008

    Posted 11 Nov 2008 Link to this post

    ((GridDataItem)e.Item)["ExpandColumn"].Controls[0].Visible = false;

    Seems to preserve the formatting, the other way ( ((GridDataItem)e.Item)["ExpandColumn"].Enabled = false; ) gets the alignment out of whack.
  7. ghadeer
    ghadeer avatar
    57 posts
    Member since:
    Mar 2008

    Posted 20 Nov 2008 Link to this post

    hello there
    please you can rewrite for me with condition .....
    thanks in advance
    ghadeer
  8. Idrise
    Idrise avatar
    2 posts
    Member since:
    May 2008

    Posted 20 Nov 2008 Link to this post

    I didn't get your question.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017