RadControls for ASP.NET AJAX
Client side changes are available on the server side after postback. You can use the ClientChanges property of RadPanelBar to access them. The ClientChanges property of RadPanelbar returns a collection of objects of type ClientOperation. An operation has two properties:
Note |
|---|
Note that you need to call the trackChanges() and commitChanges() client methods of RadPanelBar in order to be able to access the changes on the server via the ClientChanges property.
|
Example:
The code snippet below enumerates through all operations in the ClientChanges collection and utilizes both the Item and Type properties. For a complete demo, please see the client-side Add/Remove/Disable Items example.
CopyC#
foreach (ClientOperation<RadPanelItem> operation in RadPanelBar1.ClientChanges)
{
RadPanelItem item = operation.Item;
switch (operation.Type)
{
case ClientOperationType.Insert:
break;
case ClientOperationType.Remove:
break;
case ClientOperationType.Update:
UpdateClientOperation<RadPanelItem> update = operation as UpdateClientOperation<RadPanelItem>;
break;
case ClientOperationType.Clear:
break;
}
}
CopyVB
For Each operation As ClientOperation(Of RadPanelItem) In RadPanelBar1.ClientChanges
Dim item As RadPanelItem = operation.Item
Select Case operation.Type
Case ClientOperationType.Insert
Exit Select
Case ClientOperationType.Remove
Exit Select
Case ClientOperationType.Update
Dim update As UpdateClientOperation(Of RadPanelItem) = TryCast(operation, UpdateClientOperation(Of RadPanelItem))
Exit Select
Case ClientOperationType.Clear
Exit Select
End Select
Next
See Also