Solved

gridview in C#

Posted on 2011-02-18
1
829 Views
Last Modified: 2012-06-21
Hello all

I have a gridview with an edit button on a item template

The edit template is supposed to hide the gridview and bring another one up

However I need the value of one of the fields in the initial gridview (username)

Below is an example of the initial gridview

[username]   [ x]  [x] [x] [x]    //Headers

[value]

the item template is a label but I am getting a null exception error when I try to retrieve it. Can someone shed some light on this
0
Comment
Question by:samelamin
1 Comment
 
LVL 10

Accepted Solution

by:
daryal earned 500 total points
ID: 34924410
If you are trying to retrieve the value after going into edit mode, it is normal to have a null exception.
You have to get the value before page postback (going into edit mode);
two ways to do this;
- you can store the value on the ViewState or session
- you can pass the value as a parameter to page...
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now