[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.webcontrols

Datagrid problem that is frustrating me

=?Utf-8?B?cm9kY2hhcg==?=

2/25/2004 4:51:00 PM

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.
1 Answer

=?Utf-8?B?cm9kY2hhcg==?=

2/25/2004 5:06:00 PM

0

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&g... 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>