Grid Hierarchy ?

4 posts, 0 answers
  1. Jason Bourdette
    Jason Bourdette avatar
    77 posts
    Member since:
    Jan 2010

    Posted 15 May 2010 Link to this post

    I have a grid and I have added a Hierarchy which is working good but I was wondering if there is a way to selectively show the expand grid button based on content in a column.

    For example if my first column is an order number and I want to have a nested Hierarchy but only for order numbers in the column that begin with a certain text string.

    thx
    jason
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 17 May 2010 Link to this post

    Hello Jason,

    Try the following code snippet to show/hide expand grid button based on the content in a column.

    C#:
     protected void RadGrid1_PreRender(object sender, EventArgs e) 
        { 
            foreach (GridDataItem item in RadGrid1.MasterTableView.Items) 
            { 
                if (item["OrderID"].Text == "10249")//your condition 
                { 
                    TableCell cell = item["ExpandColumn"]; 
                    cell.Controls.Clear(); 
                } 
            } 
        } 

    Regards,
    Shinu.



  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jason Bourdette
    Jason Bourdette avatar
    77 posts
    Member since:
    Jan 2010

    Posted 27 May 2010 Link to this post

    Just getting back around to looking at this code, and I see what it is doing but this is not exactly what i had in mind. I want to effect a nested grid not the top level grid.

    is there something like RadGrid1.DetailsTableView.Items  (this didnt work but is there something like it?)

    thanks
  5. Radoslav
    Admin
    Radoslav avatar
    1564 posts

    Posted 31 May 2010 Link to this post

    Hello Jason,

    Please check out the following online documentation article which explains how to hide expand/collapse images when no records:
    http://www.telerik.com/help/aspnet-ajax/grdhideexpandcollapseimageswhennorecords.html

    You could modify the code snippets and hide expand/collapse buttons based on content in a column:

    I hope this helps.

    Sincerely yours,
    Radoslav
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top