CellClick event fires on maximise

2 posts, 0 answers
  1. Juzzer
    Juzzer avatar
    12 posts
    Member since:
    Sep 2007

    Posted 20 May 2008 Link to this post

    **Update**
    Issue arrises on Vista Business and Win2k3 but not XP (only 3 OS's tested so far)

    Double clicking on a forms title bar to maximise the form causes the Gridview's CellClick event to fire.

    This will only happen if the mouse is hovering over a row in the grid after the form is maximised.

    The CellClick event doesn't fire if you maximise the form with the top right form button.

    using System;
    using System.Data;
    using System.Windows.Forms;

    namespace GridTest
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }

            private void radGridView1_CellClick(object sender, Telerik.WinControls.UI.GridViewCellEventArgs e)
            {
                DoStuff();
            }
            private static void DoStuff()
            {
                MessageBox.Show("Fired from CellClick");
            }

            private void Form1_Load(object sender, EventArgs e)
            {
                DataTable dt = new DataTable("Stuff");

                DataColumn dc = new DataColumn {DataType = typeof (string), ColumnName = "1"};
                dt.Columns.Add(dc);

                dc = new DataColumn {DataType = typeof (string), ColumnName = "2"};
                dt.Columns.Add(dc);

                dc = new DataColumn {DataType = typeof (string), ColumnName = "3"};
                dt.Columns.Add(dc);

                dc = new DataColumn {DataType = typeof (string), ColumnName = "4"};
                dt.Columns.Add(dc);

                for (int i = 0; i < 20; i++)
                {
                    DataRow dr = dt.NewRow();
                    dr[0] = "Fluff";
                    dr[1] = "Fluff";
                    dr[2] = "Fluff";
                    dr[3] = "Fluff";

                    dt.Rows.Add(dr);
                }

                radGridView1.DataSource = dt;
                radGridView1.MasterGridViewTemplate.Columns[0].Width = 350;
                radGridView1.MasterGridViewTemplate.Columns[1].Width = 350;
                radGridView1.MasterGridViewTemplate.Columns[2].Width = 350;
                radGridView1.MasterGridViewTemplate.Columns[3].Width = 350;
            }
        }
    }

  2. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 22 May 2008 Link to this post

    Hello Juzzer,

    Please find the answer in the other support ticket you have opened, that refers to the same issue.

    Greetings,
    Martin Vasilev
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top