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...
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 =...
RadControls for WinForms Q2 is live! It has been exhaustive, but motivating 4 months since the last major release and I am very happy to announce the new version of our innovative Windows Forms components.
As I had promised the last time, I will be providing you with interesting and helpful information about the WinForms suite. With Q2 out of the door, I will turn to two of the basic controls which we have included in this release, literally at the last moment, namely RadBreadCrumb and RadDateTimePicker. RadBreadCrumb is a navigation control directly related to the well-known to the community RadTreeView for...
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...
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...
While working on the second release for 2007, Telerik decided to surprise its clients by creating a Silverlight game. The idea was simple. A registered user enters his or her weight and logs in. This weight contributes to the common goal which is to lift what is on the other side of the rope. The game was developed using Silverlight 1.1 Alpha Refresh. We had couple of concerns while developing it, though. First of all we did not know how many people have already installed the 1.1 plug-in. Also we were not sure if the current game was going to reach the popularity...
By now you probably know that one of the biggest new features in RadGrid 5.0 is support for export to PDF. For quite some time, RadGrid has supported direct export to Microsoft Word and Excel formats, but the addition of PDF export elevates the Grid's exporting capabilities to unprecedented levels. Using the new export feature couldn't be easier. As with previous export formats, all that is required is a call to a single simple RadGrid method: this.RadGrid1.MasterTableView.ExportToPdf();When you call this method, all of the data in the Grid is exported to a new PDF that the users can then save to their local...
I'm pleased to announce that RadGrid 5.0 will have full support for LinqDataSource and WCSF ObjectContainerDataSource. The grid will be available for download in the beginning of the next week (17-18 September) and in the meantime you can check the attached examples:LinqDataSource exampleObjectContainerDataSource...
Below is a summary of the new online resources available for our ASP.NET controls:RadGrid Code library entries: GridClientSelectColumn -- (un)check "Select All" check box automatically: http://www.telerik.com/community/code-library/submission/b311D-hgmtb.aspx Help topics: Insert/Update/Delete at database level with queries (not uploaded yet)
NOTE: From the very beginning I would like to state that this custom solution is temporary and will most probably change with the next release of Silverlight Plug-In. There is no straightforward approach to changing the Silverlight Download logo. However, a workaround exists. 1) Download the modified TelerikSilverlight.js and add it to your project 2) Within the Default.aspx of your project, reference TelerikSilverlight.js <script type="text/javascript" src="TelerikSilverlight.js"></script> 3) Create a javascript function right bellow the previous line of code <script type="text/javascript"> function GetInstallHtml () { var imgUrl = "http://www.telerik.com/images/editor/OverviewImages/SilverlightLogo.gif"; var myInstallHtml = 'This is my custom text<br/>' + '<div style="width: 205px; height: 67px; background-color: #FFFFFF">' + '<img onclick="javascript:Silverlight.followFWLink({0});"' + 'style="border:0;...