Check documentation for the latest version of dhtmlxSuite Data Loading HowTos DHTMLX Docs

Data Loading HowTos

How can I enable dynamic loading?

To enable dynamic loading you should:

  • enable the related mode on the client side (e.g. smart rendering or paging for grid)
  • on the server side use one of the two properties: EnableDynamicLoading (for tree/treeGrid) or SetDynamicLoading (for grid/combo).
dhtmlxTreeConnector treeConnector = new dhtmlxTreeConnector(/*.....*/);
treeConnector.EnableDynamicLoading = true;
dhtmlxGridConnector gridConnector = new dhtmlxGridConnector(/*.....*/);

See the guide 'Dynamic loading' for more information.

How can I format/change data before loading?

To set some specific formatting or change data before sending to the client side, you should use the ItemPrerender event handler. For more details on this topic, see 'Formatting/Changing Data before Loading'

connector.ItemPrerender += new EventHandler<ItemPrerenderEventArgs<dhtmlxGridDataItem>>(
void connector_ItemPrerender(object sender,ItemPrerenderEventArgs<dhtmlxGridDataItem> e)
    if (e.DataItem.Index % 2 == 0)
    e.DataItem.BgColor = "gray";

How can I load data from a database table?

To load data from a database table you should use one of two ways:

  • To initialize the connector by SQL query, from where it will take the table name, filtering and ordering rules, the columns' list, etc.
dhtmlxGridConnector connector = new dhtmlxGridConnector(
   "SELECT ISO, PrintableName FROM Country",
  • To pass the table name and columns separately.
dhtmlxGridConnector connector = new dhtmlxGridConnector(
   "sales, title, author, price, instore, shipping, bestseller, pub_date",

How can I send additional information to the client side?

To send additional information that won't be outputed but you'll have access to, to the client side, use the optional constructor parameter - ExtraColumnNames. With the help of this param, you can specify the columns that contain the desired additional information.

dhtmlxGridConnector connector = new dhtmlxGridConnector(
   //SQL with inner join statement 
  TZID FROM Country INNER JOIN Timezone ON Country.TZID = Timezone.TZID",
  "UID",//Primary key name
  dhtmlxDatabaseAdapterType.SqlServer2005, //Database adapter type 
  //connection string
  "TZID"//This column will be requested, appear in all events, but won't be rendered

For more information, see the chapter 'Using extra fields' in the 'Basic Loading' guide.

Back to top