So with the latest release of DotNetNuke, the support for Telerik controls has stablized. I have been waiting to play with the Telerik Grid that is now available via a wrapper class. Not much as been said about these wrapper classes so I was a little reluctant to play with them until I knew DotNetNuke was using them. With the Version 5.5 release of DotnetNuke, I believe I would be safe to give it a try.
My plan was to created a very simple module that display a DataGrid, then convert it use the Telerik RadGrid via the wrapper class. Here is the routine that displayed the Datagrid:
Private Sub DisplayDataGrid()
dgDataGrid = New DataGrid
dgDataGrid.AutoGenerateColumns = True
dgDataGrid.CellSpacing = 0
dgDataGrid.GridLines = GridLines.Both
dgDataGrid.FooterStyle.CssClass = "DataGrid_Footer"
dgDataGrid.HeaderStyle.CssClass = "DataGrid_Header"
dgDataGrid.ItemStyle.CssClass = "DataGrid_Item"
dgDataGrid.AlternatingItemStyle.CssClass = "DataGrid_AlternatingItem"
dgDataGrid.DataSource = dtProducts
dgDataGrid.DataBind()
pnlGrid.Controls.Add(dgDataGrid)
End Sub
The above routine generated the following grid - dtProducts is a datatable containing the result of "Select Top 10 ProductID, ProductName, QuantityPerUnit, UnitPrice, UnitsInStock, Discontinued FROM Products"

Time to convert the routine to use the wrapper classes. This presented me with my first challenge -- what were the wrapper classes called? After a bit of poking around in the DotNetNuke Source I discovered DNNGrid. The DNNGrid Class is part of DotNetNuke.Web.UI.WebControls which is implemented in DotNetNuke.Web.dll.
So I change the Datagrid into the DNNGrid. Was it as simple as changing the appropriate types? Actually Yes!. You need to reference DotNetNuke.Web.dll which will then require Telerik.Web.UI.Dll to be referenced. With these two references added, I could then add the Imports statement for DotNetNuke.Web.UI.WebControls. Then I could change the reference to DNNGrid as follows:
Private Sub DisplayDNNGrid()
dgDNNGrid = New DnnGrid
dgDNNGrid.AutoGenerateColumns = True
dgDNNGrid.CellSpacing = 0
dgDNNGrid.GridLines = GridLines.Both
dgDNNGrid.FooterStyle.CssClass = "DataGrid_Footer"
dgDNNGrid.HeaderStyle.CssClass = "DataGrid_Header"
dgDNNGrid.ItemStyle.CssClass = "DataGrid_Item"
dgDNNGrid.AlternatingItemStyle.CssClass = "DataGrid_AlternatingItem"
dgDNNGrid.DataSource = dtProducts
dgDNNGrid.DataBind()
pnlGrid.Controls.Add(dgDNNGrid)
End Sub
As you can see there is little change. The real change, other than the instance name, is the type - DNNGrid. This code generated the following grid:

Now all of the RADGrid features are available to you. Where can you find details on the available feature and how to implement them? Check out RADGrid help here Lots of great examples on how to use the RadGrid Control.
For example, by adding just one line:
gdDNNGrid.AllowSorting = True
Results in column sorting with color!

I hope this helps get you using the new DNNGrid on your next grid based module.
Paul.