Solved

gridview in C#

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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 article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

856 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