473,583 Members | 3,089 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Gridview not refreshing!

I have a GridView in a FormView that has as its datasource a DataTable
that is stored in the session cache.
When I first load the page the GridView is displayed correctly, but on
subsequent loads the GridView does not display. I've debugged the
DataTable and even when it has data and is bound to the GridView, when
the page loads the GridView is not displayed. I set the datasource and
then bind the GridView. I've tried disabling the ViewState for the
GridView but to no avail.
I'm at a loss to understand why the GridView is not displaying! I
suspect its due to the FormView but can't prove anything yet. Any
ideas?
Thanks for reading.

Oct 4 '06 #1
1 5208
To give you some more details - the user clicks on a row in a gridview
called GrdVwLabelsSear chResults and then the method
DisplayLabelDet ails() is called, which calls
BindSignatoryAn dCCGridViews() to update the gridview GrdVwLabelConta cts
on the FormView.
The datasource for GrdVwLabelConta cts is a DataTable which is kept in
the Session Cache because rows can be added and removed from this
GridView.

protected new void Page_Load(objec t sender, EventArgs e)
{
//To trap a click event on the GrdVwLabelsSear chResults
gridview
string controlName = Request.Params. Get("__EVENTTAR GET");
string passedArgument =
Request.Params. Get("__EVENTARG UMENT");

//check to see if the passedArgument was from the
GrdVwUsersSearc hResults
//Get the labelID of the selected row and then
//display label details
if (controlName == "GrdVwLabelsSea rchResults" &&
passedArgument. StartsWith("Row Clicked"))
{
string labelID = passedArgument. Substring(10);
DisplayLabelDet ails(labelID);
}

}

protected void DisplayLabelDet ails(string labelid)
{
//change FormView to Edit Mode
FrmVwLabel.Chan geMode(FormView Mode.Edit);

//bind the Label Signatory and Contact Gridviews
BindSignatoryAn dCCGridViews(la belid);
PnlLabelDetails .Visible = true;
FrmVwLabel.Visi ble = true;
}

protected void BindSignatoryAn dCCGridViews(st ring labelStr)
{

DataTable labelCCDT = new DataTable();
if (CacheSession.G etLabelCCDT() == null)
{
labelCCDT = LabelManager.Ge tContactsForLab el(labelId,
contactRoleId);
CacheSession.Se tLabelCCDT(labe lCCDT);
}
else
{
labelCCDT = CacheSession.Ge tLabelCCDT();
}
GridView grdVwLabelCC =
(GridView)FrmVw Label.FindContr ol("GrdVwLabelC ontacts");
grdVwLabelCC.Da taSource = labelCCDT;
grdVwLabelCC.Da taBind(); //<----- this is not updating the GridView
correctly
grdVwLabelCC.Vi sible = true;
}

jo*********@gma il.com wrote:
I have a GridView in a FormView that has as its datasource a DataTable
that is stored in the session cache.
When I first load the page the GridView is displayed correctly, but on
subsequent loads the GridView does not display. I've debugged the
DataTable and even when it has data and is bound to the GridView, when
the page loads the GridView is not displayed. I set the datasource and
then bind the GridView. I've tried disabling the ViewState for the
GridView but to no avail.
I'm at a loss to understand why the GridView is not displaying! I
suspect its due to the FormView but can't prove anything yet. Any
ideas?
Thanks for reading.
Oct 4 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1832
by: H5N1 | last post by:
Hi there My problem is that in when I update GridView row, which is nested into DataList control, I want to refresh also DataList in which the GridView is nested, since after update, trigger in my DB changes some value in it (some Total sum from the GridView column). The GridView, along with its ObjectDataSource is inserted into DataList...
1
4689
by: planetthoughtful | last post by:
Hi All, I have an ASP.NET page that is used to insert records into an SQL Server table (see previous post). I also have a GridView on the same page that displays the results of a query on the same table the records are inserted into when the page is submitted. I'm wondering if there's a way to requery / refresh the records being...
1
1578
by: Loading name... | last post by:
hey asp.net 2.0 I have a GridView on my webpage. This GridView get its data from a SqlDataSource. On the same webpage I've added textbox and a button - so the user can add records to the table which the GridView is based on...
0
1204
by: Steven Nagy | last post by:
Howdy, In design mode of a gridview, setting the PagerStyle CssClass property, and then refreshing the gridview via rightclick -refresh, to get the new styles applied, and the property gets removed from the PagerStyle settings. This doesn't happen with any of the other applied styles. In fact, I am applying the same style class to the...
0
1588
by: luvdairish | last post by:
Controls (in order on page) 1.)GridView - each row is a work order w/ a link for details in the last column 2.)DetailsView - when user clicks on link from above GridView, the details are shown 3.)GridView - nested in the footer of the above DetailsView. each row is a person assigned to that work order 4.)DetailsView - only visible when the...
3
3885
by: Dave | last post by:
I have an GridView on one page that will open a popup for the selected record. I've been told that there is a way that when the popup record is updated the GridView can be refreshed or Databind. I've been looking for the answer with no luck. I'm probably just not asking the question correctly. Thanks for any assistance.
0
1572
by: Don | last post by:
I have a GridView inside an UpdatePanel. This GridView has a command field (edit, update, cancel). When I click edit I go into update mode, refreshing only the GridView, as you would expect. When I click cancel or update the browser hangs. Stepping through the debugger I can see that the update code is executed when update is clicked. ...
3
1458
by: COHENMARVIN | last post by:
I have a gridview control that is filled by the user adding rows to it with a submit button. Once he is totally through, I want to give him a 'success' message and then empty the grid. That should be easy, because the grid is full of records that are from a database where the select statement retrieves by using a compare parameter that is a...
5
270
by: brian | last post by:
I have a gridview that will contain 5000 + rows that is initially loaded into a dataset and bound to a gridview. On the form I have textboxes and dropdown list's I use to let the user fill in and click an add button to add new records. As I let users add records I update the SQL backend (insert a record). I want to programattically add a...
0
7895
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7826
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8182
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8327
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8193
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6579
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5701
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3818
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1433
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.