Page tree

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Wiki Markup
{excerpt}Creates a [DataBindingProperties|DataBindingProperties] object for assigning the property values associated with one or more data binding calls.
 public virtual DataBindingProperties CreateDataBindingProperties()
Public Overridable Function CreateDataBindingProperties() As DataBindingProperties
{exception:ArgumentNullException}{{CreateDataBindingProperties}} will throw this exception if {{null}} \(C\#\) or {{Nothing}} \(VB.NET\) is passed to the method.
{remarks}A {{DataBindingProperties}} object is required for each data binding call, including these methods: [BindData|ExcelTemplate.BindData], [BindCellData|ExcelTemplate.BindCellData(Object, String, DataBindingProperties)], [BindColumnData|ExcelTemplate.BindColumnData], and [BindRowData|ExcelTemplate.BindRowData].  Hence, [CreateDataBindingProperties|ExcelTemplate.CreateDataBindingProperties()] must be called at least once in any WordTemplate project that binds data to a template.

The same {{DataBindingProperties}} object can be used for multiple data binding method calls.


          //--- Create a DataBindingProperties object to be used
          //--- in a data binding call
          DataBindingProperties dbp = ExcelTemplate.CreateDataBindingProperties();
          dbp.MaxRows = 20;
          xlt.BindData(twodim, names, "TwoDimArray", dbp);
          xlt.Save(Page.Response, "output.xls", false);

          '--- Create a DataBindingProperties object to be used
          '--- multiple times in a project
          Dim dbp As DataBindingProperties = ExcelTemplate.CreateDataBindingProperties()
          dbp.MaxRows = 20
          xlt.BindData(twodim, names, "TwoDimArray", dbp)
          xlt.Save(Page.Response, "output.xls", False)