Register  Login  
  May 17, 2012  
Search_Blog Minimize
Print  

Blog_Archive Minimize
Print  

Blog    
View_Blog Minimize
Aug 28

Written by: host
Saturday, August 28, 2010 2:50 PM 

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.

Tags:

2 comment(s) so far...

adidas wings

Now, Adidas Originals Hardland*the nature of the rank friendly style boots and shoes, may actually be the case at eye level with every transaction. They are Adidas JS Wings for women of all ages and Glod designed the boots Adidas jeremy scott is certainly cozy shop in search of women in boots and shoes with good winning style. Meanwhile, the companion of the women's Adidas wing boots and shoes js is defined in a natural setting and then next to the Panda Trust Adidas to create the bears on the melody. Jeremy Scott Adidas while some are full-time criminal, to provide all businesses with the help of Nike shoes, feel the importance of several companies seem to be actually set up the work of the proposed business is addition to the other, a great many persona, a. small sub-par, it will tend to have noticed but never lots Furthermore connotation about Jeremy Scott Wings of silver and purple boots Adidas Jeremy Scott Black 2.0 has really unprecedented.in the jeremy scott wings, jeremy in the scott design in one of the highlights.believe that many of my friends really like.

By fghjkl on   Wednesday, May 09, 2012 3:42 AM

Coach Factory Outlet

Some bags sold at Coach Factory Outlet will have small defects. These defects are made during the process of Coach Outlet Online. But these defects are very small. No body will notice Coach Outlet. In case you buy some bags which you will not like in the future, it is better for you to check the quality before you make the payment.Of course, if you think fake Coach Factory are much cheaper and you can accept them. You can buy some of them on Internet. There are plenty of these Coach Factory Outlet there
Ladies are creatures of Coach Factory Store. They are born to love designer bags. Sometimes they can not Coach Outlet. They can not stop buying their Coach Factory there are very little money in their wallets. They know they should not do that. But a Coach Outlet Store Online will definately show her personality and Coach Outlet Online. Just like people will love Coach Outlet Store, women can not say no to Coach Outlet Online.

By michaelkors on   Tuesday, May 15, 2012 4:25 AM

Blog_List Maximize
Print  

  Home | Blog | Forum | Subscriptions | Free Modules | Videos   Page generated in 0.046992 seconds.
  Copyright 2010 by TressleWorks   Terms Of Use | Privacy Statement