Please help me get sorting working on the grid. It should be a simple thing. Just flip the property ig:Sorting enabled= true, but this does not work. It looks like the client event gets called, but the grid does not refresh. What could this be? We have tried on 2 different development boxes. Same lack of functionality. The version we are using is 11.2 and we cannot upgrade at this time. Really strange, sorting seems like one of those really simple features that should just work. Here is the markup. We are developing on windows 7-64bit, not sure if that matters.
<ig:WebDataGrid ID="gridMedications" DataKeyFields="Pat_Med_ID" runat="server" Height="445px" AutoGenerateColumns="False" Style="margin-right: 10px" StyleSetName="Office2007Blue" Width="99.9%" EnableAjax="true" EnableDataViewState="True" > <EditorProviders> <ig:TextBoxProvider ID="DoseProvider" EditorControl-TextMode="MultiLine"> <EditorControl TextMode="MultiLine" ></EditorControl> </ig:TextBoxProvider> <ig:DropDownProvider ID="Rx_Or_OTCProvider"> <EditorControl ID="ecRx_Or_OTC" runat="server" DisplayMode="DropDown" EnableCustomValues="false" EnableAutoCompleteFirstMatch="true" AutoSelectOnMatch="true" DropDownContainerMaxHeight="75px" DropDownContainerHeight="75px"> <Items> <ig:DropDownItem Selected="False" Text="" Value=""> </ig:DropDownItem> <ig:DropDownItem Selected="False" Text="Rx" Value="Rx"> </ig:DropDownItem> <ig:DropDownItem Selected="False" Text="OTC" Value="OTC"> </ig:DropDownItem> </Items> </EditorControl> </ig:DropDownProvider> <%--Vijo 10/2/2012--%> <ig:DropDownProvider ID="RouteProvider"> <EditorControl ID="Route" runat="server" DisplayMode="DropDown" EnableCustomValues="false" EnableAutoCompleteFirstMatch="true" AutoSelectOnMatch="true" DropDownContainerMaxHeight="300px" DropDownContainerHeight="300px" DropDownContainerWidth="250px"> <Items> <ig:DropDownItem Selected="False" Text="" Value=""> </ig:DropDownItem> <ig:DropDownItem Selected="False" Text="Oral" Value="Oral"> </ig:DropDownItem> <ig:DropDownItem Selected="False" Text="Sublingual" Value="Sublingual"> </ig:DropDownItem> <ig:DropDownItem Selected="False" Text="Buccal" Value="Buccal"> </ig:DropDownItem> <ig:DropDownItem Selected="False" Text="Enteral Feeding Tube" Value="Enteral Feeding Tube"> </ig:DropDownItem> <ig:DropDownItem Selected="False" Text="Inhalation" Value="Inhalation"> </ig:DropDownItem> <ig:DropDownItem Selected="False" Text="Nebulizer" Value="Nebulizer"> </ig:DropDownItem> <ig:DropDownItem Selected="False" Text="Intradermal" Value="Intradermal"> </ig:DropDownItem> <ig:DropDownItem Selected="False" Text="Intramuscular" Value="Intramuscular"> </ig:DropDownItem> <ig:DropDownItem Selected="False" Text="Intravenous" Value="Intravenous"> </ig:DropDownItem> <ig:DropDownItem Selected="False" Text="Subcutaneous" Value="Subcutaneous"> </ig:DropDownItem> <ig:DropDownItem Selected="False" Text="Topical" Value="Topical"> </ig:DropDownItem> <ig:DropDownItem Selected="False" Text="Transdermal" Value="Transdermal"> </ig:DropDownItem> <ig:DropDownItem Selected="False" Text="Implant" Value="Implant"> </ig:DropDownItem> <ig:DropDownItem Selected="False" Text="Rectal and Intravaginal" Value="Rectal and Intravaginal"> </ig:DropDownItem> </Items> </EditorControl> </ig:DropDownProvider> <ig:DropDownProvider ID="N_Or_CProvider"> <EditorControl ID="eN_Or_C" runat="server" DisplayMode="DropDown" EnableCustomValues="false" EnableAutoCompleteFirstMatch="true" AutoSelectOnMatch="true" DropDownContainerMaxHeight="75px" DropDownContainerHeight="75px"> <Items> <ig:DropDownItem Selected="False" Text="" Value=""> </ig:DropDownItem> <ig:DropDownItem Selected="False" Text="N" Value="N"> </ig:DropDownItem> <ig:DropDownItem Selected="False" Text="C" Value="C"> </ig:DropDownItem> </Items> </EditorControl> </ig:DropDownProvider> <ig:DatePickerProvider ID="Start_DateProvider" /> <ig:DatePickerProvider ID="Stop_DateProvider" /> </EditorProviders> <Columns> <ig:BoundDataField DataFieldName="Pat_Med_ID" Key="Pat_Med_ID" Hidden="true"> <Header Text="Pat Med ID Hidden" /> </ig:BoundDataField> <ig:BoundDataField DataFieldName="Start_Date" Key="Start_Date" DataFormatString="{0:d}" Width="8%"> <Header Text="Date Identified" /> </ig:BoundDataField> <ig:BoundDataField DataFieldName="N_Or_C" Key="N_Or_C" Width="10%"> <Header Text="New/Changed" /> </ig:BoundDataField> <%--Vijo 10/2/2012--%> <ig:BoundDataField DataFieldName="Medication_ID" Key="Medication_ID" Width="10%"> <Header Text="NCD Code" /> </ig:BoundDataField> <ig:BoundDataField DataFieldName="Description" Key="Description" Width="18%"> <Header Text="Medication Name" /> </ig:BoundDataField> <ig:TemplateDataField Key="Selector" Width="5%"> <Header Text="" /> <ItemTemplate> <asp:Button ID="SelectMedication" runat="server" Text="..." CssClass="Button" /> </ItemTemplate> </ig:TemplateDataField> <ig:BoundDataField DataFieldName="Rx_Or_OTC" Key="Rx_Or_OTC" Width="6%"> <Header Text="Rx/OTC" /> </ig:BoundDataField> <ig:BoundDataField DataFieldName="Dose" Key="Dose" EnableMultiline="true" HtmlEncode="true" Width="5%" > <Header Text="Dosage" /> </ig:BoundDataField> <ig:BoundDataField DataFieldName="Route" Key="Route" Width="10%"> <Header Text="Route" /> </ig:BoundDataField> <%--Vijo 10/2/2012--%> <ig:BoundDataField DataFieldName="Frequency" Key="Frequency" Width="8%"> <Header Text="Quantity/Frequency" /> </ig:BoundDataField> <ig:BoundDataField DataFieldName="Stop_Date" Key="Stop_Date" DataFormatString="{0:d}" Width="8%"> <Header Text="Stop Date" /> </ig:BoundDataField> <%--Vijo 10/2/2012--%> <ig:BoundDataField DataFieldName="High_Alert" Key="High_Alert" Width="5%" CssClass="HighAlert"> <Header Text="High Alert" /> </ig:BoundDataField> <ig:TemplateDataField Key="ReportLink" Width="7%"> <ItemTemplate> <asp:ImageButton ID="SelectReport" runat="server" ImageUrl="Images/NOTE07.ICO" /> </ItemTemplate> <Header Text="" /> </ig:TemplateDataField> </Columns> <Behaviors> <ig:Activation Enabled="True" /> <ig:EditingCore AutoCRUD="False" BatchUpdating="True"> <EditingClientEvents RowsDeleting="gridMedications_Editing_RowsDeleting" /> <Behaviors> <ig:RowAdding Alignment="Bottom" EditModeActions-EnableOnActive="true" EditModeActions-MouseClick="Single" Enabled="false" > <ColumnSettings> <ig:RowAddingColumnSetting ColumnKey="Dose" EditorID="DoseProvider" /> <ig:RowAddingColumnSetting ColumnKey="N_Or_C" EditorID="N_Or_CProvider" /> <ig:RowAddingColumnSetting ColumnKey="Rx_Or_OTC" EditorID="Rx_Or_OTCProvider" /> <%--Vijo 10/2/2012--%> <ig:RowAddingColumnSetting ColumnKey="Route" EditorID="RouteProvider" /> <ig:RowAddingColumnSetting ColumnKey="Start_Date" EditorID="Start_DateProvider" /> <ig:RowAddingColumnSetting ColumnKey="Stop_Date" EditorID="Stop_DateProvider" /> </ColumnSettings> <EditModeActions EnableOnActive="True" MouseClick="Single"></EditModeActions> </ig:RowAdding> <ig:CellEditing> <ColumnSettings> <ig:EditingColumnSetting ColumnKey="Dose" EditorID="DoseProvider" /> <ig:EditingColumnSetting ColumnKey="Rx_Or_OTC" EditorID="Rx_Or_OTCProvider" /> <ig:EditingColumnSetting ColumnKey="N_Or_C" EditorID="N_Or_CProvider" /> <%--Vijo 10/2/2012--%> <ig:EditingColumnSetting ColumnKey="Route" EditorID="RouteProvider" /> <ig:EditingColumnSetting ColumnKey="Start_Date" EditorID="Start_DateProvider" /> <ig:EditingColumnSetting ColumnKey="Stop_Date" EditorID="Stop_DateProvider" /> </ColumnSettings> <EditModeActions EnableOnActive="true" MouseClick="Single" /> <CellEditingClientEvents ExitingEditMode="gridMedications_CellEditing_ExitingEditMode" /> </ig:CellEditing> <ig:RowDeleting Enabled="True" /> </Behaviors> </ig:EditingCore> <ig:Selection CellClickAction="Row" RowSelectType="Single"></ig:Selection> <ig:RowSelectors> </ig:RowSelectors> <ig:Sorting Enabled ="True"></ig:Sorting> </Behaviors> </ig:WebDataGrid>
Hi,
I order for sorting to work with DataViewState on, you need to resupply the datasource. It does not sort the saved records.
regards,David Young
Thanks for the reply. What does this mean? Do you have more details or a code sample?
It means handle ColumnSorted server event and resupply a data source to the WebDataGrid.
-David