Click here to Skip to main content
15,888,579 members
Please Sign up or sign in to vote.
2.33/5 (3 votes)
See more:
Hi Every one,
I have many DropDown Lists such as customers, products, status, SerialNo. etc And I have one grid view. when i am selecting customer drop down the and press Ok button then it should retrive all the data where customer is the dropdown list selected item. similarly when only product ddl is selected and ok button is pressed then it will show all the data where product is ddl selected item.If both customer and product is selected then the grid view will display the data where customer = customer drop down selected item and product = product dropdown selected item. My real problem is how will i display different data source in a gridview according to different condition.
Please help.
Posted
Updated 12-Jun-14 3:35am
v3
Comments
Sergey Alexandrovich Kryukov 12-Jun-14 3:09am    
And what's the problem? What have you tried so far?
—SA
Kschuler 12-Jun-14 9:38am    
Just because someone hasn't posted code doesn't mean they are putting No Effort into a solution. You forget what it's like to be a newbie and not even know where to start or what to search for. This website is to HELP people. If you can't be bothered to even try to help people who are under a certain level of experience then you are the one with No Effort.
Sergey Alexandrovich Kryukov 12-Jun-14 11:57am    
I like your point. My own effort probably was insufficient. :-) However, the problem is not some effort per se, but telling us what OP tried, otherwise just the information on the problem is insufficient. But did I add a "No Effort" tag? If I did, it was my mistake you fixed; thank you.
—SA

 
Share this answer
 
you can use the gridview control with no columns with AutoGenerateColumns is true as the following:

ASP.NET
<asp:gridview id="grdInfo" runat="server" autogeneratecolumns="True" xmlns:asp="#unknown">
</asp:gridview>


then bind data inside grideview by using datatable and naming the columns in the datatable.
 
Share this answer
 

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