开发者

Dynamically Binding gridview with dynamic column and dynamic rows with Editing and updating in gridview?

I am new in .net appli开发者_JAVA技巧cation development.Please help me to find the solution. My requirement is I am getting filled data table from database.Now i want to fill it in GridView.The problem is that the column name and number of columns changed as per the selected value in Dropdownlist and the DataTable is filled as per the selected value in Dropdownlist.Now i want to generate The columns and rows of the GridView Dynamically and also want to edit and update the created row.The Number of column and row are not fixed It varies as per the selected Prediction in Dropdawnlist.So Please Help me to solve the problem.

Thanks In Advance


Actually GridView control have an ability to autogenerate columns.

Checkout this tutoral for beginers about data accessing in ASP.NET: http://www.asp.net/data-access/tutorials

In two words:

<asp:sqldatasource id="CustomersSource"
  selectcommand="SELECT CustomerID, CompanyName, FirstName, LastName FROM SalesLT.Customer"
  connectionstring="<%$ ConnectionStrings:AWLTConnectionString %>" 
  runat="server"/>

<asp:gridview id="CustomersGridView" datasourceid="CustomersSource" autogeneratecolumns="True" 
  runat="server">        
</asp:gridview>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜