Hi there,
I have a grid with this markup in an aspx page, however, I do this to implement custom sorting on the data. However, the event is never fired and the function associated never called. Anyone knows what I may be doing wrong? Thanks.
<igtbl:UltraWebGrid ID="UltraWebGridMessages" runat="server" OnInitializeRow="UltraWebGridMessages_InitializeRow" Width="100%" OnInitializeLayout="UltraWebGridMessages_InitializeLayout" DataKeyField="Id" onpageindexchanged="UltraWebGridMessages_PageIndexChanged" onsortcolumn="UltraWebGridMessages_SortColumn" OnPreRender="UltraWebGridMessages_TablePreRender"> <Bands> <igtbl:UltraGridBand DataKeyField="Id"> <Columns> <igtbl:TemplatedColumn Key="Selected" AllowRowFiltering="False" Width="25px"> <CellStyle HorizontalAlign="Center"> </CellStyle> <Header ClickAction="NotSet"></Header> <HeaderTemplate> <asp:CheckBox ID="CheckBoxSelectAll" CssClass="CheckBoxSelectAll" Text="" runat="server" /> </HeaderTemplate> <Footer> <RowLayoutColumnInfo OriginX="2"></RowLayoutColumnInfo> </Footer> </igtbl:TemplatedColumn> <igtbl:TemplatedColumn Key="Info" AllowRowFiltering="False" Width="30px"> <CellStyle HorizontalAlign="Center"> </CellStyle> <Header Caption="" ClickAction="NotSet"> <RowLayoutColumnInfo OriginX="1" /> </Header> <HeaderTemplate> <img src="/images/info.png" title="Info" alt="Info" /> </HeaderTemplate> <Footer> <RowLayoutColumnInfo OriginX="2"></RowLayoutColumnInfo> </Footer> </igtbl:TemplatedColumn> <igtbl:TemplatedColumn Key="ActionAckTo" AllowRowFiltering="False" Width="35px"> <CellStyle HorizontalAlign="Center"> </CellStyle> <Header Caption="" ClickAction="NotSet"> <RowLayoutColumnInfo OriginX="1"></RowLayoutColumnInfo> </Header> <HeaderTemplate> <img src="/images/reasign.png" title="Acknowledge to" alt="Acknowledge to" /> </HeaderTemplate> <Footer> <RowLayoutColumnInfo OriginX="1"></RowLayoutColumnInfo> </Footer> </igtbl:TemplatedColumn> <igtbl:TemplatedColumn Key="ActionAck" AllowRowFiltering="False" Width="35px"> <CellStyle HorizontalAlign="Center"> </CellStyle> <Header Caption="" ClickAction="NotSet"> <RowLayoutColumnInfo OriginX="2"></RowLayoutColumnInfo> </Header> <HeaderTemplate> <img alt="" src="/images/acknowledge.png" title="Acknowledge" alt="Acknowledge" /> </HeaderTemplate> <Footer> <RowLayoutColumnInfo OriginX="2"></RowLayoutColumnInfo> </Footer> </igtbl:TemplatedColumn> <igtbl:TemplatedColumn Key="ActionClose" AllowRowFiltering="False" Width="35px"> <CellStyle HorizontalAlign="Center"> </CellStyle> <Header Caption="" ClickAction="NotSet"> <RowLayoutColumnInfo OriginX="3"></RowLayoutColumnInfo> </Header> <HeaderTemplate> <img alt="" src="/images/close.png" title="Close" alt="Close" /> </HeaderTemplate> <Footer> <RowLayoutColumnInfo OriginX="3"></RowLayoutColumnInfo> </Footer> </igtbl:TemplatedColumn> <igtbl:TemplatedColumn Key="ActionOpen" AllowRowFiltering="False" Width="35px"> <CellStyle HorizontalAlign="Center"> </CellStyle> <Header Caption="" ClickAction="NotSet"> <RowLayoutColumnInfo OriginX="4"></RowLayoutColumnInfo> </Header> <HeaderTemplate> <img alt="" src="/images/reopen.png" title="Re-Open" alt="Re-Open" /> </HeaderTemplate> <Footer> <RowLayoutColumnInfo OriginX="4"></RowLayoutColumnInfo> </Footer> </igtbl:TemplatedColumn> <igtbl:UltraGridColumn Key="Id" BaseColumnName="Id"> <Header Caption="Id"> <RowLayoutColumnInfo OriginX="2"></RowLayoutColumnInfo> </Header> <Footer> <RowLayoutColumnInfo OriginX="2"></RowLayoutColumnInfo> </Footer> </igtbl:UltraGridColumn> <igtbl:UltraGridColumn BaseColumnName="Status" Key="Status"> <Header Caption="Status" Title="Status"> <RowLayoutColumnInfo OriginX="1"></RowLayoutColumnInfo> </Header> <Footer> <RowLayoutColumnInfo OriginX="1"></RowLayoutColumnInfo> </Footer> </igtbl:UltraGridColumn> <igtbl:UltraGridColumn BaseColumnName="MessageUsername" Key="MessageUsername"> <Header Caption="User Ack" Key="MessageUsername"> <RowLayoutColumnInfo OriginX="3"></RowLayoutColumnInfo> </Header> <Footer> <RowLayoutColumnInfo OriginX="3"></RowLayoutColumnInfo> </Footer> </igtbl:UltraGridColumn> <igtbl:UltraGridColumn BaseColumnName="MessageText" Width="300px"> <Header Caption="Text" Key="MessageText"> <RowLayoutColumnInfo OriginX="4"></RowLayoutColumnInfo> </Header> <Footer> <RowLayoutColumnInfo OriginX="4"></RowLayoutColumnInfo> </Footer> </igtbl:UltraGridColumn> <igtbl:UltraGridColumn BaseColumnName="MessageType" Key="MessageType"> <Header Caption="Type" Key="MessageType"> <RowLayoutColumnInfo OriginX="5"></RowLayoutColumnInfo> </Header> <Footer> <RowLayoutColumnInfo OriginX="5"></RowLayoutColumnInfo> </Footer> </igtbl:UltraGridColumn> <igtbl:UltraGridColumn BaseColumnName="System"> <Header Caption="System" Key="System"> <RowLayoutColumnInfo OriginX="6"></RowLayoutColumnInfo> </Header> <Footer> <RowLayoutColumnInfo OriginX="6"></RowLayoutColumnInfo> </Footer> </igtbl:UltraGridColumn> <igtbl:UltraGridColumn BaseColumnName="Agent"> <Header Caption="Agent" Key="Agent"> <RowLayoutColumnInfo OriginX="7"></RowLayoutColumnInfo> </Header> <Footer> <RowLayoutColumnInfo OriginX="7"></RowLayoutColumnInfo> </Footer> </igtbl:UltraGridColumn> <igtbl:UltraGridColumn BaseColumnName="UserName"> <Header Caption="User" Key="UserName"> <RowLayoutColumnInfo OriginX="8"></RowLayoutColumnInfo> </Header> <Footer> <RowLayoutColumnInfo OriginX="8"></RowLayoutColumnInfo> </Footer> </igtbl:UltraGridColumn> <igtbl:UltraGridColumn BaseColumnName="Criticalness"> <Header Caption="Criticalness" Key="Criticalness"> <RowLayoutColumnInfo OriginX="9"></RowLayoutColumnInfo> </Header> <Footer> <RowLayoutColumnInfo OriginX="9"></RowLayoutColumnInfo> </Footer> </igtbl:UltraGridColumn> <igtbl:UltraGridColumn BaseColumnName="MessageDateTime" Key="MessageDateTime" Width="150px"> <Header Caption="Message Date"> <RowLayoutColumnInfo OriginX="10"></RowLayoutColumnInfo> </Header> <Footer> <RowLayoutColumnInfo OriginX="10"></RowLayoutColumnInfo> </Footer> </igtbl:UltraGridColumn> <igtbl:UltraGridColumn BaseColumnName="Host"> <Header Caption="Host" Key="Host"> <RowLayoutColumnInfo OriginX="11"></RowLayoutColumnInfo> </Header> <Footer> <RowLayoutColumnInfo OriginX="11"></RowLayoutColumnInfo> </Footer> </igtbl:UltraGridColumn> <igtbl:UltraGridColumn BaseColumnName="Category"> <Header Caption="Category" Key="Category"> <RowLayoutColumnInfo OriginX="12"></RowLayoutColumnInfo> </Header> <Footer> <RowLayoutColumnInfo OriginX="12"></RowLayoutColumnInfo> </Footer> </igtbl:UltraGridColumn> <igtbl:UltraGridColumn BaseColumnName="Source"> <Header Caption="Source" Key="Source"> <RowLayoutColumnInfo OriginX="13"></RowLayoutColumnInfo> </Header> <Footer> <RowLayoutColumnInfo OriginX="13"></RowLayoutColumnInfo> </Footer> </igtbl:UltraGridColumn> <igtbl:UltraGridColumn BaseColumnName="Application"> <Header Caption="Application" Key="Application"> <RowLayoutColumnInfo OriginX="14"></RowLayoutColumnInfo> </Header> <Footer> <RowLayoutColumnInfo OriginX="14"></RowLayoutColumnInfo> </Footer> </igtbl:UltraGridColumn> </Columns> <RowEditTemplate> <br> <p align="center"> <input id="igtbl_reOkBtn" onclick="igtbl_gRowEditButtonClick(event);" style="width:50px;" type="button" value="OK"> <input id="igtbl_reCancelBtn" onclick="igtbl_gRowEditButtonClick(event);" style="width:50px;" type="button" value="Cancel"> </input> </input> </p> </br> </RowEditTemplate> <RowTemplateStyle BackColor="White" BorderColor="White" BorderStyle="Ridge"> <BorderDetails WidthBottom="3px" WidthLeft="3px" WidthRight="3px" WidthTop="3px" /> </RowTemplateStyle> <AddNewRow Visible="NotSet" View="NotSet"> </AddNewRow> </igtbl:UltraGridBand> </Bands> <DisplayLayout Name="UltraWebGridMessages" AllowColSizingDefault="Free" AllowColumnMovingDefault="OnServer" AllowSortingDefault="Yes" BorderCollapseDefault="Separate" HeaderClickActionDefault="SortMulti" RowHeightDefault="20px" RowSelectorsDefault="No" RowSizingDefault="Free" StationaryMargins="Header" StationaryMarginsOutlookGroupBy="True" TableLayout="Fixed" Version="3.00" AutoGenerateColumns="False" ViewType="OutlookGroupBy"> <FrameStyle BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="8pt" Width="100%"> </FrameStyle> <Pager Alignment="Left" PageSize="20" AllowPaging="True" AllowCustomPaging="True"> <PagerStyle BackColor="LightGray" BorderStyle="Solid" BorderWidth="1px"> <BorderDetails ColorLeft="White" ColorTop="White" WidthLeft="1px" WidthTop="1px" /> </PagerStyle> </Pager> <EditCellStyleDefault BorderStyle="None" BorderWidth="0px"> </EditCellStyleDefault> <FooterStyleDefault BackColor="LightGray" BorderStyle="Solid" BorderWidth="1px"> <BorderDetails ColorLeft="White" ColorTop="White" WidthLeft="1px" WidthTop="1px" /> </FooterStyleDefault> <HeaderStyleDefault BackColor="LightGray" BorderStyle="Solid"> <BorderDetails ColorLeft="White" ColorTop="White" WidthLeft="1px" WidthTop="1px" /> </HeaderStyleDefault> <RowStyleDefault BackColor="White" BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="8pt"> <Padding Left="3px" /> <BorderDetails ColorLeft="White" ColorTop="White" /> </RowStyleDefault> <GroupByBox> <BoxStyle BackColor="ActiveBorder" BorderColor="Window"> </BoxStyle> </GroupByBox> <AddNewBox> <BoxStyle BackColor="LightGray" BorderStyle="Solid" BorderWidth="1px"> <BorderDetails ColorLeft="White" ColorTop="White" WidthLeft="1px" WidthTop="1px" /> </BoxStyle> </AddNewBox> <ActivationObject BorderColor="" BorderWidth=""> <BorderDetails WidthLeft="0px" WidthRight="0px" /> </ActivationObject> <FilterOptionsDefault AllowRowFiltering="OnClient" FilterUIType="HeaderIcons"> <FilterDropDownStyle BackColor="White" BorderColor="Silver" BorderStyle="Solid" BorderWidth="1px" CustomRules="overflow:auto;" Font-Names="Verdana,Arial,Helvetica,s***rif" Font-Size="11px" Height="300px"> <Padding Left="2px" /> </FilterDropDownStyle> <FilterHighlightRowStyle BackColor="#151C55" ForeColor="White"> </FilterHighlightRowStyle> </FilterOptionsDefault> </DisplayLayout> </igtbl:UltraWebGrid>
And here the code behind:
protected void UltraWebGridMessages_TablePreRender(object sender, EventArgs e) { if (this.isSorting) { foreach (UltraGridColumn col in this.UltraWebGridMessages.Bands[this.sortBand].Columns) { col.SortIndicator = SortIndicator.None; } if (this.sortAscending) { UltraWebGridMessages.Bands[this.sortBand].Columns[sortColumn].SortIndicator = SortIndicator.Ascending; } else { UltraWebGridMessages.Bands[this.sortBand].Columns[sortColumn].SortIndicator = SortIndicator.Descending; } } }
Forget about it. I had the event defined in script tags on the aspx page when I assigned the event on the properties window. That's why tis one was fired instead of the one on the code behind.