Hello support,
I have implemented custom state persistence on the grid(search string, order, filtering, selected row). Needed data are stored clientside in a cookie and used serverside. I can successfully apply all except the selected row.
To be able to select the correct row i need to traverse all rows(row might have been deleted by another user) and the problem is i cannot find the rows in the grid object(i am using an offline DataManager with a JsonAdaptor).
I will not be using the native persistence syncfusion provides because i
need full control over it(action wise and time wise) and it was also
breaking the appearance of the grid for some reason.
Here are the important parts of the code:
aspx:
cs: (this part of code is before DataBind())
I have also tried before to apply persistence data on client side but i
would like to avoid that for 1) UX reasons(speed) 2)Could not apply
persistence on DataBound event as stated in many answers. I was able to
use onActionComplete event but still faced problems with selectedRow.
So, i would like to get an array of objects/rows (after applying search, sort and filter) so i can correctly try to find the index of the row then calculate page number and at last select row.
Hello,
My requirements are different.
I want to select a row in code behind(the one that is saved in a cookie). In order to do that i need to traverse all the grid rows to make sure the row is still there(could have been deleted by another user). So i am looking for a property in the Grid that holds all the rows ( so the getCurrentViewRecords method is not gonna work).
This is how i am doing it now in the client side and i want to run this logic on the serverside:
Please read again my initial post, same info are there about my requirements.
[aspx.cs]
protected void Page_Load(object sender, EventArgs e)
{
var datasource = OrderRepository.GetAllRecords().ToList();
this.FlatGrid.DataSource = datasource;
int rowindex = datasource.FindIndex(a => a.OrderID == 10307) % 12;
int currentPage = datasource.FindIndex(a => a.OrderID == 10307) / 12 + 1;
this.FlatGrid.SelectedRowIndex = rowindex;
this.FlatGrid.PageSettings.CurrentPage = currentPage;
this.FlatGrid.DataBind();
} |