Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

gridview in C#

Posted on 2011-02-18
1
Medium Priority
?
843 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 10

Accepted Solution

by:
daryal earned 2000 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

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

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…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

705 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