I have a column that allows to Select All, how can I turn off the sorting on this checkbox column? BeforeSortChange does not appear on the list of the grid's events (Infragistics2.WebUI.UltraWebGrid.v6.3)
The actual code would be greatly appreciated.This is the code:
///Header Select All functionality var oGrid; var cbSelectAll; function igrdInitializeLayout(object) { oGrid = igtbl_getGridById(object); //need to set it here due to Infragistic's handling of columns. cbSelectAll = document.getElementById("cbSelectAll"); } function SelectAll(colIndex) { var checked = cbSelectAll.checked;
for (i = 0; i < oGrid.Rows.length; i++) { oGrid.Rows.getRow(i).getCell(colIndex).setValue(checked); } } ///End of Header Select All functionality
<igtbl:UltraWebGrid ID="grdPlans" runat="server" Width="100%" OnSortColumn="grdPlans_SortColumn" DisplayLayout-RowAlternateStyleDefault-BackColor="#DDDDDD" DisplayLayout-ClientSideEvents-InitializeLayoutHandler="igrdInitializeLayout"> <Bands> <igtbl:UltraGridBand GroupByColumnsHidden="Yes" AllowSorting="OnClient"> <AddNewRow View="NotSet" Visible="NotSet"> </AddNewRow> <Columns> <igtbl:TemplatedColumn Key="Quote" Type="CheckBox" BaseColumnName="Quote" AllowUpdate="Yes" Width="25px" SortIndicator="Disabled"> <HeaderTemplate> <input id="cbSelectAll" name="cbSelectAll" type="checkbox" onclick="SelectAll(0)" /> </HeaderTemplate> </igtbl:TemplatedColumn> <igtbl:UltraGridColumn BaseColumnName="PlanId" Hidden="True" Key="PlanId"> </igtbl:UltraGridColumn> <igtbl:UltraGridColumn BaseColumnName="CarrierId" Hidden="True" Key="CarrierId"> <Header> <RowLayoutColumnInfo OriginX="1" /> </Header> <Footer> <RowLayoutColumnInfo OriginX="1" /> </Footer> </igtbl:UltraGridColumn> <igtbl:UltraGridColumn BaseColumnName="Carrier" HeaderText="Carrier" Key="Carrier" Width="100px" AllowUpdate="No"> <CellStyle Wrap="True"></CellStyle> <Header Caption="Carrier"> <RowLayoutColumnInfo OriginX="3" /> </Header> <Footer> <RowLayoutColumnInfo OriginX="3" /> </Footer> </igtbl:UltraGridColumn> <igtbl:UltraGridColumn BaseColumnName="PlanType" HeaderText="Type" Key="PlanType" Width="50px" AllowUpdate="No"> <Header Caption="Type"> <RowLayoutColumnInfo OriginX="4" /> </Header> <Footer> <RowLayoutColumnInfo OriginX="4" /> </Footer> </igtbl:UltraGridColumn> <igtbl:UltraGridColumn BaseColumnName="PlanTitle" HeaderText="Plan" Key="PlanTitle" Width="150px" AllowUpdate="No"> <CellStyle Wrap="True" CssClass="newsLinksXSmall" Cursor="Hand"> </CellStyle> <Header Caption="Plan"> <RowLayoutColumnInfo OriginX="5" /> </Header> <Footer> <RowLayoutColumnInfo OriginX="5" /> </Footer> </igtbl:UltraGridColumn> <igtbl:UltraGridColumn BaseColumnName="RAF" HeaderText="RAF" Key="RAF" Width="50px" AllowUpdate="No"> <Header Caption="RAF"> <RowLayoutColumnInfo OriginX="6" /> </Header> <Footer> <RowLayoutColumnInfo OriginX="6" /> </Footer> </igtbl:UltraGridColumn> <igtbl:UltraGridColumn BaseColumnName="IsHPDF" Hidden="True" Key="IsHPDF"> <Header> <RowLayoutColumnInfo OriginX="7" /> </Header> <Footer> <RowLayoutColumnInfo OriginX="7" /> </Footer> </igtbl:UltraGridColumn> <igtbl:UltraGridColumn BaseColumnName="FileId" Hidden="true" Key="FileId"> <Header> <RowLayoutColumnInfo OriginX="8" /> </Header> <Footer> <RowLayoutColumnInfo OriginX="8" /> </Footer> </igtbl:UltraGridColumn> <igtbl:UltraGridColumn BaseColumnName="FileName" Hidden="true" Key="FileName"> <Header> <RowLayoutColumnInfo OriginX="9" /> </Header> <Footer> <RowLayoutColumnInfo OriginX="9" /> </Footer> </igtbl:UltraGridColumn> <igtbl:UltraGridColumn BaseColumnName="PlanTypeOrdinal" Hidden="True" Key="PlanTypeOrdinal"> </igtbl:UltraGridColumn> </Columns> <GroupByRowStyle BackColor="#7A96DF" BorderColor="Window" ForeColor="White" HorizontalAlign="Left"> </GroupByRowStyle> <SelectedGroupByRowStyle BackColor="#7A96DF" BorderColor="Window" ForeColor="White" HorizontalAlign="Left"> </SelectedGroupByRowStyle> <SelectedRowStyle BackColor="#7A96DF" BorderColor="Window" ForeColor="White" /> <RowExpAreaStyle BackColor="#7A96DF" BorderColor="Window" ForeColor="White" HorizontalAlign="Left"> </RowExpAreaStyle> <RowSelectorStyle BackColor="#7A96DF"> </RowSelectorStyle> </igtbl:UltraGridBand> </Bands> <DisplayLayout AllowColSizingDefault="Free" AllowUpdateDefault="Yes" BorderCollapseDefault="Separate" Name="grdPlans" RowHeightDefault="20px" RowSelectorsDefault="No" SelectTypeRowDefault="Extended" StationaryMargins="Header" StationaryMarginsOutlookGroupBy="True" TableLayout="Fixed" Version="4.00" ViewType="OutlookGroupBy" AutoGenerateColumns="False" GroupByColumnsHiddenDefault="No" JavaScriptFileName="/ig_common/scripts/ig_WebGrid.js" JavaScriptFileNameCommon="/ig_common/scripts/ig_shared.js" EnableInternalRowsManagement="True" FixedColumnScrollType="Column" CellClickActionDefault="RowSelect" HeaderClickActionDefault="SortMulti"> <GroupByBox Hidden="True"> <Style BackColor="ActiveBorder" BorderColor="Window"></Style> </GroupByBox> <GroupByRowStyleDefault BackColor="#7A96DF" BorderColor="Window" Font-Bold="True" Height="12px" ForeColor="White"> </GroupByRowStyleDefault> <FooterStyleDefault BackColor="LightGray" BorderStyle="Solid" BorderWidth="1px"> <BorderDetails ColorLeft="White" ColorTop="White" WidthLeft="1px" WidthTop="1px" /> </FooterStyleDefault> <RowStyleDefault BackColor="Window" BorderColor="Silver" BorderStyle="Solid" BorderWidth="1px"> <BorderDetails ColorLeft="Window" ColorTop="Window" /> <Padding Left="3px" /> </RowStyleDefault> <HeaderStyleDefault BackColor="#7A96DF" BorderStyle="Solid" ForeColor="White" HorizontalAlign="Center" Cursor="Hand" Wrap="True"> <BorderDetails ColorLeft="White" ColorTop="White" WidthLeft="1px" WidthTop="1px" /> </HeaderStyleDefault> <EditCellStyleDefault BorderStyle="None" BorderWidth="0px"> </EditCellStyleDefault> <FrameStyle BackColor="Window" BorderColor="InactiveCaption" BorderStyle="Solid" BorderWidth="1px" Font-Names="Microsoft Sans Serif" Font-Size="8pt" Width="100%" TextOverflow="Ellipsis" Wrap="True"> </FrameStyle> <Pager MinimumPagesForDisplay="2"> <Style BackColor="LightGray" BorderStyle="Solid" BorderWidth="1px"> <BorderDetails ColorTop="White" WidthLeft="1px" WidthTop="1px" ColorLeft="White"></BorderDetails> </Style> </Pager> <AddNewBox> <Style BackColor="Window" BorderColor="InactiveCaption" BorderStyle="Solid" BorderWidth="1px"> <BorderDetails ColorTop="White" WidthLeft="1px" WidthTop="1px" ColorLeft="White"></BorderDetails> </Style> </AddNewBox> <RowExpAreaStyleDefault BackColor="#7A96DF" BorderColor="Window" ForeColor="White"> </RowExpAreaStyleDefault> <SelectedGroupByRowStyleDefault BackColor="#7A96DF" BorderColor="Window" ForeColor="White"> </SelectedGroupByRowStyleDefault> <RowSelectorStyleDefault BackColor="#7A96DF"> </RowSelectorStyleDefault> <ClientSideEvents CellClickHandler="grdPlans_CellClickHandler" ColumnHeaderClickHandler="grdPlans_ColumnHeaderClickHandler" /> </DisplayLayout> </igtbl:UltraWebGrid>
Hi alokazia,
It has been some time since your post, however in case you still need assistance I would be glad to help.
Sorting for a particulart UltraWebGrid column may be disabled by setting the SortingIndicator property to Disabled. For instance:
<igtbl:UltraGridColumn SortIndicator="Disabled"> <Header> <RowLayoutColumnInfo OriginX="4" /> </Header> <Footer> <RowLayoutColumnInfo OriginX="4" /> </Footer> </igtbl:UltraGridColumn>
Please note that the UltraWebGrid control is now outdated and as of .NetAdvantage 2011 Volume 2 is no longer included in our product package. I would suggest that you consider switching to the WebDataGrid/WebHieararchicalDataGrid. More information regarding these controls is available at:
http://help.infragistics.com/NetAdvantage/ASPNET/2011.2/CLR4.0/?page=Web_WebDataGrid_WebDataGrid.html
Additional samples demonstrating the features of these grids can be found at:http://samples.infragistics.com/aspnet/
Feel free to contact me if you have any questions.