This is a migrated thread and some comments may be shown as answers.

hide hierarchy expanded column

1 Answer 181 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Felipe
Top achievements
Rank 1
Felipe asked on 16 Sep 2010, 08:04 AM
Hi,

I want to hide the hierarchy expanded cell, even when the parent rows have children.

I can hide the image but I cant not hide the column


Thanks,

Felipe

1 Answer, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 21 Sep 2010, 01:51 PM
Hi Felipe,

Thank you for contacting us.

Yes, this is possible in our latest release - Q2 2010 SP2 - by using a custom cell element provider. Please consider the following code snippet:

public class MyCellElementProvider : CellElementProvider
{
    public MyCellElementProvider(GridTableElement tableElement): base(tableElement) {}
    public override SizeF GetElementSize(GridViewColumn item)
    {
        if (item is GridViewIndentColumn)
        {
            return SizeF.Empty;
        }
        return base.GetElementSize(item);
    }
}
 
this.radGridView1.TableElement.CellElementProvider = new MyCellElementProvider(this.radGridView1.TableElement);           
this.radGridView1.TableElement.UpdateView();

I hope it helps.

Kind regards,
Jack
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
Tags
GridView
Asked by
Felipe
Top achievements
Rank 1
Answers by
Jack
Telerik team
Share this question
or