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

using templates properly

2 Answers 99 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Joe
Top achievements
Rank 2
Joe asked on 23 Apr 2015, 02:13 PM

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 Answers, 1 is accepted

Sort by
0
Accepted
Ralitsa
Telerik team
answered on 24 Apr 2015, 12:09 PM
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.

 
0
Joe
Top achievements
Rank 2
answered on 27 Apr 2015, 12:52 PM

Very interesting stuff.

 

Thank you Ralitsa for the answer and the additional help.

Joe

Tags
GridView
Asked by
Joe
Top achievements
Rank 2
Answers by
Ralitsa
Telerik team
Joe
Top achievements
Rank 2
Share this question
or