Solved

gridview in C#

Posted on 2011-02-18
1
826 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

762 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