How to create more than one dynamic grid from a single data source using ASP.net?
I am a beginner. I want to know how can I create more than one dynamic data grid for a single data source. I need to show dup开发者_JS百科licate rows separately in different grids. For example If i have 4 duplicate values for ID 1 and 3 duplicate values for ID 2 then ID 1 should be displayed in separate grid and ID 2 should be displayed in separate gris.
Reply me ASAP.
KP
You should iterate through your data and select duplicate rows and show it in different grids in code behind. You can't do that via gridview properties window. the road map is:
//connect to database get results in a list
List<YourDomainObject> resultList =
//parse your results and resultList1 and 2
//.....
//bind to gridview
GridView1.DataSource = resultList1;
GridView1.DataBind();
//same for GridView2
精彩评论