This is a migrated thread and some comments may be shown as answers.

RadCombo filters RadGrid datasource once only

1 Answer 85 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 07 Jan 2009, 04:33 PM

Hi All

I have a RadComboBox and RadTextInput that provide pararmeters for a SQLDataSource control.  A RadGrid then pulls it's data from the SQLDataSource.  The first time I load the page, I can choose an item in the combobox, enter some text, and the RadGrid binds to the datasource and displays the data fine. 

If I then select something else in the combobox, or enter different text in the textinput fields and autopostback, then RadGrid will refresh BUT it continues to display the original data.  It seems either the RadGrid is not refreshing itself from the datasource, or my input fields aren't updating the datasource properly.

Any ideas?  Code follows...

Thanks
Mark

 

<telerik:RadScriptManager ID="RadScriptManager1" runat="server">  
        </telerik:RadScriptManager> 
 
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">  
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="radddlLocation_id">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="SQL_Locations" /> 
                        <telerik:AjaxUpdatedControl ControlID="radddlProvider_no" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
                <telerik:AjaxSetting AjaxControlID="btnFetchPatients">  
                    <updatedcontrols> 
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> 
                    </updatedcontrols> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
        </telerik:RadAjaxManager> 
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px" 
            Width="75px">  
            <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' style="border: 0px;" /> 
        </telerik:RadAjaxLoadingPanel> 
          
        <h2>IMACAM Image Upload</h2> 
          
        <asp:Label ID="lblStatus" runat="server" Text="Label" ForeColor="Maroon"   
            Visible="False" Font-Bold="True"></asp:Label> 
        <br /> 
          
        <strong>1&nbsp; Select Location</strong> 
        <br /> 
        <telerik:RadComboBox ID="radddlLocation_id" runat="server" AppendDataBoundItems="True" 
            DataSourceID="SQL_Locations" DataTextField="name" DataValueField="LocationId" 
            Skin="Office2007" OnSelectedIndexChanged="radddlLocation_id_SelectedIndexChanged" 
            Width="250px" MarkFirstMatch="True" NoWrap="True" Text="Select location"   
            AutoPostBack="True">  
            <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
        </telerik:RadComboBox> 
        <asp:SqlDataSource ID="SQL_Locations" runat="server" ConnectionString="<%$ ConnectionStrings:OmateSQLConnectionString %>" 
              
            SelectCommand="SELECT location_city + ', ' + LocDisplayName AS name, LocationId FROM Location ORDER BY location_city">  
        </asp:SqlDataSource> 
        <br /> 
        <br /> 
        <strong>2&nbsp; Select Provider</strong><br /> 
        <telerik:RadComboBox ID="radddlProvider_no" Runat="server"   
            DataSourceID="SQL_Providers" DataTextField="fullname"   
            DataValueField="provider_no" MarkFirstMatch="True" NoWrap="True"   
            onselectedindexchanged="radddlProvider_no_SelectedIndexChanged"   
            Skin="Office2007" Width="250px">  
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
        </telerik:RadComboBox> 
        <asp:SqlDataSource ID="SQL_Providers" runat="server"   
            ConnectionString="<%$ ConnectionStrings:OmateSQLConnectionString %>"   
            SelectCommand="SELECT [provider_no], [provider_last_name] + ' ' + [provider_first_name] AS [fullname] FROM [provider] WHERE ([default_Location] = @default_Location) ORDER BY [fullname]">  
            <SelectParameters> 
                <asp:ControlParameter ControlID="radddlLocation_id" Name="default_Location"   
                    PropertyName="SelectedValue" Type="Int32" /> 
            </SelectParameters> 
        </asp:SqlDataSource> 
        <br /> 
        <br /> 
          
        <strong>3&nbsp; Select Patient</strong><br /> 
        <telerik:RadTextBox ID="radtxtFirstName" runat="server" EmptyMessage="Enter Firstname" 
            Skin="Office2007" Width="125px">  
        </telerik:RadTextBox> 
        &nbsp;<telerik:RadTextBox ID="radtxtLastName" runat="server" EmptyMessage="Enter Lastname" 
            Skin="Office2007" Width="125px">  
        </telerik:RadTextBox> 
        &nbsp;<asp:Button ID="btnFetchPatients" runat="server" Height="26px" Text="Go &gt;&gt;" /> 
        <br /> 
        <br /> 
          
        <telerik:RadGrid ID="RadGrid1" runat="server" 
            AllowSorting="True" AutoGenerateColumns="False"   
            DataSourceID="SQL_Patients" GridLines="None" HorizontalAlign="Left"   
            PageSize="5" Skin="Office2007" Width="500px" Height="170px"   
            onselectedindexchanged="RadGrid1_SelectedIndexChanged">  
            <HeaderContextMenu EnableTheming="True" Skin="Hay">  
                <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
            </HeaderContextMenu> 
            <MasterTableView DataSourceID="SQL_Patients" datakeynames="Patient_no"   
                nomasterrecordstext="Patient record not found.  Please check the name and location specified.">  
                <RowIndicatorColumn> 
                    <HeaderStyle Width="20px"></HeaderStyle> 
                </RowIndicatorColumn> 
                <ExpandCollapseColumn> 
                    <HeaderStyle Width="20px"></HeaderStyle> 
                </ExpandCollapseColumn> 
                <Columns> 
                    <telerik:GridButtonColumn ButtonType="PushButton" CommandName="Select" Text="Select" 
                        UniqueName="Select">  
                    </telerik:GridButtonColumn> 
                    <telerik:GridBoundColumn DataField="first_name" HeaderText="First Name" SortExpression="first_name" 
                        UniqueName="first_name">  
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="last_name" HeaderText="Last Name" SortExpression="last_name" 
                        UniqueName="last_name">  
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="Patient_no" HeaderText="Patient Number"   
                        SortExpression="Patient_no" UniqueName="Patient_no">  
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="ss_no" HeaderText="SSN" SortExpression="ss_no" 
                        UniqueName="ss_no">  
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="locdisplayname" HeaderText="Location"   
                        SortExpression="locdisplayname" UniqueName="Location">  
                    </telerik:GridBoundColumn> 
                </Columns> 
            </MasterTableView> 
            <ClientSettings> 
                <Scrolling AllowScroll="True" UseStaticHeaders="True" /> 
            </ClientSettings> 
            <FilterMenu EnableTheming="True" Skin="Hay">  
                <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
            </FilterMenu> 
        </telerik:RadGrid> 
          
        <asp:SqlDataSource ID="SQL_Patients" runat="server" ConnectionString="<%$ ConnectionStrings:OmateSQLConnectionString %>" 
              
            SelectCommand="SELECT patient.ss_no, patient.first_name, patient.last_name, patient.suffix, Location.location_city, patient.patient_no, Location.LocDisplayName FROM patient INNER JOIN Location ON patient.LocationID = Location.LocationId WHERE (patient.first_name = @first_name) AND (patient.last_name = @last_name) AND (patient.locationid = @location_id)  
ORDER BY Location.LocDisplayName"> 
            <SelectParameters> 
                <asp:ControlParameter ControlID="radtxtFirstName" Name="first_name" PropertyName="Text" 
                    Type="String" /> 
                <asp:ControlParameter ControlID="radtxtLastName" Name="last_name" PropertyName="Text" 
                    Type="String" /> 
                <asp:ControlParameter ControlID="radddlLocation_id" Name="location_id"   
                    PropertyName="SelectedValue" /> 
            </SelectParameters> 
        </asp:SqlDataSource> 
        <br /> 
        <br /> 

 

 

 

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 10 Jan 2009, 09:41 AM
Hi Mark,

I reviewed the code, and it looks correct.
Based on it, however, it is hard to determine what is causing this issue at your end.
If the problem persists, you can open a formal support ticket, and send us the problematic implementation, for additional testing.

Best wishes,
Yavor
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Mark
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Share this question
or