Check documentation for the latest version 6.0 of dhtmlxSuite BeforeSelect DHTMLX Docs

BeforeSelect

The BeforeSelect event fires exactly before data will be selected. This is the last chance to modify selected parameters before the result will be available. You can also use it to add some additional rules or OrderBy statements. For example, both Grid and TreeGrid use this event to include extra fields into requested fields collection.

public dhtmlxGridConnectorBase()
{
   this.BeforeSelect += new EventHandler(dhtmlxGridConnectorBase_BeforeSelect);
}
 
void dhtmlxGridConnectorBase_BeforeSelect(object sender, EventArgs e)
{
   this.Request.RequestedFields = this.Request.RequestedFields.Union(this.ExtraFields).ToFieldsCollection();
}

The code above keeps Request.RequestedFields collection untouched till the last moment and then adds some more fields into it.

In the same way you can get or set index of row to start selection from (Request.StartIndex), rows count to be retrieved (Request.Count), selection or sorting rules (Request.Rules and Request.OrderBy), or even table name selection will go through (Request.TableName).

Back to top