When a user right mouse clicks on a datagrid cell the following menu is displayed:

Menu

This allows the user to group or filter the data, it will also display options to remove any grouping or filters set by the user.

 

All the options (expect Source) in Datagrid plus start with the letter x:

Source: The control will search the control tree and find the nearest datagrid. It will then use the item source of the datagrid as it’s source. You can however define the source here, and it will set the datagrid source as well. You might want to do this if you change the data sources in code.

xAlternatingRowsDifferent: True  means datagrid will display rows in alternating colour, False will set all rows to the same colour.

xDomainContext: If you put the name of the domain context in here, the control will call submit changes every time the row is updated.

xEntity & xEntitySet: To add a new blank  record you need to set both these item. (normally you would set this in code behind)

xFilterOption & xGroupbyOption: By default these are set to True which means the user can right click in the datagrid and bring up filter and groupby options. Set these to False if you do not want to provide these features.

xHidePager: Set to false if you do not want to display the pager control.

xHideTools: Set  to false if you do not want to display the options to format the grid.

xIsBusy: displays a Busy indicator if set to True:

xLocalisation: Defines the the default language used. Currently supports four languages used to format, group and filter the datagrid. The tools options allows the user to change the language.  If not set English UK is used.

 

The following is an example to load the data, adding a blank row and displaying a busy indicator.

 private void LoadData()
        {
            ResourcesDataPager.xEntity = new tblResource();
            ResourcesDataPager.xEntitySet = DC.tblResources;
            ResourcesDataPager.xIsBusy = true;
            MyOP = DC.Load(DC.GetTblResourcesQuery());
            MyOP.Completed += new EventHandler(MyOP_Completed);
        }

        void MyOP_Completed(object sender, EventArgs e)
        {
            ResourcesDataPager.xIsBusy = false;
            ResourcesDataPager.Source = DC.tblResources;
            ResourcesDataPager.xDomainContext = DC;
        }