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

Hide the GridViewIndentCell

6 Answers 199 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Charlie
Top achievements
Rank 2
Charlie asked on 03 Nov 2010, 12:27 AM
I have 2 questions.
1.)  How to hide or have the GridViewIndentCell to have 0 width using a HierarchyChildTemplate to do an Hierarchy Grid Parent-Child? (Not using RowDetails, and I have grouping disabled).  The parent and child have the same column headers (I display the parent, but I hide the child).  I want the child columns to line up with the parent headers, but I can't get rid of the GridViewIndentCell.

2.)  How do I kept the Child Column with the same as the Parent Width if I allow the user to resize the Parent Column? 

An extact example of each would be great.

Thanks,

Charlie J.

6 Answers, 1 is accepted

Sort by
0
Accepted
Vanya Pavlova
Telerik team
answered on 03 Nov 2010, 03:13 PM
Hi Charlie,

If you want to be able to access GridViewIndentCell, you have two options:

1.Edit the template of a GridViewRow and find the part IndentPresenter, set its Visibility property to Collapsed.
2.Create a simple implicit style that is targeted at GridViewIndentCell and set its Visibility property to Collapsed.
Also you can remove the default padding in HierarchicalChildPresenter in GridViewRow's template.
Attached is a sample approach that demonstrates these techniques.
Considering your second requirement, you may take a look at this forum thread for a reference on the same issue.


Regards,
Vanya Pavlova
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
0
Charlie
Top achievements
Rank 2
answered on 03 Nov 2010, 07:21 PM
Thanks Vanya,

Your sample worked fine until I added  AlternateRowStyle to the Parent Grid.  All the Alternate Rows had the GridviewIndent to show up where the other rows had it correctly removed.  You can reproduce the problem by adding  AlternateRowStyle to your Parent Grid in the sample you sent me.

I am trying to implement Question #2 based on the Forum post you reference.  I will let you know how that turns out.

Thanks,

Charlie J.
0
Vanya Pavlova
Telerik team
answered on 04 Nov 2010, 08:33 AM
Hi Charlie,

 
This is really strange issue. Can you please send us a small application with your custom AlternateRowStyle that demonstrates such a behaviour ?

Sincerely yours,
Vanya Pavlova
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
0
Charlie
Top achievements
Rank 2
answered on 04 Nov 2010, 10:17 PM
Hey Vanya,

I made a mistake and left a Setter off the Style for the GridViewRow Style.  It is working just fine now.

Thanks,

Charlie J.
0
Ben
Top achievements
Rank 1
answered on 08 Nov 2010, 11:08 PM
I used option #2 to collapse the GridViewCellIndent by putting the following into my UserControl.Resources:
<Style TargetType="telerik:GridViewIndentCell">
    <Setter Property="Visibility" Value="Collapsed" />
</Style>

However, it now looks a little odd because the indent cell for the group header does not have a border on the bottom when the group is expanded, but the rest of the group header does.  The code sample attached earlier in this thread (silverlightapplication169.zip) produces the same behavior, so I attached a screenshot from it.

Is there a simple way to add a border to the bottom of this group indent cell?

Thanks,
Ben
0
Vanya Pavlova
Telerik team
answered on 10 Nov 2010, 09:29 AM
Hello Ben,


Actually if you want to fill that space you should edit the template of GridViewGroupRow.
There you should change the elements named IconInnerBorder and respectively IconOuterBorder and set their BorderThickness property to the bottom in the preferred way when a GridViewGroupRow is Expanded. Attached is an example that demonstrates this approach.

If you need any additional information please let me know.

Kind regards,
Vanya Pavlova
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
Charlie
Top achievements
Rank 2
Answers by
Vanya Pavlova
Telerik team
Charlie
Top achievements
Rank 2
Ben
Top achievements
Rank 1
Share this question
or