Display Grid Lines on Specific Theme

6 posts, 0 answers
  1. Adam
    Adam avatar
    3 posts
    Member since:
    Apr 2013

    Posted 19 Jul 2013 Link to this post

    I am trying to display gridlines in the Detail View of a ListView control. I am currently using the VisualStudio2012Dark theme and it does not show the gridlines that separate each row. I have watched several of your webinars on the themebuilder but cannot figure out how to modify the theme to have gridlines.

    Thanks
  2. Dess
    Admin
    Dess avatar
    1609 posts

    Posted 24 Jul 2013 Link to this post

    Hello Adam,

    Thank you for contacting Telerik Support.

    You should edit the VisualStudio2012Dark theme in order to achieve the desired view. It is necessary to change the border color of DetailListViewDataCellElement. Please follow the steps:
    1. Open VisualStyleBuilder, which comes with RadControls for WinForms
    2. Open the "File" menu
    3. Click "Export Build-in Themes"
    4. Then open the theme you want to edit with the "Open package" button

    You can read more details about using the VisualStyleBuilder here:
    1. Loading predefined themes
    2. Working with Repository Items
    3. Saving and Loading Theme Files
    4. Loading Themes from an External File
    5. Loading Themes from a Resource
    6. Applying Theme to a Control
    7. http://tv.telerik.com/watch/winforms/visualstylebuilder/whats-new-visual-style-builder-q1-2010

    After customizing the already existing theme I have used the following code snippet to obtain the design from the attached picture:
    public Form1()
            {
                InitializeComponent();
     
                List<Item> dataItems = new List<Item>
                {
                    new Item("First", "Some description", DateTime.Now),
                    new Item("Second", "Some description", DateTime.Now),
                    new Item("Third", "Some description", DateTime.Now),
                    new Item("Fourth", "Some description", DateTime.Now),
                    new Item("Fifth", "Some description", DateTime.Now),
                    new Item("Sixth", "Some description", DateTime.Now),
                    new Item("Seventh", "Some description", DateTime.Now),
                };
                this.radListView1.DataSource = dataItems;
                ThemeResolutionService.LoadPackageFile(@"C:\Users\yordanova\Desktop\themes\VisualStudio2012DarkNew.tssp");
                this.radListView1.ThemeName = "VisualStudio2012DarkNew";
            }
        }
     
        public class Item
        {
            public string Name { get; set; }
     
            public string Description { get; set; }
     
            public DateTime Date { get; set; }
     
            public Item(string name, string description, DateTime date)
            {
                this.Name = name;
                this.Description = description;
                this.Date = date;
            }
        }

    I hope this information helps. Please let me know if I can assist you any further with this service request. Thank you in advance.

    Regards,
    Desislava
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Adam
    Adam avatar
    3 posts
    Member since:
    Apr 2013

    Posted 26 Jul 2013 Link to this post

    Thanks for the quick response. I have exported the file and reopened it in VisualStyleBuilder however I am having a hard time finding the DetailListViewDataCellElement you were referring too. I watched the video but it really only covered using the Repository but now how to find specific elements and change their color. 

    Thanks,

    Adam
  5. Dess
    Admin
    Dess avatar
    1609 posts

    Posted 31 Jul 2013 Link to this post

    Hello Adam,

    Thank you for writing back.

    The appropriate way to find the specific elements easily is to use ControlSpy (Visual Style Builder -> Tools -> Show Spy). Thus you can test whether changing the color of a given element is the right one.

    To your question on the element you are unable to find. There are several controls that offer several different views e.g. RadPageView (strip, explorer bar, stack, outlook). RadListView offers several views as well (Simple, Details, Icons). These views are build with different elements which cannot exist at the same time in the control. That is why you need to change the view of the control. To do that right-click on the control in the Element tree of VSB and select the appropriate view. I am attaching a screen shot for your convenience.

    I hope this information helps. Should you have further questions, I would be glad to help.

    Regards,
    Desislava
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  6. Adam
    Adam avatar
    3 posts
    Member since:
    Apr 2013

    Posted 31 Jul 2013 Link to this post

    I am still having issues. I have used the ControlSpy to locate the DetailListViewDataCellElement and I have changed its border color and nothing shows up in the Preview Box of the Visual Style Builder. I have attached some screenshots to show the change. Please let me know if I am changing the correct values or not.

    Thanks
  7. Dess
    Admin
    Dess avatar
    1609 posts

    Posted 02 Aug 2013 Link to this post

    Hello Adam,

    Thank you for writing back.

    Please find the attached video (drag and drop over the browser to play) demonstrating how to achieve the desired border of RadListView rows.

    I hope this information helps. Should you have further questions, I would be glad to help.

    Regards,
    Desislava
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top
UI for WinForms is Visual Studio 2017 Ready