HOW TO edit single row textbox in gridview

Last post 05-12-2008 4:13 AM by lnwThai. 2 replies.

Sort Posts:

  • HOW TO edit single row textbox in gridview

    05-12-2008, 3:26 AM
    • Loading...
    • enghsiang
    • Joined on 06-14-2007, 5:03 AM
    • Malaysia
    • Posts 202

    Above is the look of my gridview.

    the textbox is set to read only = true 

    what i want is, when the edit button is click, the the textbox of that row can change to read only = false .

    when the textbox become editable, the column data should remain, and let user to edit. once they finish edit and press the update button ( adding in later), the db will be update by the latest edited record.

     Anyone have any idea??

    Help are highly appreciated!

     

    C#######################################
  • Re: HOW TO edit single row textbox in gridview

    05-12-2008, 4:06 AM
    Answer
    • Loading...
    • sivakl_2001
    • Joined on 01-11-2008, 8:13 AM
    • Kuala Lumpur, Phileo Damansara
    • Posts 503

    if ur Template Field like this do like this

    <asp:TemplateField HeaderText="Problem">

    <ItemTemplate>

    <asp:TextBox TextMode="multiLine" Columns="20" ReadOnly="true" Rows="2" ID="sts_Label" runat="server" Text='<%#Eval("problem")%>' ></asp:TextBox>

    </ItemTemplate>

    <EditItemTemplate>

    <asp:TextBox TextMode="multiLine" Columns="20" Rows="2" ID="sts_Label" runat="server" Text='<%#Bind("problem")%>' ></asp:TextBox>

    </EditItemTemplate>

    </asp:TemplateField>

     

     

     

  • Re: HOW TO edit single row textbox in gridview

    05-12-2008, 4:13 AM
    • Loading...
    • lnwThai
    • Joined on 02-29-2008, 5:13 AM
    • BKK
    • Posts 131

    for change Textbox in Gridview to Read only false 

    must do in GridView Tasks  on the top right of your Gridview

    and Click on Edit Template >>> select your Column  you will see textbox in that Column and click on textbox

    so you will change its Big Smile to read only

    Hope can Help

    If you want a thing well done, do it yourself
Page 1 of 1 (3 items)