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

Using javascript repaint

1 Answer 38 Views
SearchBox
This is a migrated thread and some comments may be shown as answers.
Kurt
Top achievements
Rank 1
Kurt asked on 25 Oct 2013, 03:59 PM

I am trying to use the client side repaint method. But I can not seem to get it to work.  Can anyone give me the correct way to access the method?


Part of my javascript function:

            var payeeElement = window.$find(var_radPayeeSearchClientID_fromASPX);
            payeeElement.control.repaint();



Thanks.

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 28 Oct 2013, 01:22 PM
Hi Kurt,

Please check the following sample code I tried which works fine at my end.

ASPX:
<telerik:RadSearchBox ID="RadSearchBox1" runat="server" DataSourceID="SqlDataSource1"
    DataTextField="ContactName" EnableAutoComplete="true">
</telerik:RadSearchBox>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
    SelectCommand="select ContactName from [Customers];"></asp:SqlDataSource>
<telerik:RadButton ID="RadButton1" runat="server" Text="Repaint" AutoPostBack="false"
    OnClientClicked="repaintSearchBox">
</telerik:RadButton>

JavaScript:
<script type="text/javascript">
    function repaintSearchBox() {
        var radsearchbox = $find("<%= RadSearchBox1.ClientID%>");
        radsearchbox._element.style.width = "500px";
        radsearchbox.repaint();
    }
</script>

Thanks,
Shinu.
Tags
SearchBox
Asked by
Kurt
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Share this question
or