Solved

gridview in C#

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Call to SQL server times out 5 55
Pdf not loading 2 39
Difference between Highcharts and Mapbox 10 44
Unable to Install .NET 3.5 on Windows 2012 server 4 14
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

739 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