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.
<ig:WebHierarchicalDataGrid ID="WebHierarchicalDataGrid1" runat="server" Height="350px"
Width="800px" oncellselectionchanged="WebHierarchicalDataGrid1_CellSelectionChanged">
<Behaviors>
<ig:Selection>
<AutoPostBackFlags CellSelectionChanged="True" />
</ig:Selection>
</Behaviors>
</ig:WebHierarchicalDataGrid>
AddHandler Me.WebHierarchicalDataGrid1.CellSelectionChanged, _
AddressOf Me.WebHierarchicalDataGrid1_CellSelectionChanged
Me.WebHierarchicalDataGrid1.Behaviors.Selection.AutoPostBackFlags.CellSelectionChanged = True
this.WebHierarchicalDataGrid1.CellSelectionChanged += new SelectedCellEventHandler(WebHierarchicalDataGrid1_CellSelectionChanged);
this.WebHierarchicalDataGrid1.Behaviors.Selection.AutoPostBackFlags.CellSelectionChanged = true;