Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
75
how to enable tooltip in mvc controller
posted

Hi ,

How to enable tooltip feature in dynamically created column in the controller

foreach (var year in Years)
                    {
                        col = new GridColumn()
                        {
                            HeaderText = years,
                            Key = years,
                            DataType = "double",
                           
                        };
                        Genyr.Columns.Add(col);
                        ColumnUpdatingSetting colUpdate = new ColumnUpdatingSetting();
                        colUpdate.ColumnKey = years;
                        colUpdate.DefaultValue = "0.00";
                        colUpdate.Required = true;

                        lsColumnSettings.Add(colUpdate);
                  
                    }
                    GridTooltips g = new GridTooltips();
                    g.Name = "tooltip";

                    GridUpdating update= new GridUpdating() { ColumnSettings = lsColumnSettings,EnableAddRow = false};
                    Genyr.Features.Add(update);
                    

Parents
No Data
Reply
  • 29417
    Offline posted

    Hello George,

     

    Thank you for posting in our forum.

    You can create and add the tooltips feature, for example: 

    GridTooltips tooltips = new GridTooltips();
    tooltips.Visibility = TooltipsVisibility.Always;
    gridModel.Features.Add(tooltips);
    

     And then in the foreach loop create and add the column setting for the related column to the tooltip feature, for example:

    foreach (var item in data)
                {
                    ColumnTooltipsSetting setting = new ColumnTooltipsSetting();
                    setting.ColumnKey = item;
                    setting.AllowTooltips = true;
                    tooltips.ColumnSettings.Add(setting);
                }

     Let me know if you have any additional questions or concerns. 

    Regards,

    Maya Kirova

     

     

Children