using templates properly

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

    Posted 23 Apr 2015 Link to this post

    Hello;

    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;
    radGridView4.Rows.Add(dataRowInfo);

     

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

    Joe

  2. Answer
    Ralitsa
    Admin
    Ralitsa avatar
    176 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.

    Regards,
    Ralitsa
    Telerik
     

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

     
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Joe
    Joe avatar
    26 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.

    Joe

Back to Top