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

[Solved] Vertical Alignment toTop of GridviewToggleRowDetailsColumn

1 Answer 75 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Pawan Sharma
Top achievements
Rank 1
Pawan Sharma asked on 05 Jan 2010, 08:20 AM

I have a GridviewToggleRowDetailsColumn & One more column say checkbox whose Height is 150 px. When I Add a new Row or Edit Existing row. The "+" Sign of GridviewToggleRowDetailsColumn comes in centre (Vertically) while i want it to be stick to the top.

Code Snippet
<telerikData:GridViewDataColumn.CellEditTemplate>

<telerikData:GridViewToggleRowDetailsColumn Width="35" UniqueName="BtnToggle" Header=" "/>

<telerikData:GridViewDataColumn.CellEditTemplate>

<DataTemplate>

<StackPanel VerticalAlignment="Stretch" >

<CheckBox Margin="2,0,2,0" HorizontalAlignment="Left" VerticalAlignment="Top" Height="150" DataWidth="200" BorderThickness="1" Name="chkList" IsCheckedPropertyPath="IsSelected" />

</StackPanel>

</DataTemplate>

</telerikData:GridViewDataColumn.CellEditTemplate>

1 Answer, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 06 Jan 2010, 12:18 PM
Hello Pawan Sharma,

You have two options.

You can develop your own column instead of the built-in GridViewToggleRowDetailsColumn and configure it the way you want to. To see how to create such a custom column, please take a look at this the blog post

How To: Display Hierarchical Data with Row Details (RadGridView for Silverlight).

The other option, which is much harder, is to redefine the template for the GridViewToggleButton. Inside its template you will find a Grid with two Paths (plus and minus). You should set this Grid's VerticalAlignment to top. In order to reach the template for the GridViewToggleButton, you will have to edit template of GridViewRow, since this GridViewToggleButton is inside it.

To learn how to edit templates for various grid element please read the Styling and Appearance help topic.

But in my opinion, the first approach will be much more easier for you, since you can create any button in the CreateCellElement method of your custom column and set-up its layout.

Please, examine the blog post carefully and let me know if you have any other questions.

All the best,
Ross
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
Pawan Sharma
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Share this question
or