Click here to Skip to main content
15,915,852 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SQL
1)User selects the grid view columns in the required order.
2)based on the user selection the columns should be reflected in the grid view.
For example, the grid view contains two columns like "Employee Name", "ID", and "Designation".
If user selects the columns in the sequence like, "ID" as first column, "Designation" as second column and "Employee Name" as third column, then same should be reflected in grid view(contains template fields).
Posted

1 solution

One of the solution is to create dynamic select query based on column selected.

If not then you can generate bound column dynamically like this.


BoundField bd = new BoundField();
bd.DataField = "ProductID";

bd.HeaderText = "ProductID";
grdView.Columns.Add(bd);


for dynamically adding template column follow below link
http://forums.asp.net/t/1001702.aspx[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900