How to hide "click here to add new row" option on radGridView

32 posts, 1 answers
  1. Hristo Merdjanov
    Admin
    Hristo Merdjanov avatar
    711 posts

    Posted 13 May Link to this post

    Hello Terje,

    Thank you for writing.

    Please make sure that you subscribe to the ViewRowFormatting event since the RowFormatting event fires only for the data rows: Row Formatting. Please check my code snippet below: 
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
     
            this.radGridView1.DataSource = this.GetData();
           
            this.radGridView1.ViewRowFormatting += radGridView1_ViewRowFormatting;
        }
     
        private void radGridView1_ViewRowFormatting(object sender, RowFormattingEventArgs e)
        {
            if (e.RowElement is GridNewRowElement)
            {
                e.RowElement.Text = "My custom add new row text";
                e.RowElement.DrawFill = true;
                e.RowElement.BackColor = Color.Navy;
                e.RowElement.NumberOfColors = 1;
            }
        }
    }

    I hope this helps. Should you have further questions please do not hesitate to write back.

    Regards,
    Hristo Merdjanov
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  2. Terje
    Terje avatar
    6 posts
    Member since:
    Oct 2013

    Posted 16 May in reply to Hristo Merdjanov Link to this post

    Hi!

     

    Thank's for fast answer Hristo Merdjanov, I got it working now.

    I also see that every post before me was talking about ViewRowFormatting, and not RowFormatting, which I was using..

  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top