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.
}
}
|