Radgrid, not able to set page and item selected (chrome)

3 posts, 0 answers
  1. Oscar Emiliano
    Oscar Emiliano avatar
    20 posts
    Member since:
    Sep 2013

    Posted 28 Jul 2015 Link to this post

    Good morning Community,

     I'm having an issue under Chrome browser that is not allowing me to set the page index and a selected item. The scenario is that I have a main page showing a list of items. I use RadWindow as popup to add & edit actions. At code behind I use try and catch. If no exception is catched I call a javascript function to close RadWindow and pass "ok" as parameter, in case of an exception inside catch I call the same function but with "error" as parameter.

    This function looks as follow, depending the parameter I am calling two different javascript functions from parent page:

     function CloseWindow(refreshParent) {

                if (refresh​Parent == "yes") {
                else {

    These functions from parent are used to refresh grids and show message of success or error at the top of the page. A postback is executed, I set the EVENTTARGET (1st value) and EVENTARGUMENT (2nd value):

    function RefreshSuccess() {
                __doPostBack("<%= uppMain.ClientID %>", "ok");

    function RefreshError() {
                __doPostBack("<%= uppMain.ClientID %>", "error");

    So, when the postback is executed on parent's Page_Load method (at code behind) I'm checking the value of target & argument and then I can set the color of the message (blue if success, salmon when error)

    string eventTarget = Request.Params.Get("__EVENTTARGET");
    switch (eventTarget)
                        case "MainCPH_uppMain": 

                        string resultMessage = Request.Params.Get("__EVENTARGUMENT");

                        if (resultMessage == "ok")
                                lblMessage.Attributes.Add("style", "display:block");
                                lblMessage.BackColor = System.Drawing.Color.LightSkyBlue;
                                lblMessage.Text = "The information has been successfully saved.";




                                lblMessage.Attributes.Add("style", "display:block");
                                lblMessage.BackColor = System.Drawing.Color.Salmon;
                                lblMessage.Text = "A problem has ocurred when saving the information.";​



    When adding a new item to the grid (alphabetic order), I require to make the new element appear as selected, including if necessary a change of page. For this, when the save was successful I'm searching for the newest item's ID, page by page and set its selected property to true:

    NOTE: I am using multi-tier structure, so I have a Model layer where I have a definition of the model Item, I use a list of those models as datasource of the grid and that is why I cast the items to that model.

                                int i = 0;
                                for(i=0; i < gridItems.PageCount; i++)
                                    gridItems.CurrentPageIndex = i;
                                    foreach (GridDataItem item in gridItems.Items)
                                        Model.​Item ​myItem= (Model.​Item)item.DataItem;
                                        if (​myItem.CompanyID == ​newestID)
                                            item.Selected = true;                                                                         
                                            break; // break, once it is found there is no need to keep searching

    And well, here is the issue, everything is working just fine under Firefox and Internet Explorer, but for some reason is not working under chrome, the page of the grid is not changing and the new item does not appear as selected. So, the .CurrentPageIndex and the .Selected seems not to be working. Any ideas?

     I tried to simplify my example, the real page is using different tabs (that's why I need the EVENTTARGET, as sometimes I only need to refresh one tab but in some cases I need to refresh multiple tabs). The page is also calling different RadWindows. That is why I would like to keep the solution of the issue at the same level that I have the logic, at Page_Load method under Parent's codebehind.

    Thanks in advance, any hint will be highly appreciated. Let me know if more details are required. 



  2. Oscar Emiliano
    Oscar Emiliano avatar
    20 posts
    Member since:
    Sep 2013

    Posted 29 Jul 2015 in reply to Oscar Emiliano Link to this post

    Hi again, any admin that could give some help?

     Thanks in advance, regards

  3. Konstantin Dikov
    Konstantin Dikov avatar
    2124 posts

    Posted 31 Jul 2015 Link to this post

    Hi Oscar,

    It seems that you have a rather complex scenario and without a sample project it will be really difficult to determine what could be causing the issue in Chrome. Can you please debug your page and see if the logic for setting the selected item and the page index is executed when you run the page in Chrome?

    As for any particular suggestion, can you please open a regular support ticket and attach a sample, runnable project that replicates the problem, so we can test it locally. 

    Best Regards,
    Konstantin Dikov
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top