Telerik blogs

Latest

  • Web ASP.NET AJAX

    Localizing RadEditor Prometheus by Using Global Resource Files

    The Localization of the new RadEditor "Prometheus" now works with resource files and not with XML files as before. This change was made as resources represent the standard ASP.NET 2.0 mechanism for doing this with extensive built-in support in Visual Studio. As a result, it is a much easier approach for the developer in creating or changing a localization. Another major advantage of this is it is also much easier to deploy and maintain. The following movie, available at http://www.telerik.com/ClientsFiles/product.videos/30/, provides guidance how to make your own localizations by using global resource files. More information is also available in the following forum sticky note: Localizing RadEditor by Using Global Resource...
    September 28, 2007
  • Web ASP.NET AJAX

    On dynamically creating server controls

    Every once in a while I see code which looks like that:public class MyCustomControl : WebControl{     protected override void Render(HtmlTextWriter output)     {          SomeControl someControl = new SomeControl ();          someControl.ID = "SomeID";          someControl.SomeProperty = "SomeValue";          someControl.RenderControl(output);    }}There are two problems with this code: The child control is instantiated in the Render methodFrom control execution lifecycle’s point of view it is too late to instantiate controls in the Render method. Even if you add them in the controls collection some features won’t work just because it’s too late – postbacks, viewstate to name a few. The child control is never added to the controls collection. This means...
    September 28, 2007
  • Web

    How wrong custom ViewState handling may harm more than help

    As some of us have found last Friday this article in MSDN about how to store your ViewState in Session is totally wrong. Using the Reflector you can find very easily that ControlState will be erased if you access more than once PageStatePersister. The correct implementation should be:      PageStatePersister _pers;      protected override PageStatePersister PageStatePersister      {          get          {              if (_pers == null)                  _pers = new SessionPageStatePersister(this);              return _pers;          }      } How about overriding SavePageStateToPersistenceMedium / LoadPageStateFromPersistenceMedium? If you do this you should update your PageStatePersister or you will miss the ControlState once again. Example: protected override object LoadPageStateFromPersistenceMedium() {      object state = THESTATE;      if (state is Pair)      {          Pair statePair = (Pair)state;          PageStatePersister.ControlState =...
    September 26, 2007
  • Web

    How To: Format RadGrid PDFs

    On Monday, I showed you some the new settings in RadGrid 5 the enable you to control certain aspects exported PDFs. We looked at how you can easily set the PDF's metadata, change its filename, and even control the PDF's security settings. All of these settings- along with the ability to force the PDF to open in a new window- can be set with a single property in the Grid's new ExportSettings configuration block. What we didn't look at on Monday is how you can control the formatting of your exported PDFs. Today we'll take a look at how you can customize...
    September 19, 2007
  • Web ASP.NET AJAX

    The new default skin (and how to switch back :)

    With the Q2 release, we have decided it is time to refresh the look and feel of RadControls components to stay on the edge of the latest trends in visual design for the web. And ever since Vista, black is the new white… so we just had to join in with a trendy new theme for the default skins of our controls. The Q2 2007 skin sports a modern black twist, improved contrast, and larger font-sizes/more generous white space for a touch of web2.0 in your applications. While we ardently urge everyone to switch to the new look, we do...
    September 19, 2007