Solved

Gridview disappears when clicking Edit record

Posted on 2014-02-21
3
648 Views
Last Modified: 2014-02-24
I have a drop down list that controls the SelectCommand data of a gridview datasource on SelectedIndexChanged.  The issues is after the data is populated, I select the Edit option for a record, the gridview disappears.  I have tried making it a session variable, but the same thing happens.
  protected void ddlTerm_SelectedIndexChanged(object sender, EventArgs e)
{        
SqlDSApp.SelectCommand = ("SELECT [RFSID], [DID], [DSubmitDate] FROM [Demo] WHERE (DSubmitTerm = '" + ddlTerm.SelectedValue + "')");

            gvRSStudents.DataBind();       
}

Open in new window

Thanks for any help!
0
Comment
Question by:javierpdx
3 Comments
 
LVL 28

Expert Comment

by:sammySeltzer
ID: 39879228
This code doesn't help because it doesn't relate to the issue you are having.
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 39880654
If a control disappears on post-back, then the problem is usually that you didn't rebind data.
0
 

Author Closing Comment

by:javierpdx
ID: 39883607
Thanks.  I appreciate the help.
0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

809 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