Datagrid problem that is frustrating me

Discussion in 'ASP .Net Web Controls' started by Paul P, Feb 25, 2004.

  1. Paul P

    Paul P Guest

    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.
     
    Paul P, Feb 25, 2004
    #1
    1. Advertising

  2. Paul P

    Paul P Guest

    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>
     
    Paul P, Feb 25, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Simon Harvey
    Replies:
    1
    Views:
    328
    Guest
    Apr 2, 2004
  2. michael
    Replies:
    0
    Views:
    438
    michael
    May 1, 2004
  3. Bit byte
    Replies:
    1
    Views:
    327
    mlimber
    Apr 17, 2006
  4. James

    Server Wide Problem (frustrating)

    James, Aug 15, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    277
    James
    Aug 15, 2007
  5. michael
    Replies:
    0
    Views:
    110
    michael
    May 1, 2004
Loading...

Share This Page