S
Stan
Not sure if this is by design or not, but it looks weird.
I get a datatable from cache:
dt = (DataTable) Cache[CacheKey];
Then, depending on selection in dropdown list I filter it:
DataView dv = dt.DefaultView;
if (cboStatus.SelectedIndex != 0)
{
int Status = int.Parse (cboStatus.SelectedItem.Value);
dv.RowFilter = string.Format ("CollectionStatusKey = {0}", Status);
}
And then, bind it to the datagrid:
grdMain.DataSource = dv;
grdMain.DataBind();
However, if dataview filter is set first time, it stays this way. What I
mean is the change in dataview gets stored in cache and dt = (DataTable)
Cache[CacheKey] brings back the old value on the next postback.
The question is this: if I add an item to cache and then modify this item,
would the modified item be automatically changed in cache? In other words,
is cache set by value or by reference?
Thanks,
-Stan
I get a datatable from cache:
dt = (DataTable) Cache[CacheKey];
Then, depending on selection in dropdown list I filter it:
DataView dv = dt.DefaultView;
if (cboStatus.SelectedIndex != 0)
{
int Status = int.Parse (cboStatus.SelectedItem.Value);
dv.RowFilter = string.Format ("CollectionStatusKey = {0}", Status);
}
And then, bind it to the datagrid:
grdMain.DataSource = dv;
grdMain.DataBind();
However, if dataview filter is set first time, it stays this way. What I
mean is the change in dataview gets stored in cache and dt = (DataTable)
Cache[CacheKey] brings back the old value on the next postback.
The question is this: if I add an item to cache and then modify this item,
would the modified item be automatically changed in cache? In other words,
is cache set by value or by reference?
Thanks,
-Stan