ComponentOne True DBGrid Pro 8
LayoutURL Property

This property sets or returns the string containing the URL (Uniform Resource Locator) used for retrieving grid layouts.

Syntax

object.LayoutURL = string

Remarks

Read/Write at run time and design time.

The LayoutURL property is similar to LayoutFileName except that it downloads a grid layout file from an HTTP server instead of opening a file on the local machine or a network.

You can create grid layout files at design time by setting the LayoutFileName and LayoutName properties and using the layout commands on the grid's visual editing menu.

If you set the LayoutURL property to a nonempty string at design time (and LayoutFileName is empty), the grid initiates asynchronous downloading at run time after it has been loaded. You can also initiate downloading by setting the LayoutURL property in code. This technique is particularly useful for initializing a grid on an HTML page.

In either case, the grid fires the LayoutReady event when the download operation has completed. You should write a handler for this event that loads the desired layout as follows:

TDBGrid1.LayoutName = "MyLayout"

TDBGrid1.LoadLayout

Note

Since the grid downloads layout files asynchronously, the following code may not work as expected:

TDBGrid1.LayoutURL = "http://www.bigcorp.com/layouts.grx"

TDBGrid1.LayoutName = "MyLayout"

Depending upon file size and available bandwidth, the download initiated by the first statement may still be in progress when the second statement executes. Therefore, the layout specified in the second statement may not yet exist. Conversely, if the download finishes quickly, it is possible for the LayoutReady event to fire before the second statement executes. For these reasons, the recommended procedure is to set the LayoutName property in the LayoutReady handler, immediately before calling the LoadLayout method.

See Also

TDBGrid Control

TDBDropDown Control

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback