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.