Button click not working

9 posts, 0 answers
  1. Sushobhit
    Sushobhit avatar
    26 posts
    Member since:
    Apr 2011

    Posted 24 Jul 2012 Link to this post

    Hi all 
    Greeting of the day

    I  have a problem
    The problem is that i have a rad drop down with check box and in this drop down  user can select more than one value in this list 
    select the check box from drop down and click  on search button ,system doesn't make search  untill we again click on search button. System perform search on first click if we we click any where on page after selecting check box .




    Thanks 
    Sushobhit Raman



  2. James Campbell
    James Campbell avatar
    90 posts
    Member since:
    Jul 2012

    Posted 24 Jul 2012 Link to this post

    HI Sushobhit,

    I am sorry but I am having a hard time understanding exactly what your issue is, is there a way you could show your issues using screen shots and showing your code for the issue in question?

    Thank you,
    James Campbell
    Telerik MVP
    MCP, MCSE, MCSA, Security +
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Sushobhit
    Sushobhit avatar
    26 posts
    Member since:
    Apr 2011

    Posted 25 Jul 2012 Link to this post

    HI All
    Greeting of the days 

    i have a rad drop down with check box  .when i select the more than one check box from drop down and click  on search button ,system doesn't make search  untill we again click on search button 


  5. Sushobhit
    Sushobhit avatar
    26 posts
    Member since:
    Apr 2011

    Posted 25 Jul 2012 Link to this post

    I have rad combo box with check box for selecting more than one value by click on check box and a search button on same page . when i select check box values the combo box  not close and after selection i have directly click on the search button the search button not working but if i gain click on search button then it perform . so i need code for that when i select the check box and then directly click on  the search button the search perform Action .
  6. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 25 Jul 2012 Link to this post

    Hi Sushobhit,

    I also experienced the same behavior. One suggestion is you can access the button in OnclientBlur of RadCombobox and raise the click event explicitly. Here is the sample code.

    Javascript:
    <script type="text/javascript">
    function OnClientBlur(sender, args)
    {
     if (args._domEvent.srcElement.id == "Button1")
     {
      document.getElementById("Button1").click();
     }
    }
    </script>

    Thanks,
    Princy.
  7. Sushobhit
    Sushobhit avatar
    26 posts
    Member since:
    Apr 2011

    Posted 25 Jul 2012 Link to this post

    Hi Princy,
    Thanks for you reply.

    But I think you have to more look in to this because this is not a solution. If i Did't click on the button directly and i have clicked on the blank are of the page than it will fire the button click.

    So look into to this.
  8. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 25 Jul 2012 Link to this post

    Hi Sushobhit,

    Unfortunately I couldn't replicate the issue at my end. Please make sure that you are checking the condition for whether the click is on the button or not. Here is the full code.

    ASPX:
    <telerik:RadComboBox ID="RadComboBox1" runat="server" CheckBoxes="true" AutoPostBack="true" OnClientBlur="OnClientBlur" >
     <Items>
        .............
     </Items>
    </telerik:RadComboBox>
    <asp:Button ID="Button1" runat="server" onclick="Button1_Click" OnClientClick="return OnClientClick()" />

    Javascript:
    <script type="text/javascript">
     function OnClientClick()
     {
      // Your Code
     }
     function OnClientBlur(sender, args)
     {
      if (args._domEvent.srcElement.id == "Button1"// Checking whether Click is on the Button or not
      {
       document.getElementById("Button1").click();
      }
     }
    </script>

    C#:
    protected void Button1_Click(object sender, EventArgs e)
    {
      // Your Code
    }

    Please provide your code if it doesn't helps.

    Thanks,
    Princy. 
  9. Shaiksha
    Shaiksha avatar
    1 posts
    Member since:
    Nov 2013

    Posted 08 Nov 2013 Link to this post

    Hi All,

    I have telerik grid and above that i placed an external telerik button for search. When i click search button, the grid will opens text boxes for corresponding columns and searching is working fine.

    The problem is, when i enter some data in textbox and if i click on search button, the textboxes should disappear.  But grid search is happening. How can i prevent that?

    Thanks in advance.

    Regards,

    Shaiksha
  10. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 08 Nov 2013 Link to this post

    Hi Shaiksha,

    Please try the sample code snippet. I have hidden the TextBox after entering the Search-Text .

    ASPX:
    <telerik:RadTextBox ID="RadTextBoxSearch" runat="server" Visible="false" AutoPostBack="true"
        OnTextChanged="RadTextBoxSearch_TextChanged1">
    </telerik:RadTextBox>
    <telerik:RadButton ID="RadButtonSerach" runat="server" Text="Search" OnClick="RadButtonSerach_Click">
    </telerik:RadButton>
    <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="false" GridLines="None"
        AllowPaging="true" Visible="false" OnNeedDataSource="RadGrid1_NeedDataSource">
        <MasterTableView DataKeyNames="OrderID">
            <Columns>
                <telerik:GridBoundColumn UniqueName="OrderID" DataField="OrderID" HeaderText="OrderID" />
                <telerik:GridBoundColumn DataField="ShipCity" HeaderText="ShipCity" UniqueName="ShipCity" />
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>

    C#:
    string id;
    protected void RadButtonSerach_Click(object sender, EventArgs e)
    {
        RadTextBoxSearch.Visible = true;
    }
    protected void RadTextBoxSearch_TextChanged1(object sender, EventArgs e)
    {
        id = RadTextBoxSearch.Text;
        RadGrid1.Visible = true;
        RadGrid1.Rebind();
        RadTextBoxSearch.Visible = false;
    }
    protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
    {
        RadGrid1.DataSource = GetDataTable("SELECT OrderID,ShipCity FROM Orders where OrderID='"+id+"'");
    }

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