I have a custom server control, which I created with my own design.
I put it in an update panel together with a grid.
I activated the OnColumnResized.
When the user changes the size of a column I want to reach the render of my custom control and change its apearance.
In debug, when I put breakpoint, it doesnt reach the Render function.
(It does reach though, the pre render)
using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace PortalControls { [DefaultProperty("Text")] [ToolboxData("<{0}:PortalButton runat=server></{0}:PortalButton>")] public class PortalButton : LinkButton { protected override void Render(HtmlTextWriter output) { output.Write(BuildHTML()); } private string BuildHTML() { return "xxx"; } } } <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Pricer.aspx.cs" Inherits="OptionPricer.Pricer" %> <%@ Register Assembly="OptionPricer" Namespace="PortalControls" TagPrefix="cc1" %> <%@ Register Assembly="Infragistics4.Web.v12.2, Version=12.2.20122.2054, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" Namespace="Infragistics.Web.UI.EditorControls" TagPrefix="ig" %> <%@ Register Assembly="Infragistics4.Web.v12.2, Version=12.2.20122.2054, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" Namespace="Infragistics.Web.UI.ListControls" TagPrefix="ig" %> <%@ Register Assembly="Infragistics4.Web.v12.2, Version=12.2.20122.2054, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" Namespace="Infragistics.Web.UI" TagPrefix="ig1" %> <%@ Register Assembly="Infragistics4.Web.v12.2, Version=12.2.20122.2054, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" Namespace="Infragistics.Web.UI.GridControls" TagPrefix="ig" %> <%@ Register Assembly="Infragistics4.Web.v12.2, Version=12.2.20122.2054, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" Namespace="Infragistics.Web.UI.LayoutControls" TagPrefix="ig" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> <html xmlns=" http://www.w3.org/1999/xhtml "> <head id="Head1" runat="server"> <title></title> </head> <body> <form id="form1" runat="server" > <ig1:WebScriptManager ID="WebScriptManager1" runat="server"> </ig1:WebScriptManager> <asp:UpdatePanel ID="UpdatePanel4" runat="server"> <ContentTemplate> <ig:WebDataGrid ID="PricerDataGrid" runat="server" ClientIDMode="Static" AutoGenerateColumns="False" OnColumnResized="PricerDataGrid_ColumnResized"> <Columns> <ig:BoundDataField DataFieldName="PremPrecent" DataType="System.Double" Key="ColPremPercent" > <Header Text="prem" /> </ig:BoundDataField> <ig:BoundDataField DataFieldName="PremAmountCalulated" DataType="System.Double" Key="ColPremAmount" > <Header Text="prem amount " /> </ig:BoundDataField> </Columns> <Behaviors> <ig:ColumnResizing> <AutoPostBackFlags ColumnResized="True" /> </ig:ColumnResizing> </Behaviors> </ig:WebDataGrid> <div class="btnMainTable"> <cc1:PortalButton ID="btnDelete" runat="server" Text="delete" ClientIDMode="Static" OnPreRender="btnDelete_PreRender"></cc1:PortalButton> </div> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="PricerDataGrid" /> </Triggers> </asp:UpdatePanel> </form> </body> </html> using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using DealingRoom.Utils.BasicManiputlations; using DealsRoomDAL; using System.Data; using DealingRoom.Utils.BuisnessDays; using Infragistics.Web.UI.EditorControls; using Infragistics.Web.UI.GridControls; using OptionPricerCalculator.Objects; using OptionPricerCalculator; using System.Globalization; namespace OptionPricer { public partial class Pricer : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { PopulateGrid(); } protected override void OnLoadComplete(EventArgs e) { base.OnLoadComplete(e); } protected void btnDelete_PreRender(object sender, EventArgs e) { } public void PopulateGrid() { List<OptionValues> ls = new List<OptionValues>(); ls.Add(new OptionValues()); PricerDataGrid.DataSource = ls; PricerDataGrid.DataBind(); } protected void PricerDataGrid_ColumnResized(object sender, ColumnResizingEventArgs e) { } } }
Hi,
When you put WDG into an UpdatePanel you have to set its EnableAjax property to false. That may fix the issue you are seeing.
Thanks
Olga