Tag Archives: DevExpress

How to add “ClientSide Click Event” to “ASPxHyperLink” dynamically (as ASPxGridView Data Item Template Control)

As I described above, we can use “OnInit” methots to define dynamic behaviours for any control. You can just check this article for further information. And the back-end code; protected void dxHyperLink_Init(object sender, EventArgs e) { ASPxHyperLink link = sender as ASPxHyperLink; string param = Request.QueryString["param"]; if (!string.IsNullOrEmpty(param)) { GridViewDataItemTemplateContainer container = link.NamingContainer as GridViewDataItemTemplateContainer; WebDescriptorRowBase webDataRow = null; // WebDescriptorRowBase: Super class of WebDataRow and WebCachedDataRow if (container.DataItem.GetType().Equals(typeof(WebDataRow))) { webDataRow = container.DataItem as WebDataRow; } else if (container.DataItem.GetType().Equals(typeof(WebCachedDataRow))) { webDataRow = container.DataItem as WebCachedDataRow; Continue reading →