P
pv_kannan
One of our dev team members is having a strange problem with a
datagrid...
We are not seeing a datagrid's data getting refreshed after a new row
is entered in a popup window inspite of resetting the datasource and
rebinding it.
We have a datagrid (enabled viewstate) that binds to a collection class
that inherits the IList interface. The datagrid displays list of
associated contacts for a customer order.
We have a linkbutton to add new contacts. Once this link is clicked, a
popup window shows up and all contacts for the customer are displayed.
The user has the option to add a new contact at this point. When they
do so, a dataentry form shows up in the popup. The user then enters the
details and chooses to Associate the new contact to the customer. The
expected behavior is that the new contact should show up in the
datagrid. But it does not.
We are calling the method that resets the datasource and binds the data
to the grid in the data entry screen. Stepping thru the ItemDataBound
event also shows the presence of the new row in the datasource. But the
datagrid is not refreshed.
Is there a way to do this?
I have posted relevant pieces of code...
/************************OrderEdit.aspx) **********************/
Page Load
---------------
linkAddContact.Attributes.Add("onclick","javascript:OpenPopup('ContactSelect.aspx')");
RefreshOrderContacts()
---------------------------
public void RefreshOrderContacts()
{
OrderContactsData = SessionOrder.OrderContacts;
if (dataGridOrderContact.Items.Count != OrderContactsData.Count)
{
dataGridOrderContact.DataSource = OrderContactsData ;
dataGridOrderContact.DataBind();
}
}
ContactSelect.aspx
====================
<input type="button"
onclick="javascript:location.href='ContactEdit.aspx?Mode=Add'" value="
Add New Contact ">
ContactEdit.aspx
==================
btn_Associate Click event
-------------------------
SessionOrder.OrderContacts.Add(SessionOrder.OrderID,
SessionContact.ContactID);
labelMessage.Text = "Contact successfully associated!!!";
labelMessage.Visible = true;
OrderEdit orderEdit = (OrderEdit) Session["OrderEdit"];
orderEdit.RefreshOrderContacts();
datagrid...
We are not seeing a datagrid's data getting refreshed after a new row
is entered in a popup window inspite of resetting the datasource and
rebinding it.
We have a datagrid (enabled viewstate) that binds to a collection class
that inherits the IList interface. The datagrid displays list of
associated contacts for a customer order.
We have a linkbutton to add new contacts. Once this link is clicked, a
popup window shows up and all contacts for the customer are displayed.
The user has the option to add a new contact at this point. When they
do so, a dataentry form shows up in the popup. The user then enters the
details and chooses to Associate the new contact to the customer. The
expected behavior is that the new contact should show up in the
datagrid. But it does not.
We are calling the method that resets the datasource and binds the data
to the grid in the data entry screen. Stepping thru the ItemDataBound
event also shows the presence of the new row in the datasource. But the
datagrid is not refreshed.
Is there a way to do this?
I have posted relevant pieces of code...
/************************OrderEdit.aspx) **********************/
Page Load
---------------
linkAddContact.Attributes.Add("onclick","javascript:OpenPopup('ContactSelect.aspx')");
RefreshOrderContacts()
---------------------------
public void RefreshOrderContacts()
{
OrderContactsData = SessionOrder.OrderContacts;
if (dataGridOrderContact.Items.Count != OrderContactsData.Count)
{
dataGridOrderContact.DataSource = OrderContactsData ;
dataGridOrderContact.DataBind();
}
}
ContactSelect.aspx
====================
<input type="button"
onclick="javascript:location.href='ContactEdit.aspx?Mode=Add'" value="
Add New Contact ">
ContactEdit.aspx
==================
btn_Associate Click event
-------------------------
SessionOrder.OrderContacts.Add(SessionOrder.OrderID,
SessionContact.ContactID);
labelMessage.Text = "Contact successfully associated!!!";
labelMessage.Visible = true;
OrderEdit orderEdit = (OrderEdit) Session["OrderEdit"];
orderEdit.RefreshOrderContacts();