Intersoft WebGrid Documentation
Server-side Binding
See Also Send comments on this topic.
Intersoft WebGrid > WebGrid Features Overview > Displaying Data > Server-side Binding

Glossary Item Box

Server-side binding is a mechanism that processes data operation and binding life-cycle entirely in the server-side. Server-side binding normally sent HTML markup as the final output, which is directly recognized by browsers with very minimum overhead in the client side.

Server-side binding processes data binding, initialization and rendering in the following way:

The most native way to bind data to WebGrid is through code where a datasource is provided to the control during InitializeDataSource event.

The following code shows how to bind WebGrid with code through InitializeDataSource event.

CS Copy Code
protected void InitializeDataSource(object sender, ISNet.WebUI.WebGrid.DataSourceEventArgs e)
{
  OleDbCommand cmd = oleDbConnection1.CreateCommand();
  cmd.CommandType = CommandType.Text;
  cmd.CommandText = "SELECT * FROM CUSTOMERS";
  
  OleDbDataAdapter da = newOleDbDataAdapter();
  da.SelectCommand = cmd;
   
  DataSet ds = new DataSet();
  da.Fill(ds);
  ds.Tables[0].TableName = "Customers"; 

  e.DataSource = ds;
}

For more complete example, see Walkthrough: Binding WebGrid to a DataSource at RunTime.

In addition, WebGrid also supports newer data binding mechanism such as those introduced in latter version of ASP.NET.

To learn more about these data binding concepts, see the following topics:

Codeless Data Binding

This topic provides an overview of the codeless data binding support in WebGrid, which includes the support for built-in ASP.NET data source controls such as SqlDataSource, AccessDataSource, and more.

Hierarchical Data Binding

This topic discusses the hierarchical data visualization in WebGrid and explains the data binding approaches to display hierarchical data in WebGrid such as the usage of ISDataSource control. In addition, it also explains the techniques to load the child data on demand, and other advanced data binding topics.

Self-referencing Data Binding

This topic overviews the self-referencing concept in WebGrid and discusses the data binding approaches as well as other best practices related to self-referencing tasks such as loading the self child rows on demand and support child rows sorting in the self-referencing scenarios.

See Also

©2012 Intersoft Solutions Corp. All Rights Reserved.