Version

Auto Post Back Events

WebHierarchicalDataSource™ has behaviors that do not post back by default but you may want to trigger a postback automatically. For this reason, the behavior exposes an AutoPostBack property that you can set to trigger the correpsonding server-side event.

The following lists the behaviors that has the AutoPostBack property and the events that they trigger.

  • Activation - ActiveCellChanged event is raised when a cell is activated.

  • Selection - CellSelectionChanged, ColumnSelectionChanged, or RowSelectionChanged is raised when a cell is selected.

If you have Ajax enabled then the events are raised asynchronously; if not, you will get a full page postback.

The following code shows you how to set the AutoPostBack property for cell selection and handle the CellSelectionChanged event.

In HTML:

<ig:WebHierarchicalDataGrid ID="WebHierarchicalDataGrid1" runat="server" Height="350px"
    Width="800px" oncellselectionchanged="WebHierarchicalDataGrid1_CellSelectionChanged">
    <Behaviors>
        <ig:Selection>
            <AutoPostBackFlags CellSelectionChanged="True" />
        </ig:Selection>
    </Behaviors>
</ig:WebHierarchicalDataGrid>

In Visual Basic:

AddHandler Me.WebHierarchicalDataGrid1.CellSelectionChanged, _
    AddressOf Me.WebHierarchicalDataGrid1_CellSelectionChanged
Me.WebHierarchicalDataGrid1.Behaviors.Selection.AutoPostBackFlags.CellSelectionChanged = True

In C#:

this.WebHierarchicalDataGrid1.CellSelectionChanged +=     new SelectedCellEventHandler(WebHierarchicalDataGrid1_CellSelectionChanged);
this.WebHierarchicalDataGrid1.Behaviors.Selection.AutoPostBackFlags.CellSelectionChanged = true;