Hi In web api i got some fields and convter to data set assign to girdview now when i slect gridview selcted row data want to bind columns dont know how many comes which columns comes other gridview and in that delete option
Loading
Hi In web api i got some fields and convter to data set assign to girdview now when i slect gridview selcted row data want to bind columns dont know how many comes which columns comes other gridview and in that delete option
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Rajesh GamiPosted Nov 15, 2022, 12:39 PM
Now let's see how to how to display XML file data in a GridView control in 6 easy steps.
Step 1: Create an ASP.NET empty Web Application.





Step 2: Create an XML file.
Right-click on the project then select Add -> New Item then select Data in the installed templates then select XML file then provide a name then click on Add.
Step 3: Provide the code for the XML file.
Step 4: Create an ASP.NET web form.
Right-click on the project then select Add -> New Item then select Web in the installed templates then select Web form then provide a name then select Add.
Once you have added the web from, the next step is to add a data grid control to your web form (just simply drag and drop from the Toolbox) as shown below.
Step 5: Write Code in Web form
Understanding the code
It's just four lines of code and easy to understand.
I created a DataSet object in the first line (in the Page_Load event).
Invoke the ReadXml method to read the XML file and store it in ds (DataSet object).
Using the ds (DataSet object) as the DataSource for the GridView1.
Invoke the DataBind method as in the following:
Step 6: Run the Web form

Here is the data from our XML file.
We can also do this without writing even a single line of code (using XMLDataSource).
Ref. https://www.c-sharpcorner.com/UploadFile/18fc30/displaying-xml-data-in-Asp-Net-gridview/