Edit this page

Custom DataProvider

The DataProvider functionality of RadVirtualGrid exposes various mechanisms for extending the default behavior. This can be achieved by inheriting the DataProvider object and overriding its methods or properties.

[C#] Example 1: Defining a Custom DataProvider

public class CustomDataProvider: DataProvider
{
    public CustomDataProvider(IEnumerable source)
        :base(source)
    {

    }
}

[C#] Example 2: Applying the Custom DataProvider

this.VirtualGrid.DataProvider = 
            new CustomDataProvider(Club.GetClubs());

Figure 1: RadVirtualGrid with applied custom DataProvider

RadVirtualGrid with applied custom DataProvider

By inheriting the default DataProvider, the following methods and properties are exposed for customization.

Properties

  • InitialRowCount: If not overriden, gets the value that is set to the InitialRowCount property of RadVirtualGrid.

  • InitialColumnCount: If not overriden, gets the value that is set to the InitialRowCount property of RadVirtualGrid.

  • ShouldPushEditValueToGrid: When an editor is provided for the Editing operation, its edited value needs to be manually pushed to underlying source and to the grid through its PushCellValue method. If the ShouldPushEditValueToGrid property is overriden and returns a True value, updating the control with the edited property value will be done automatically.

Methods

  • OnCellEditEnded: The method that is called when the CellEditEnded event is raised.

  • OnCellValueNeeded: The method that is called when the CellValueNeeded event is raised.

  • OnEditorNeeded: The method that is called when the EditorNeeded event is raised.

  • OnEditorValueChanged: The method that is called when the EditorValueChanged event is raised.

  • OnHeaderValueNeeded: The method that is called when the HeaderValueNeeded event is raised.

See Also