Well.
Please notice the bold, italicized line in the function below. It works fine (retrieves NEW, user-modified values from the RadGrid) after a fresh load of the page, but after a postback of the page, it retrieves the OLD values from the RadGrid.
Is there any Telerik-related reason this would happen? I really have no idea why the postback page works differently than the original page load.
Please notice the bold, italicized line in the function below. It works fine (retrieves NEW, user-modified values from the RadGrid) after a fresh load of the page, but after a postback of the page, it retrieves the OLD values from the RadGrid.
Is there any Telerik-related reason this would happen? I really have no idea why the postback page works differently than the original page load.
private
static
void
CaptureChangesInGrid(RadGrid targetGrid)
{
//Loop through each targetgrid item
foreach
(GridDataItem gridRow
in
targetGrid.MasterTableView.Items)
{
Dictionary<
object
,
object
> editDict =
new
Dictionary<
object
,
object
>();
targetGrid.MasterTableView.ExtractValuesFromItem(editDict, (gridRow
as
GridEditableItem));
foreach
(GridColumn column
in
targetGrid.MasterTableView.Columns)
{
CustomEditableColumn editableCol = column
as
CustomEditableColumn;
GridEditableColumn editColumn = editableCol
as
GridEditableColumn;
if
(editableCol !=
null
)
{
//Find the edit control in the given row
System.Web.UI.Control editItem = editableCol.FindControlInRow(gridRow);
if
(editItem ==
null
)
{
throw
new
ApplicationException(
"Unable to find edit control in for column: "
+ editableCol.HeaderText);
}
editableCol.CheckControlForChange(editItem, GetValueFromDictionary(editableCol, editDict));
}
}
}
}
Does anyone have a better way of retrieving user-entered values on a RadGrid which works after successive postbacks to the page? Or is there a way to fix this?
EnableViewState is enabled for the page.
The data entered is required for modifying the appearance of the page (highlighting for errors in entries, etc.) and thus I cannot have a fresh load performed every time. An undesirable option might be to place any user-edited data into the viewstate and perform a full refresh of the page and replace old data with the saved viewstate data... but that sounds like a lot of additional code for which I really don't have the time to create.
I'll be here all day, talk to me!
Thanks,
Jon
EnableViewState is enabled for the page.
The data entered is required for modifying the appearance of the page (highlighting for errors in entries, etc.) and thus I cannot have a fresh load performed every time. An undesirable option might be to place any user-edited data into the viewstate and perform a full refresh of the page and replace old data with the saved viewstate data... but that sounds like a lot of additional code for which I really don't have the time to create.
I'll be here all day, talk to me!
Thanks,
Jon