I'm having a problem with the UltraWebGrid when I sort a column and then try to select it using a button in a column with a Type of Button. If I sort a column and then select it with the button in that row the CellEventArgs in the ClickCellButton Event seems to contain the data for a different row. This is happening using both Client Side and Server Side sorting. Everything works fine though when I apply a filter to a column and select a row. Any ideas on what could be causing this?
<igtbl:UltraWebGrid ID="findInventoryTransferUltraGrid" runat="server" Browser="Xml"
OnClickCellButton="FindInventoryTransferUltraGrid_ClickCellButton"
StyleSetName="Caribbean" EnableCrawlerDetection="False">
<Bands>
<igtbl:UltraGridBand>
<Columns>
<igtbl:UltraGridColumn AllowGroupBy="No" AllowRowFiltering="False" BaseColumnName="Select"
CellButtonDisplay="Always" Key="Select" NullText="Select" Type="Button" Width="6%"
FilterOperatorDefaultValue="Contains">
<Header Caption="Select" />
</igtbl:UltraGridColumn>
<ValueList DataMember="Id" DisplayMember="Id" Key="Id" ValueMember="Id" />
<igtbl:UltraGridColumn BaseColumnName="OrderNumber" Key="OrderNumber" Width="10%"
<ValueList DataMember="OrderNumber" DisplayMember="OrderNumber" Key="OrderNumber" ValueMember="OrderNumber" />
<Header Caption="Order Number" />
<igtbl:UltraGridColumn BaseColumnName="Source" Key="Source" Width="13%"
<ValueList DataMember="Source" DisplayMember="Source" Key="Source" ValueMember="Source" />
<Header Caption="Source" />
<igtbl:UltraGridColumn BaseColumnName="Destination" Key="Destination" Width="13%"
<ValueList DataMember="Destination" DisplayMember="Destination" Key="Destination" ValueMember="Destination" />
<Header Caption="Destination" />
<igtbl:UltraGridColumn BaseColumnName="Title" Key="Title" Width="14%"
<ValueList DataMember="Title" DisplayMember="Title" Key="Title" ValueMember="Title" />
<Header Caption="Title" />
<igtbl:UltraGridColumn BaseColumnName="TransferType" Key="TransferType" Width="7%"
<ValueList DataMember="TransferType" DisplayMember="TransferType" Key="TransferType" ValueMember="TransferType" />
<Header Caption="Type" />
<igtbl:UltraGridColumn BaseColumnName="Status" Key="Status" Width="7%"
<ValueList DataMember="Status" DisplayMember="Status" Key="Status" ValueMember="Status" />
<Header Caption="Status" />
<igtbl:UltraGridColumn BaseColumnName="Placed" Key="Placed" Width="5%"
<ValueList DataMember="Placed" DisplayMember="Placed" Key="Placed" ValueMember="Placed" />
<Header Caption="Placed" />
<igtbl:UltraGridColumn BaseColumnName="DateCreated" Key="DateCreated" Width="15%"
<ValueList DataMember="DateCreated" DisplayMember="DateCreated" Key="DateCreated" ValueMember="DateCreated" />
<Header Caption="Date Created" />
</Columns>
</igtbl:UltraGridBand>
</Bands>
<DisplayLayout AutoGenerateColumns="False" Name="UltraWebGrid1" RowHeightDefault="25px"
StationaryMarginsOutlookGroupBy="True" TableLayout="Fixed" Version="4.00" AllowSortingDefault="OnClient"
HeaderClickActionDefault="SortMulti" LoadOnDemand="Xml" RowSelectorsDefault="No"
SortCaseSensitiveDefault="False">
<FrameStyle BorderColor="#001060" BorderStyle="Solid" BorderWidth="1px" Cursor="Default"
Font-Names="Verdana" Font-Size="8pt" Width="100%">
</FrameStyle>
<RowAlternateStyleDefault BackColor="#E9E9F7">
<BorderDetails ColorLeft="233, 233, 247" ColorTop="233, 233, 247" />
</RowAlternateStyleDefault>
<Pager AllowPaging="True" PageSize="15" StyleMode="Numeric">
<PagerStyle BackColor="LightGray" BorderStyle="Solid" BorderWidth="1px">
<BorderDetails ColorLeft="White" ColorTop="White" />
</PagerStyle>
</Pager>
<EditCellStyleDefault BorderStyle="None" BorderWidth="0px">
</EditCellStyleDefault>
<HeaderStyleDefault BackColor="#2B64A7" BorderColor="Black" BorderStyle="Solid" ForeColor="White">
<BorderDetails ColorLeft="White" ColorTop="White" WidthLeft="1px" WidthTop="1px" />
</HeaderStyleDefault>
<RowStyleDefault BackColor="#C7D5E8" BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px"
Font-Names="Verdana" Font-Size="8pt">
<Padding Left="3px" />
<BorderDetails ColorLeft="199, 213, 232" ColorTop="199, 213, 232" />
</RowStyleDefault>
<SelectedRowStyleDefault BackColor="#0A75F0" ForeColor="White">
</SelectedRowStyleDefault>
<AddNewBox>
<BoxStyle BackColor="LightGray" BorderStyle="Solid" BorderWidth="1px">
</BoxStyle>
</AddNewBox>
<ActivationObject BorderColor="Black" BorderStyle="Dotted" BorderWidth="" AllowActivation="False">
</ActivationObject>
<FilterOptionsDefault AllowRowFiltering="OnServer" FilterUIType="FilterRow" FilterComparisonType="CaseInsensitive">
<FilterDropDownStyle BackColor="White" BorderColor="Silver" BorderStyle="Solid" BorderWidth="1px"
CustomRules="overflow:auto;" Font-Names="Verdana,Arial,Helvetica,sans-serif"
Font-Size="11px" Width="200px">
<Padding Left="2px" />
</FilterDropDownStyle>
<FilterHighlightRowStyle BackColor="#151C55" ForeColor="White">
</FilterHighlightRowStyle>
<FilterOperandDropDownStyle BackColor="White" BorderColor="Silver" BorderStyle="Solid"
BorderWidth="1px" CustomRules="overflow:auto;" Font-Names="Verdana,Arial,Helvetica,sans-serif"
Font-Size="11px">
</FilterOperandDropDownStyle>
</FilterOptionsDefault>
</DisplayLayout>
</igtbl:UltraWebGrid>
Same issue, but sorting works correctly for me. It's filtering that's producing the described behavior. When I filter, I get the wrong row as if from the underlying datasource. I am not rebinding. How did you fix? Anyone have a thought why Filtering isn't working correctly but Sorting is?
Ok nevermind I got it all figured out. Thank you for your help.
Yeah it looks like I am rebinding. What would be the easiest way to keep that from happening. I know checking to see if it's a PostBack or not won't work since that will mess up the sorting and paging.
Hello,
Is it possible that you are rebinding the grid prior to checking its rows in the CellclickButtonEvent? Rebinding the grid clears all state of the grid, including current sorted rows, etc. It look that it could be a page lifecycle issue, e.g. you are rebinding the grid prior to checking the rows (e.g. rebinding on each postback on Page_Load)
Well I am actually not using the index to access the data from the grid. I am using:
e.Cell.Row.Cells[1].Text
in the ClickCellButton Event to pull the ID of the item that I am storing in the grid. Shouldn't the CellEventArgs contain the cell that the Button Click was fired from?