radcombobox not working inside radgrid for first time

2 posts, 0 answers
  1. Arun
    Arun avatar
    4 posts
    Member since:
    Jun 2013

    Posted 05 Jun 2014 Link to this post



     I have two combo box on my page one as pagination combo box and another one is for filtering results in rad grid both are resides in same rad grid.

    radcombobox not working inside radgrid for first time.

    But it starts working as expected after post back
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 06 Jun 2014 in reply to Arun Link to this post

    Hi Arun,

    Please have a look into the following sample code snippet which works fine at my end. Please provide your code if it doesn't help.

    ASPX:
    <telerik:RadGrid ID="radgrdOrders" runat="server" DataSourceID="SqlDataSource1" AutoGenerateColumns="false" AllowPaging="true" AllowFilteringByColumn="true">
        <MasterTableView>
            <Columns>
                <telerik:GridTemplateColumn>
                    <FilterTemplate>
                        <telerik:RadComboBox ID="RadComboBoxTitle" DataSourceID="SqlDataSource1" runat="server"DataTextField="CustomerID" DataValueField="CustomerID" Height="200px" AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("CustomerID").CurrentFilterValue %>'
                           OnClientSelectedIndexChanged="TitleIndexChanged">
                            <Items>
                                <telerik:RadComboBoxItem Text="All" />
                            </Items>
                        </telerik:RadComboBox>
                        <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
                            <script type="text/javascript">
                                function TitleIndexChanged(sender, args) {
                                    var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                    tableView.filter("CustomerID", args.get_item().get_value(), "EqualTo");
                                }
                            </script>
                        </telerik:RadScriptBlock>
                    </FilterTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridBoundColumn DataField="OrderID" UniqueName="OrderID">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="CustomerID" UniqueName="CustomerID">
                </telerik:GridBoundColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top