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

Button click not working

8 Answers 415 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sushobhit
Top achievements
Rank 2
Sushobhit asked on 24 Jul 2012, 01:04 PM
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



8 Answers, 1 is accepted

Sort by
0
James Campbell
Top achievements
Rank 1
answered on 24 Jul 2012, 02:52 PM
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 +
0
Sushobhit
Top achievements
Rank 2
answered on 25 Jul 2012, 05:12 AM
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 


0
Sushobhit
Top achievements
Rank 2
answered on 25 Jul 2012, 06:16 AM
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 .
0
Princy
Top achievements
Rank 2
answered on 25 Jul 2012, 08:13 AM
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.
0
Sushobhit
Top achievements
Rank 2
answered on 25 Jul 2012, 08:58 AM
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.
0
Princy
Top achievements
Rank 2
answered on 26 Jul 2012, 04:47 AM
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. 
0
Shaiksha
Top achievements
Rank 1
answered on 08 Nov 2013, 10:58 AM
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
0
Princy
Top achievements
Rank 2
answered on 08 Nov 2013, 12:06 PM
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
Tags
General Discussions
Asked by
Sushobhit
Top achievements
Rank 2
Answers by
James Campbell
Top achievements
Rank 1
Sushobhit
Top achievements
Rank 2
Princy
Top achievements
Rank 2
Shaiksha
Top achievements
Rank 1
Share this question
or