Current filter:
                                You should refresh the page.
                                Support Center
                                0

                                This example demonstrates how to filter the ASPxGridView bound to SqlDataSource via the ControlParameter. The ControlParameter is passed to the SqlDataSource from an external ASPxComboBox. The ASPxComboBox is inside ASPxRoundPanel. Use the following syntax to find the ASPxComboBox inside the ASPxRoundPanel: ASPxRoundPanelID$ASPxComboBoxID.

                                See also:
                                E2041

                                • Cláudio Teixeira 1 12.28.2016
                                  I am in the learning phase of DevExpress.
                                  I use evaluate version .v11.2, Version = 11.2.10.0.
                                  I tried to apply the example and it presented me with an error.


                                  Não foi possível encontrar o controle 'ASPxGridView1$idTela' em ControlParameter 'idTela'.


                                      <dx:ASPxGridView ID="ASPxGridView1" runat="server" AutoGenerateColumns="False"


                                       <dx:GridViewDataComboBoxColumn Caption="Tela" FieldName="tela" VisibleIndex="2" Width="250px"
                                               CellStyle-Wrap="False" FilterCellStyle-Wrap="False">
                                               <PropertiesComboBox ButtonStyle-Wrap="False" Style-Wrap="False" Width="250px" ClientInstanceName="tela"
                                                TextField="tela" ValueField="tela" DataSourceID="SqlDataSourceTelas" IncrementalFilteringMode="Contains">
                                                <ButtonStyle Wrap="False"></ButtonStyle>
                                                <ValidationSettings ErrorDisplayMode="Text" CausesValidation="True" ErrorTextPosition="Bottom"
                                                    EnableCustomValidation="True" Display="Dynamic" SetFocusOnError="True" ErrorText="Selecione tela">
                                                    <ErrorFrameStyle BackColor="Red" Font-Bold="True" Font-Names="Arial" Font-Size="Larger">
                                                    </ErrorFrameStyle>
                                                 <RequiredField IsRequired="true" ErrorText="Selecione tela" />
                                                </ValidationSettings>
                                                <Style Wrap="False"></Style>
                                               </PropertiesComboBox>
                                               <EditItemTemplate>
                                                   <dx:ASPxComboBox ID="idTela" runat="server" DataSourceID="SqlDataSourceTelas" 
                                                       Value='<%# Bind("tela") %>' TextField="tela" ValueField="tela"
                                                       ValueType="System.String">
                                                   </dx:ASPxComboBox>
                                               </EditItemTemplate>
                                               <FilterCellStyle Wrap="False"></FilterCellStyle>
                                               <CellStyle Wrap="False"></CellStyle>
                                              </dx:GridViewDataComboBoxColumn>


                                              <dx:GridViewDataComboBoxColumn Caption="Coluna" FieldName="coluna" VisibleIndex="3" Width="250px"
                                               CellStyle-Wrap="False" FilterCellStyle-Wrap="False">
                                               <PropertiesComboBox ButtonStyle-Wrap="False" Style-Wrap="False" Width="250px" ClientInstanceName="coluna"
                                                TextField="coluna" ValueField="coluna" DataSourceID="SqlDataSourceColunasTelas" 
                                                   IncrementalFilteringMode="Contains">
                                                <ButtonStyle Wrap="False"></ButtonStyle>
                                                <ValidationSettings>
                                                 <RequiredField IsRequired="true" />
                                                </ValidationSettings>
                                                <Style Wrap="False"></Style>
                                               </PropertiesComboBox>
                                               <FilterCellStyle Wrap="False"></FilterCellStyle>
                                               <CellStyle Wrap="False"></CellStyle>
                                              </dx:GridViewDataComboBoxColumn>


                                      <asp:SqlDataSource ID="SqlDataSourceTelas" runat="server" 
                                          ConnectionString="<%$ ConnectionStrings:CECM.Properties.Settings.Conex %>" 
                                          SelectCommand="Select tela From [VW_TELAS]" >
                                      </asp:SqlDataSource>
                                      <asp:SqlDataSource ID="SqlDataSourceColunasTelas" runat="server"
                                          ConnectionString="<%$ ConnectionStrings:CECM.Properties.Settings.Conex %>" 
                                          SelectCommand="Select coluna From [VW_TELAS_COLUNAS] Order by Ordem" >
                                          <SelectParameters>
                                           <asp:ControlParameter ControlId="ASPxGridView1$idTela" Name="idTela"  
                                             PropertyName="SelectedDataKey.Values[idTela]" Type="String"/>
                                          </SelectParameters>
                                      </asp:SqlDataSource>

                                  Thanks

                                  Cláudio Teixeira


                                • Hello Cláudio,

                                  I've created a separate ticket on your behalf (T467106: How to filter ASPxGridView bound to SqlDataSource by using an external ASPxComboBox in ASPxRoundPanel). Please refer to it for further assistance.

                                Show Implementation Details


                                Select file
                                • Default.aspx
                                • Default.aspx.cs
                                Select language
                                • C#
                                • VB.NET
                                Select version
                                • 13.1.6 - 17.1.6
                                • 9.3.3 - 12.2.18

                                If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

                                FOLLOW US

                                DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, ASP.NET, WinForms, HTML5 or Windows 10, DevExpress tools help you build and deliver your best in the shortest time possible.

                                Copyright © 1998-2017 Developer Express Inc.
                                All trademarks or registered trademarks are property of their respective owners