This project is read-only.

radgrid with onitemdatabound

Dec 1, 2010 at 6:22 PM

I'm trying to figure out how i can use the radgrid onitemdatabound event with this but I don't know where to add the method that it calls. Is there a way to use it with <msxsl:script>? I'm just trying to change the cell color based on the number in the cell.



Dec 2, 2010 at 7:53 AM


msxsl:script is not good Idea here. There are two ways of doing this.

  • Create a UserControl in ascx file using Visual Studio. After that you can deploy control and use XsltDb to put control on the page.
  • Inherit a custom class from RadGrid that implements your custom features

Example for method 2:

In the App_Code/YourCode put a c# file (review rules for App_Code):


namespace My
    public class MyGrid : Telerik.Web.UI.RadGrid
        public MyGrid() : base()
            this.ItemDataBound += new Telerik.Web.UI.GridItemEventHandler(MyGrid_ItemDataBound);

        void MyGrid_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)



In XsltDb module put config like following:


<xsl:text disable-output-escaping="yes"><![CDATA[
<%@ Register TagPrefix="my" NameSpace="My" %>

<mdo:asp xmlns:asp="asp" xmlns:telerik="telerik" xmlns:my="my">
          ConnectionString="&lt;%$ ConnectionStrings:SiteSqlServer %&gt;"
          SelectCommand="SELECT ModuleName, FriendlyName, Description FROM dnn_DesktopModules"








Dec 2, 2010 at 9:32 PM

Thanks! I went with option 2 and it works great. Thanks for all the work you put into this project, it's the best module I've used!