using templates properly

3 posts, 1 answers
  1. Joe
    Joe avatar
    39 posts
    Member since:
    Feb 2012

    Posted 23 Apr 2015 Link to this post


    I may be misunderstanding templates.

    Can you use them to setup different "views" of your grid, or are they only used with hierarchical data is used?

    In other words, instead of creating my colums in the master template can I create three templates with different layouts, then access them as needed?

    I have tried to do this, but cannot seem to add a row to them then have it display using:

    GridViewDataRowInfo dataRowInfo = new GridViewDataRowInfo(this.radGridView4.MasterTemplate.Templates[0].MasterViewInfo);
    dataRowInfo.Cells["repID"].Value = curRow.repID;


    am I missing something simple or simply not understanding their use?


  2. Answer
    Ralitsa avatar
    185 posts

    Posted 24 Apr 2015 Link to this post

    Hi Joe,

    Thank you for contacting us. 

    The templates are used when set a hierarchy grid. You can take a look at the example GridView >> Tabbed views from the DemoApplication which demonstrates binding to a hierarchy with one to many relationships. The child views are presented in different tabs. 
    I can suggest you to use the Save/Load functionality of the RadGridView which gives you the opportunity to preserve user grid settings such as column order and restore them later. The example which shows this feature can be found in DemoApplication - GridView >> Save/Load layout
    The location where you can find all examples is: START >> All Programs >> Telerik >> UI for WinForms [version] >> Examples >> C# for Visual Studio 2010 >> Open C# Demo Application in Visual Studio - UI for WinForms.

    If you have any additional questions, please let me know.


    See What's Next in App Development. Register for TelerikNEXT.

  3. Joe
    Joe avatar
    39 posts
    Member since:
    Feb 2012

    Posted 27 Apr 2015 in reply to Ralitsa Link to this post

    Very interesting stuff.


    Thank you Ralitsa for the answer and the additional help.


Back to Top