We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Refresh listbox on client-side without postback

Thread ID:

Created:

Updated:

Platform:

Replies:

124992 Jul 13,2016 08:26 AM UTC Jul 14,2016 12:44 PM UTC ASP.NET Web Forms 1
loading
Tags: ListBox
Pratura
Asked On July 13, 2016 08:26 AM UTC

Hi,

is this scenario possible?
To refresh the sqldatabound listbox without postback?

 <asp:HiddenField runat="server" ID="IDValue" Value="" />

 <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:_____ConnectionString %>" SelectCommand="_____Select" SelectCommandType="StoredProcedure">
                <SelectParameters>
                    <asp:ControlParameter ControlID="IDValue" Name="ID" PropertyName="Value" Type="Int32" />
                </SelectParameters>
        </asp:SqlDataSource>

  <ej:ListBox ID="listboxInfo" runat="server" DataTextField="Text" DataSourceID="SqlDataSource1"></ej:ListBox>

on the grid is
  <ClientSideEvents RowSelected="ShowAdditionalInfo" />

function ShowAdditionalInfo() {    
            var obj = $("#Grid1").ejGrid("instance");
            $("#IDValue").val(obj.getSelectedRecords()[0].ID);        
            $("#listboxInfo").ejListBox("refresh", true);
        }

After the row is selected in the grid the listbox would show additional info. 
This doesn't refresh the listbox.

It does however work if i do this 
function ShowAdditionalInfo() {    
            var obj = $("#Grid1").ejGrid("instance");
            $("#IDValue").val(obj.getSelectedRecords()[0].ID);        
            __doPostBack('UpdatePanel1',null);
        }
but it is very slow and lagging after each row click on the grid.

And i want to avoid server side.

Selvamani Sankarappan [Syncfusion]
Replied On July 14, 2016 12:44 PM UTC

Hi Pratura,   
Thanks for Contacting Syncfusion Support.  
We have checked with your code example. In your sample you have selected the row in a grid that updated the hidden field, which update only with the ID from (obj.getSelectedRecords()[0].ID). So, this ID is passed to the ListBox dataSource. If you want to get the all the details of selected row in a grid with the <SelectParameters>, then you must do the post back process. Please refer the following link: 
   
We have prepared the sample based on particular field only updated to the ListBox. Please refer the following sample:   
 
If this is not your scenario, please revert the provided sample based on your application. This would be helpful for us to analyze and provide an exact solution at the earliest.    
    
Regards,   
Selvamani S 

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;