RadGrid tooltip refresh no working

4 posts, 0 answers
  1. Laimis
    Laimis avatar
    2 posts
    Member since:
    May 2017

    Posted 09 Jul Link to this post

    I have very simple RadGrid that is being loaded from database

     <telerik:RadGrid ID="RadGrid1" runat="server" Skin="MetroTouch"  OnPreRender="RadGrid1_PreRender" OnItemDataBound="RadGrid1_ItemDataBound" ></telerik:RadGrid>

     

    This populates my tooltip:

     protected void RadGrid1_PreRender(object sender, EventArgs e)
            {

    foreach (GridDataItem dataItem in radgrid2.MasterTableView.Items)
                {
                    dataItem["Offset_Rank"].ToolTip = dataItem["OffsetToolTip"].Text;
                }
            }

     

    My problem is, once I change my lookup parameters and reload the radGrid my tool tip becomes null,  what am I missing?

     

    Any help would be helpful.

    Thanks

  2. Eyup
    Admin
    Eyup avatar
    3333 posts

    Posted 12 Jul Link to this post

    Hi Laimis,

    Please verify that after this change the dataItem["OffsetToolTip"].Text value is properly accessed. Alternatively, you can try to achieve this requirement using ItemDataBound event handler:
    http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/rows/accessing-cells-and-rows#accessing-raw-field-data-and-key-values

    I hope this will prove helpful.

    Regards,
    Eyup
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Laimis
    Laimis avatar
    2 posts
    Member since:
    May 2017

    Posted 13 Jul in reply to Eyup Link to this post

    thanks for the reply,  one more question, my code works fine and the tooltip shows the value after the page load and also after the radgrid refresh, but it breaks if I hide the column OffsetToolTip (which populates the tooltip), but it only breaks after I refresh the data in ragrid, the initial load works.
  4. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3916 posts

    Posted 18 Jul Link to this post

    Hi Laimis,

    When the column is Visible=false, its data is not available, and this is expected.

    One way of working around that is to add the OffsetToolTip field to the DataKeyNames collection of the TableView and use item.GetDataKeyValue("OffsetToolTip") to access it.

    Regards,

    Marin Bratanov
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top