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

GridView Grid Line

5 Answers 970 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ahmed
Top achievements
Rank 1
Ahmed asked on 19 Oct 2008, 08:01 AM


Hi,

I have two simple questions,
1- What is the property that control visibility of vertical and horizental grid lines in GridView?

2- How can i use form for windows form, it is not visible in the toolbox nethier i could import it from visual studio IDE.


Thanks in advance.

5 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 22 Oct 2008, 03:14 PM
Hi Ahmed,

Thank you for contacting us.

Please find the answers to your questions below:
  1. You can control the visibility of the vertical and horizontal grid lines by setting the appropriate border width of the CellElement in the CellFormatting event handler. If the width value is zero, the lines will not be visible and if it is equal to one, they will be visible. In addition, you can use the DrawBorder property which will govern whether the lines should be drawn or not, disregarding the width even if it is equal to one:
    void radGridView1_CellFormatting(object sender, CellFormattingEventArgs e)  
    {  
        e.CellElement.BorderBottomWidth = 1;  
        e.CellElement.BorderBottomColor = Color.Red;  
     
        e.CellElement.BorderRightWidth = 1;  
        e.CellElement.BorderRightColor = Color.Blue;  
     
        //If you want to have a RadGridView with no lines at all  
        //e.CellElement.DrawBorder = false;  
  2. As to your second question, you should inherit your form from the RadForm class. For more information, please refer to our online Help Documentation.
I hope this helps. If you need additional assistance, feel free to contact me.

Best wishes,
Nikolay
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Jay
Top achievements
Rank 1
Iron
Iron
commented on 08 Jun 2023, 04:34 AM

These work fine, but not with all themes. Which is kinda sad.

 

Dess | Tech Support Engineer, Principal
Telerik team
commented on 08 Jun 2023, 04:56 AM

Hi, Jay, Please have in mind that the different themes offer different design which is achieved by applying different style settings. The CellFormatting event is the appropriate place to customize the visual cell elements in any way. If you are facing any difficulties with a particular theme, please share with us which is the theme and what are the expected vs observed result. Thus, we would get better understanding of the precise case and provide further assistance. Thank you.
0
Ahmed
Top achievements
Rank 1
answered on 25 Oct 2008, 09:45 PM
Thank you very match Nikolay , that is exactly waht i was looking for.

One more question, is there a way to set this property at design time and make it a default for newly created grid?

Thanks
0
Nikolay
Telerik team
answered on 29 Oct 2008, 02:37 PM
Hello Ahmed,

Currently, you cannot set the cell borders through a property at design-time. However, you can make the necessary changes in a theme, using Visual Style Builder:
  1. Open Visual Style Builder and load RadGridView control.
  2. In the Control Structure tree, navigate to GridDataCellElement.
  3. With the Initial tab selected, navigate to the Expert Mode property grid.
  4. In the Box section, set the appropriate Color and Width for the borders.
  5. Save and apply the theme to the RadGridView.

I hope this helps. If you have additional questions, feel free to contact me.

Best wishes,

Nikolay
the Telerik team

 


Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
[Nean]
Top achievements
Rank 1
answered on 16 Apr 2010, 10:50 AM
Hi everyone,

I've done has you said (using a theme) but the vertical lines are not linear. Sometimes (in the last column specially) there is white space in the vertical line between the grid lines. What shoul i do ?

Thanks

[Nean]
0
Alexander
Telerik team
answered on 16 Apr 2010, 05:32 PM
Hi [Nean],

Thank you for contacting us.

We cannot reproduce the issue using Q1 2010 SP1. Please try our latest release.

If you still experience this issue please send us a project demonstrating the problem. It will help us find a solution.

Regards,
Alexander
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
Ahmed
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Ahmed
Top achievements
Rank 1
[Nean]
Top achievements
Rank 1
Alexander
Telerik team
Share this question
or