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

How to create multiple table with same RadGrid using different DataSet

3 Answers 230 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mc
Top achievements
Rank 1
Mc asked on 20 Jan 2015, 11:20 PM
I have a RadGrid like this:

<telerik:RadGrid ID="ProductGrid" runat="server"
    OnItemDataBound="ProductGrid_ItemDataBound"
    OnNeedDataSource="ProductGrid_NeedDataSource">
    <MasterTableView AutoGenerateColumns="False" DataKeyNames="Change" TableLayout="Fixed">
        <Columns>
            <telerik:GridBoundColumn DataField="Name" HeaderText="Name" UniqueName="Name">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Price" HeaderText="Price" UniqueName="Price">
            </telerik:GridBoundColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

I want to have tables for each category. And I want to display several categories at same time with ability to show/hide each of them (I can figure out show/hide part). How could I achieve it?

Thanks in advance!

3 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 21 Jan 2015, 05:04 PM
Hello,

You can modify the columns collection of a RadGrid dynamically on postback using the approach presented in the article below:
http://www.telerik.com/help/aspnet-ajax/grid-changing-structure-dynamically.html

Regards,
Pavlina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Mc
Top achievements
Rank 1
answered on 21 Jan 2015, 06:45 PM
Hi Pavlina,

Thanks for the reply. That's the way to change *one* Grid dynamically, I want to use the RadGrid as template to create multiple grid with different dataset. Is that possible? 
0
Mc
Top achievements
Rank 1
answered on 21 Jan 2015, 11:47 PM
Realized that I could use C# library to achieve this:

RadGrid1 = new RadGrid();
Tags
Grid
Asked by
Mc
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Mc
Top achievements
Rank 1
Share this question
or