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

Setting HorizontalGridLine height to zero?

11 Answers 125 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Rudis
Top achievements
Rank 1
Rudis asked on 24 Jan 2011, 07:32 PM
Hello!

I want to display a lot of rows in my RadGridView so therefor I want to make it as compact as possible with little space between the rows. Is there a way to remove the area of the HorizontalGridLines? Setting the HorizontalGridLine height to zero that is.

Best regards,
Anna

11 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 25 Jan 2011, 08:16 AM
Hi Anna Rudlund,

You may use the GridLinesVisibility property of the grid and set it to None or Vertical in your case. You may take a look at our online demo for a reference. 

Best wishes,
Maya
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Rudis
Top achievements
Rank 1
answered on 25 Jan 2011, 08:20 AM
Thanks for the answer, but I´ve already done that. Now I want to get rid of the area where the GridLine has been. That is now space at all betweeen the rows.

/Anna
0
Maya
Telerik team
answered on 25 Jan 2011, 05:37 PM
Hello Anna Rudlund,

You may try to set the RowHeight property of the grid. Generally, the RowHeight is 25 pixels, one of which is devoted to the bottom vertical grid line. Consequently, if this grid line is visible, the space for the row is 24 pixels. So, what I may recommend you is to set the GridLinesVisibility to Horizontal and set the RowHeight to "24".
Let me know if it meets your requirements.

Kind regards,
Maya
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Rudis
Top achievements
Rank 1
answered on 26 Jan 2011, 09:06 AM
No it did not...

// Anna
0
Maya
Telerik team
answered on 26 Jan 2011, 10:36 AM
Hello Anna Rudlund,

Based on your requirements defined in the last but one post of yours, I get the impression that you want to minimize the space between the rows so that your grid looks as compact as possible. Generally, using the two properties - GridLinesVisibility and RowHeight should do the trick. I am sending you a sample project illustrating the proposed solution. You may set the RowHeight property to a value that will visualize the rows just as you want. 
However, if still this is not the solution you are looking for, I would need quite more details as otherwise my hands are tied. 

Kind regards,
Maya
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Rudis
Top achievements
Rank 1
answered on 26 Jan 2011, 11:05 AM
Hello again,

What I really want is to be able to set the horizontal GridLinesVisibility to collapsed instead of just hidden. Since this is not possible I set the padding of the GridViewCell to 0  to get the compact look I´m after. But thanx anyway for the help.

Best regards,
Anna Rudlund
0
Rudis
Top achievements
Rank 1
answered on 31 Jan 2011, 10:19 AM
Hello again,

GridViewRow has a property HorizontalGridLinesWidth. Is it not possible to change this value?

Best regards,
Anna
0
Maya
Telerik team
answered on 31 Jan 2011, 06:10 PM
Hi Anna Rudlund,

Basically, the HorizontalGridLinesWidth property is used only for internal needs and it is not meant for being set explicitly. Still, it is visible as otherwise it will not be possible to be used in the definition of the templates.

Greetings,
Maya
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Krish
Top achievements
Rank 1
answered on 07 Feb 2011, 06:41 PM
I want to set the HorizontalGridLine height as 10, Is there any work around? Actually the requirement is need a big gap between rows and the gap should be colored out instead of plain white.  I have made the cell style like this... Padding 5 and margin 10, so I see the big gap between rows. Now I need to color out the gap instead of white, HorizontalGridLinesBrush do the tinny line of color.
        <Style x:Key="MyStyle" TargetType="{x:Type telerik:GridViewCell}">
           
<Setter Property="Background"> <Setter.Value>#FF0094D3</Setter.Value> </Setter>
            <Setter Property="Padding" Value="5" />
            <Setter Property="Margin" Value="0,10,0,0" />
        </Style>

Thanks for your help.
0
Maya
Telerik team
answered on 10 Feb 2011, 05:04 PM
Hello Krish,

You may define a style for the GridViewRow:

<Style TargetType="telerik:GridViewRow">
    <Setter Property="Background" Value="Tomato" />
</Style>

I am sending you a sample project illustrating the proposed solution. Let me know whether it corresponds to your requirements.
 


All the best,
Maya
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Krish
Top achievements
Rank 1
answered on 10 Feb 2011, 08:52 PM
Thank you very much.
Tags
GridView
Asked by
Rudis
Top achievements
Rank 1
Answers by
Maya
Telerik team
Rudis
Top achievements
Rank 1
Krish
Top achievements
Rank 1
Share this question
or