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

Customizing RadGridView Visual Style Builder

9 Answers 391 Views
Tools - VSB, Control Spy, Shape Editor
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 17 Nov 2008, 05:39 AM
Hi,

Im using Q3 2008 Telerik and I need to customize the RadGridView using Visual Style Builder. I want to adjust the height of the Rows and the Columns. I can do it using this code: (radgridview.GridElement as GridTableElement).RowHeight = 10;  but I need to do it using Visual Style Builder but i am having trouble using it because for some reason i cant view the adjustments i made unlike when i did the RadTabStrip. I need help. And can you add the code where i can adjust the height of the columns just in case? Thanks!

9 Answers, 1 is accepted

Sort by
0
Nick
Telerik team
answered on 17 Nov 2008, 04:41 PM
Hello Paul,

Navigate to RootRadElement --> GridTableElement and from the Expert Mode property grid set RowHeight to the desired value. You can set columns width only programmatically.

Do not hesitate to write me back if you have further questions.
 

Sincerely yours,
Nick
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Paul
Top achievements
Rank 1
answered on 18 Nov 2008, 03:09 AM
Hi Nick,

Thanks for the reply but I can't seem to find your solution in the VSB. I would appreciate it greatly if you could give me a step-by-step procedure and if possible visual clips. I have another question, if you cannot set the column height programmatically what can you do to make it's height smaller? Thanks!
0
Nick
Telerik team
answered on 18 Nov 2008, 05:22 PM
Hi Paul,

Thank you for your questions. Here are the steps to do this:

  1. Open VSB and load the RadGrdiView control.
  2. Select RadGrdiView and navigate to the RootRadElement - the first element in the tree on the right for the RadGridView control.
  3. Navigate to its first child node - GridTableElement - and select it.
  4. From the properties on the right in the VSB (Expert Mode) find RowHeight and set it to some value.
You can set columns width and row height only programmatically. For example, to set the width to 70 pixels of the first column use the following code:

this.radGridView1.Columns[0].Width = 70; 

Do not hesitate to write me back if you have further questions.

 
Best wishes,
Nick
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Paul
Top achievements
Rank 1
answered on 19 Nov 2008, 03:40 AM
Hi Nick,

Thanks I got it although I got 1 more problem, I can't load the theme to my radgridview. What I did is:
1. Add a Theme Manager
2. Load from a file: the Custom RadGridView Theme
3. Look for the Theme name in the Theme Name and select the theme

The problem is my customized theme is not in the selection. This is what I did in my customized TabStrip theme and it works but why won't it work in RadGridView?  Am I doing this the wrong way? If I am please give me a step by step procedure again on what I should be doing. Thanks in advance!

0
Nick
Telerik team
answered on 19 Nov 2008, 08:28 PM
Hi Paul,

Did you give a new name to your theme (in the upper right corner of the VSB) before the actual saving? Otherwise, the steps seem correct.  Please send us your theme to research the issue further.

Do not hesitate to write me back if you have more questions.

Regards,
Nick
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Paul
Top achievements
Rank 1
answered on 20 Nov 2008, 05:53 AM
Hi Nick,

I got that earlier I changed my theme name in the xml file and it is working. Now there is another problem I encountered. When I transfer the project to another computer the theme is looking for the exact address of the theme thus making an error. I solved this by adding the xml file of my theme in the project and making it an embedded resource . This is working but the problem is when I want to edit the xml file in the VSB the changes I made did not reflect in the Grid control. Because of this i need to delete my xml file again and resaved my custom theme and do the process of making it a resource again. Am I doing something wrong? I really am having problems with themes specially gridviews.
0
Nick
Telerik team
answered on 20 Nov 2008, 03:41 PM
Hi Paul,

You do everything correctly. Visual Style Builder cannot update the resources automatically.

Do not hesitate to write me back if you have more questions.

All the best,
Nick
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Paul
Top achievements
Rank 1
answered on 21 Nov 2008, 07:28 AM
Ok I got it now, the VSB cannot overwrite the existing xml file whenever we make an additional customization we save it as another file. One more question, how can you set the columnheader height and row height of the child templates in the gridviews hierarchy using VSB? Thanks for the help really appreciate it!
0
Nick
Telerik team
answered on 21 Nov 2008, 04:23 PM
Hi Paul,

Thank you for your question:
  1. Navigate to GridTableElement and set the TableHeaderHeight property.
  2. Navigate to GridTableElement and set the RowHeight property.
Do not hesitate to write me back if you have more questions.

 
Sincerely yours,
Nick
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Tools - VSB, Control Spy, Shape Editor
Asked by
Paul
Top achievements
Rank 1
Answers by
Nick
Telerik team
Paul
Top achievements
Rank 1
Share this question
or