This is a migrated thread and some comments may be shown as answers.

Custom Insert Text?

3 Answers 56 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 04 May 2010, 02:39 AM
This seems like a pretty simple request so I am hoping there is an easy way to satisfy it.  Can we easily change the text of the insert new row label?  I believe it starts out as insert new record or something along those lines and we would like to change the text to something else.  Is this easily possible?

3 Answers, 1 is accepted

Sort by
0
Kalin Milanov
Telerik team
answered on 04 May 2010, 12:16 PM
Hi Andrew,

 To do that you will need to edit the template of the new row and change the text from there. Attached I am sending you a sample which achieves just that. I hope you will find it useful.

Best wishes,
Kalin Milanov
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.
0
Andrew
Top achievements
Rank 1
answered on 04 May 2010, 05:01 PM
This works...thought it does seem like the kind of thing that is a common enough need that it might make sense to add it as an option on the Grid itself rather than requiring a style implementation.
0
Milan
Telerik team
answered on 05 May 2010, 08:36 AM
Hello Andrew,

We would definitely think about providing an easier way of changing the text. 

You could try a different approach by utilizing our localization mechanism to change the text without the need to provide custom style. You can find more information about our localization mechanism here.

Since you just want to change a single text you could try something like this:

public class CustomLocalizationManager : LocalizationManager
{
  public override string GetStringOverride( string key )
  {
      switch( key )
      {
          case "GridViewAlwaysVisibleNewRow":
              return "New Insert Text" 
      }
  
      return base.GetStringOverride( key );
  }
}

public partial class App : Application
{
    public App()
    {
        LocalizationManager.Manager = new CustomLocalizationManager();
    }
}

Hope this helps.


Regards,
Milan
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.
Tags
GridView
Asked by
Andrew
Top achievements
Rank 1
Answers by
Kalin Milanov
Telerik team
Andrew
Top achievements
Rank 1
Milan
Telerik team
Share this question
or