Datagrid problem that is frustrating me

P

Paul P

I have a datagrid control on my WebForm1.aspx page

In the page_load event I am doing the following

declare a new sqlconnection and set the connection string property to point to my SQL Server databas
Declare a sqldataadapter and the command to retrieve data using a stored procedure from the database
Then I fill my dataset using the adapter.fill method
Then I have a Dataview that points to my Dataset.Tables(0).DefaultVie
Then I set the Datasource of the Datagrid to point at my Dataview
Then I do a DataBind on the Datagrid

This brings the data and displays it just fine in the datagrid

I have put the Edit,Update,Cancel button as the first column as a LinkButton and the Edit appears on each row
I added a Bound Column to the Column list in the Property Builder and set the Data field to one of the fields returne
from the database. It works fine as far as displaying the correct data in the datagrid
No problems so fa
Now the problem is when I click the Edit link button, I expected the Bound Column for that row to change to a textbox and allow me to edit that data. Well it doesn't. I have looked at example code and books and I am getting frustrated

I thought this was a simple thing to do in .Net with the datagrid...

Please help... Thanks.
 
P

Paul P

Here is the HTML for the pag

<HTML><HEAD><title>WebForm1</title><meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1"><meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1"><meta name="vs_defaultClientScript" content="JavaScript"><meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5"></HEAD><body MS_POSITIONING="GridLayout"><form id="Form1" method="post" runat="server">&nbsp
<asp:DataGrid id="DataGrid2" style="Z-INDEX: 101; LEFT: 120px; POSITION: absolute; TOP: 88px
runat="server" Height="184px" Width="488px" AutoGenerateColumns="False"><Columns><asp:EditCommandColumn ButtonType="LinkButton" UpdateText="Update" CancelText="Cancel" EditText="Edit"></asp:EditCommandColumn><asp:BoundColumn DataField="Ques_txt" HeaderText="Ques"></asp:BoundColumn></Columns></asp:DataGrid></form></body></HTML>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,049
Latest member
Allen00Reed

Latest Threads

Top