Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
| Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old May 4th, 2007, 06:04 AM
Registered User
Join Date: May 2007
Location: Islamabad, As, Pakistan.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to mahboob_sabir Send a message via AIM to mahboob_sabir Send a message via MSN to mahboob_sabir Send a message via Yahoo to mahboob_sabir
Default gettting data from gridview in edit mode text cont

actually i want to get data for updaion in edit mode how i can data from text control when row in edit mode and click the update button

there is code through which i m trying bu t this code give me data which is in cell not in test box place over cell in edit mode

public void UpdateGridRecord()
        string firstname;
        string lastname;
        string city;
        string pid;
        //pid = gvPerson.Rows[RowToChange].Cells[1].Text;
        //firstname = Convert.ChangeType(gvPerson.Rows[RowToChange].Cells[2].Controls[0], TextBox).ToString();
        if (Convert.ChangeType(gvPerson.Rows[RowToChange].Cells[2].Controls[0], typeof(TextBox)) != null)
            firstname = ((TextBox)gvPerson.Rows[RowToChange].Cells[2].Controls[0]).Text;
        if (Convert.ChangeType(gvPerson.Rows[RowToChange].Cells[3].Controls[0], typeof(TextBox)) != null)
            lastname = ((TextBox) Convert.ChangeType(gvPerson.Rows[RowToChange].Cells[3].Controls[0],typeof(TextBox))).Text;
        if (Convert.ChangeType(gvPerson.Rows[RowToChange].Cells[4].Controls[0], typeof(TextBox)) != null)
            city = ((TextBox)gvPerson.Rows[RowToChange].Cells[4].Controls[0]).Text;

        //txtChildName = CType(grdchildgrid.Rows(intRowId).Cells(3).Control s(0), TextBox).Text

        DSPerson.UpdateParameters["personid"].DefaultValue = pid;
        DSPerson.UpdateParameters["firstname"].DefaultValue = firstname;
        DSPerson.UpdateParameters["lastname"].DefaultValue = lastname;
        DSPerson.UpdateParameters["city"].DefaultValue = city;

please help me
  #2 (permalink)  
Old May 8th, 2007, 02:05 AM
Friend of Wrox
Join Date: May 2006
Location: Delhi, Delhi, India.
Posts: 106
Thanks: 0
Thanked 0 Times in 0 Posts

make sure that data binding to grid is done ones.Might be Whenever u 'r are editing the grid page is posted back and control is populated with new data from db loosing what u've typed.


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to hide linkbutton in edit mode of a gridview hertendreef ASP.NET 2.0 Basics 0 July 31st, 2007 03:08 PM
Detect Edit Mode everest ASP.NET 2.0 Basics 0 December 19th, 2006 05:32 PM
Datagrid - edit mode Programator ASP.NET 1.0 and 1.1 Professional 1 September 5th, 2003 08:38 AM
Datagrid - edit mode Programator Classic ASP Professional 0 September 5th, 2003 03:13 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.