Hi,
I need to save data in the grid when the user modifies and clicks on an asp button. But, the grid doesnot persist data when coming into the click event - it is losing its state on postback. Please assist me on how I can achieve the functionality.
My Grid:
<igtbl:UltraWebGrid ID="grdResults" EnableViewState="true" runat="server" OnUpdateRowBatch="grdResults_UpdateRowBatch" SkinID="CorePagingGrid" OnInitializeLayout="grdResults_InitializeLayout" OnInitializeRow="grdResults_InitializeRow"> <DisplayLayout> <ClientSideEvents CellClickHandler="grdResults_CellClick" /> </DisplayLayout> </igtbl:UltraWebGrid>
Thanks in advance,
Perumal.R
advancedmp said:Can you give an example of this?
Vince McDonald"] If you're manually creating data, the most likely cause is that you're creating your row objects in a way that they're not stored in ViewState. Create new UltraGridRow objects using the constructor that takes a boolean, pass true as that value, then add the new row to your grid - don't use the grid's Rows.Add() method to actually create the row.
If you're manually creating data, the most likely cause is that you're creating your row objects in a way that they're not stored in ViewState. Create new UltraGridRow objects using the constructor that takes a boolean, pass true as that value, then add the new row to your grid - don't use the grid's Rows.Add() method to actually create the row.
Can you give an example of this? I'm in a similar situation where I am manually creating rows and the data does not persist after a postback. I'm using the Rows.Add() method currently.
Did this issue ever reach a resolution? I've got the exact same problem but it has only surfaced in migrating from 2008.3 to 2009.1
I've got an UltraGrid control which i'm binding to a DataSet in code. The UltraGrid has a number of columns where AllowUpdate is set to yes and the values can be updated. On clicking a asp:button i'm interating through the UltraGrid.Rows collection to retrieve the values of each cell. I'm not rebinding the grid and EnableViewState is on in both the page and the UltraGrid itself.
Previously, i'd iterate through the cells and the edited cells would contain the new values, now (since upgrading to 9.1 - literally replacing the 8.3 UltraGrids with the 9.1 versions) when i iterate through the cells i'm getting the original values or null values for blank cells.
Has something changed between 8.3 and 9.1?
ThanksSteven
Hello,
The setup seems correct to me, from what I can tell. The only thing that comes to my mind is EnableViewState - please make sure you have set EnableViewState to true for the grid and for the page it is contained in.
If this does not help, maybe contacting Developer Support directly is the best idea. Developer Support can be reached at:
http://ko.infragistics.com/Support/#Overview
Please find the below code that is used to bind the webgrid grdResults.
{
// Initialize non-update panel controls
hdnOverrideFlag.Value = "0";
// Get the QueryString Values
hdnKitId.Value = Request.QueryString["kitId"];
// Load list
loadList();
}
try
long caseId = 0;
kitId = Convert.ToInt32(hdnKitId.Value); //Request.QueryString["kitId"]);
caseId = Convert.ToInt64(hdnCaseId.Value); //Request.QueryString["caseId"]);
if (results[0].Rows.Count > 0)
txtFacility.Text = Convert.ToString(results[1].Rows[0]["Facility"]);
txtRep.Text = Convert.ToString(results[1].Rows[0]["Rep"]);
grdResults.Clear();
grdResults.DataSource = results[2];
grdResults.DataBind();
Regards,