Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Professionals
|
ASP.NET 3.5 Professionals If you are an experienced ASP.NET programmer, this is the forum for your 3.5 questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Professionals 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
 
Old March 2nd, 2011, 12:09 AM
Registered User
 
Join Date: Feb 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Passing gridview row value to textbox

hi,

i have an error in passing gridview value to textbox can you please help me what is an error..please


thnaks



<asp:TemplateField>
<AlternatingItemTemplate>
<asp:Button ID="AcctView" runat="server" CommandArgument='<%# Container.DisplayIndex %>'
Text="Select" CommandName="View" />
</AlternatingItemTemplate>
<ItemTemplate>
<asp:Button ID="AcctView" runat="server" CommandArgument='<%# Container.DisplayIndex %>'
Text="Select" CommandName="View" />
</ItemTemplate>
</asp:TemplateField>





if (e.CommandName.Equals("View"))
{

int index = Convert.ToInt32(e.CommandArgument.ToString());
GridViewRow gvRow = GLDataView.Rows[index];
TextBox tbActualOrder = (TextBox)gvRow.FindControl("txtChartAccount");
txtNewChartAccount.Text = Convert.ToString(tbActualOrder.Text); error : Object reference not set to an instance of an object.

}
}





Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't get value from TextBox in GridView MonkeyMan666 ASP.NET 3.5 Basics 1 February 26th, 2010 04:35 AM
Copy One Row from Gridview to Gridview lvprasad2007 ASP.NET 2.0 Professional 0 July 28th, 2009 08:29 AM
GridView Textbox Limno .NET Framework 1.x 0 May 28th, 2008 02:35 PM
Gridview with only one row mallikalapati ASP.NET 2.0 Professional 5 March 5th, 2008 09:27 AM
Gridview with only one row mallikalapati ASP.NET 2.0 Professional 0 February 25th, 2008 06:46 AM





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