Customizing RadGridView Visual Style Builder

10 posts, 0 answers
  1. Paul
    Paul avatar
    8 posts
    Member since:
    Nov 2008

    Posted 16 Nov 2008 Link to this post

    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!
  2. Nick
    Admin
    Nick avatar
    767 posts

    Posted 17 Nov 2008 Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Paul
    Paul avatar
    8 posts
    Member since:
    Nov 2008

    Posted 17 Nov 2008 Link to this post

    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!
  5. Nick
    Admin
    Nick avatar
    767 posts

    Posted 18 Nov 2008 Link to this post

    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.
  6. Paul
    Paul avatar
    8 posts
    Member since:
    Nov 2008

    Posted 18 Nov 2008 Link to this post

    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!

  7. Nick
    Admin
    Nick avatar
    767 posts

    Posted 19 Nov 2008 Link to this post

    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.
  8. Paul
    Paul avatar
    8 posts
    Member since:
    Nov 2008

    Posted 19 Nov 2008 Link to this post

    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.
  9. Nick
    Admin
    Nick avatar
    767 posts

    Posted 20 Nov 2008 Link to this post

    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.
  10. Paul
    Paul avatar
    8 posts
    Member since:
    Nov 2008

    Posted 21 Nov 2008 Link to this post

    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!
  11. Nick
    Admin
    Nick avatar
    767 posts

    Posted 21 Nov 2008 Link to this post

    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.
Back to Top
UI for WinForms is Visual Studio 2017 Ready