AddRow text

8 posts, 1 answers
  1. Pierre
    Pierre avatar
    212 posts
    Member since:
    Apr 2007

    Posted 28 Jan 2008 Link to this post

    Hi, it is possible to change the default "Click here to add a new row" ? I need to support french language to. I can't foun a property to change the default text programmatically.

    Thanks
  2. Answer
    Jack
    Admin
    Jack avatar
    2335 posts

    Posted 29 Jan 2008 Link to this post

    Hi Pierre,

    Thank you for this question.

    Yes, it is possible to change the "Add new row" text in RadGridView. You merely need to set the AddNewRowMessageString property of the LocalisationSettings property of the RadGridView.

    Let us know if you have other questions.

    Kind regards,
    Jack
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Mike
    Mike avatar
    14 posts
    Member since:
    Mar 2008

    Posted 27 May 2008 Link to this post

    I have the same question  as Pierre. I want to change the add row text. I followed the suggestion from Jack and set the LocalizationSettings/AddNewRowMessageString to simply "Add New Row...". When i run the form, the gridview add row still has the default text.

    i am using Q1 2008.

    any help is appreciated.
  5. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 28 May 2008 Link to this post

    Hi Mike,

    Thank you for this question.

    In Q1 2008, we introduced a new localization system in RadGridView. Now you are able to customize all strings in the grid using the RadGridLocalizationProvider class. There is a localization example under the RadGridView branch in the Examples application that comes included with our product.

    Consider the following code snippet:

    class MyLocalizationProvider: RadGridLocalizationProvider 
        public override string GetLocalizedString(string id) 
        { 
            if (id == RadGridStringId.AddNewRowString) 
            { 
                return "My custom add new row string goes here."
            } 
     
            return base.GetLocalizedString(id); 
        } 
     
    RadGridLocalizationProvider.CurrentProvider = new MyLocalizationProvider(); 
     

    I hope this helps. Let me know if you have other questions.

    Kind regards,
    Jack
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. John Hughes
    John Hughes avatar
    15 posts
    Member since:
    Mar 2010

    Posted 06 May 2010 Link to this post

    Is it possible to have a different AddNewRowString for different levels of hierarchy?  See my example below.

    * Click here to add a new Job
    + Job1
    + Job2
    -  Job3
        * Click here to add a new contractor                     
        + Contractor1
        + Contractor2


    Thanks,


    John
  7. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 10 May 2010 Link to this post

    Hello Mike,

    You can handle the ViewRowFormatting event to solve this issue. Please consider the code snippet below:

    void radGridView1_ViewRowFormatting(object sender, RowFormattingEventArgs e)
    {
        GridViewNewRowInfo newRowInfo = e.RowElement.RowInfo as GridViewNewRowInfo;
        if (newRowInfo != null)
        {
            if (newRowInfo.DataRowInfo != null || e.RowElement.Children[1].Visibility == ElementVisibility.Visible)
            {
                e.RowElement.Text = "";
            }
            else if (newRowInfo.ViewInfo.ParentRow != null)
            {
                e.RowElement.Text = "Click here to add a new contractor";
            }
            else
            {
                e.RowElement.Text = "Click here to add a new Job";
            }
        }
    }

    I hope this helps.

    Kind regards,
    Jack
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  8. John Hughes
    John Hughes avatar
    15 posts
    Member since:
    Mar 2010

    Posted 10 May 2010 Link to this post

    Thanks Jack.  This code solves my problem......almost.  What is happening now is that after I click on Add Contractor and get a new row, the text Add Contractor is written over the top of the cells in the row.  This makes it hard to tell what you are looking at in the row.  Once you are done with the row and add another one, then the text is not written there any more, but it does show up on the "new" row.  I have changed the AddNewRowPosition to PinnedRowPosition.Bottom.   Would that be causing this problem?

    Any thoughts or suggestions would be appreciated.

    Thanks,

    John
  9. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 13 May 2010 Link to this post

    Hi John,

    Despite my efforts, I was not able to reproduce the issue. Could you please send me your project? I will investigate the issue further and will try to find the best option for you. I am looking forward to your reply.

    Please note that you have to open a new support ticket in order to attach your project.

    Sincerely yours,
    Jack
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top
UI for WinForms is Visual Studio 2017 Ready