locked
to increase the tooltip time in gridview RRS feed

  • Question

  • hi..
     how to increase the time of the tooltip visibility in gridview in asp.net...can anyone help me...thanks in advance
    • Moved by OmegaMan Friday, March 5, 2010 4:16 PM (From:Visual C# General)
    Thursday, February 25, 2010 7:47 AM

Answers

  • Hi Muthukumar,
    one  work arround  that can  get you  out  if this  issue
            class testToolTip
            {
                public string P1
                {
                    get;
                    set;
                }
                public string p2
                {
                    get;
                    set;  
                }
            }
            ToolTip toolTip = new ToolTip();    
            public Form1()
            {
                InitializeComponent();
                List<testToolTip> lstToolTip = new List<testToolTip>();
                for (int i = 0; i < 100; i++)
                {
                    testToolTip  t =    new testToolTip()  ;  
                    t.P1 =   "Prop " + i.ToString();  
                    t.p2  =  "Prop 1" + i.ToString();
                    lstToolTip.Add(t);                
                }
                dataGridView1.DataSource = lstToolTip;
                toolTip.IsBalloon = true;
                toolTip.UseAnimation = true;
                toolTip.UseFading = true;   
               
            }
    
            private void dataGridView1_CellMouseEnter(object sender, DataGridViewCellEventArgs e)
            {
                
                Rectangle rect = this.dataGridView1.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, true);
                
                toolTip.Show(dataGridView1[e.ColumnIndex, e.RowIndex].Value.ToString(), this, rect.Location.X, rect.Location.Y,1000);
    
    
            }
    
    you  can  change  the last argument  to  increase  or  decrease  the  time interval instead  of 1000  you  can put  2000   
    Hope  this  can help
    A man's dreams are an index to his greatness
    • Proposed as answer by BRAHIM kamel Friday, February 26, 2010 8:45 AM
    • Marked as answer by Harry Zhu Thursday, March 4, 2010 2:34 AM
    Thursday, February 25, 2010 8:34 AM