Introduction :
The DevExpress GridControl works like a Datagrid in Silverlight but with some
additional functionality.
Following DLL are important to add GridControl in silverlight.
- DevExpress.Data.v11.1
- DevExpress.Xpf.Controls.v11.1
- DevExpress.Xpf.Core.v11.1
- DevExpress.Xpf.Grid.v11.1.Core
Example :
Namespace :
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
MainPage.Xaml:
<dxg:GridControl
HorizontalAlignment="Left"
Grid.Row="0"
ScrollViewer.HorizontalScrollBarVisibility="Visible"
ScrollViewer.VerticalScrollBarVisibility="Visible"
AutoPopulateColumns="True"
Name="DataGridControl"
VerticalAlignment="Top">
<dxg:GridControl.View>
<dxg:TableView
Name="tableView1"
/>
</dxg:GridControl.View>
</dxg:GridControl>
Explanation: As we have AutoGenerateColumns property in silverlight
datagrid same way we have
AutoPopulatedColumns property in DevExpress GridControl.
Here we have GroupPanel (Drag a column header here to group by that column).if
this is not required for datagrid,we can set is as false like set ShowGroupPanel
property of gridcontrol to false.
GroupPanel is use for grouping the columns, we can drag the particular column
and set it as group by items as following way.
Here drag the column Name and make it group by name.
By right click on any column of grid we get some functionality like,
- Sort Ascending
- Sort Descending
- Group By This Column
- Hide Group Panel
- Show Column Chooser
As above screen we get Filter Editor for Grid.
With the help of Filter Editor we can filter the grid data as we want as shown
in following screen.
Here we put filter on column Name. Now can search the record related that name.
We can search by many way like Name Equal or Equal not, Between, IsNull as shown
in following screen.
Summary: We can use the DevExpress GridControl in silverlight,it provide
many functionality with grid control as mentioned above.