1
Answer

Webservice for filtering data in gridview on dropdown list item select

Photo of johny basha

johny basha

12y
1.8k
1
hai all,

 i have a page in which i have a grid view and i have a dropdownlist for filtering, when we select a item from drop down list the data should be filtered and it should be binded to the grid view and display according to the item selected in the drop down list. how can we do this using webservices can anybody help it is urgent.

thanks.

Answers (1)

0
Photo of Ranjit Powar
NA 8.1k 496.8k 9y
try jquery as below
 
$('#TextBox2').focus(function(){
    $('#TextBox2').val($('#TextBox1').val());
}); 
 
 
 
 
 
If it helps you select it as correct answer. 
Accepted
0
Photo of parul jain
NA 140 10.4k 9y
Sir how we will define loop in following statement :
 
 
$('#gvDetails_txtPackaging_0').blur(function () {
if ($('#gvDetails_txtPackaging_0').val() > $('#gvDetails_txtQuantity_0').val()) {
alert('Packaging number can not be greater than Quantity of product')
}
});
 
0
Photo of Ranjit Powar
NA 8.1k 496.8k 9y
If your problem solved, then select it as correct answer. So other users with same problem no which is correct answer.
0
Photo of parul jain
NA 140 10.4k 9y
thank you so much sir.. :) :)
its working... 
0
Photo of Ranjit Powar
NA 8.1k 496.8k 9y
$('#TextBox2').blur(function(){
if($('#TextBox2').val()>$('#TextBox2').val()
{
//Give error message here 
}
});
0
Photo of parul jain
NA 140 10.4k 9y
yeah sir exactly..
0
Photo of Ranjit Powar
NA 8.1k 496.8k 9y
You mean to say when you enter value in textboxt2 right??
0
Photo of parul jain
NA 140 10.4k 9y
yes sir i can..
actually i want restriction that if we are enter some value in textbox1 so in textbox2 must have the value that will be less than or equal to the value of textbox1... 
0
Photo of Ranjit Powar
NA 8.1k 496.8k 9y
can you explain. It gives same value in textbox2
0
Photo of parul jain
NA 140 10.4k 9y
thank you ranjit sir its working..
but in textbox 2 i want the value which is less than or equal to textbox 1..plz give solution becoz i am new in jquery 
0
Photo of Shubham Kumar
NA 6.5k 260.7k 9y
hi try this:
 
 
<asp:TextBox runat="server" id="textbox1" onblur="SetTextInTextBox2()" />
<asp:TextBox runat="server" id="textbox2" onfocus="SetTextInTextBox2()" />

in javascript


  1. function SetTextInTextBox2()   
  2. {   
  3. var a=document.getElementById('textbox1').value ;  
  4. var b= document.getElementById('textbox2').value  
  5. if(a>0)     
  6. {  
  7.  document.getElementById('textbox2').value = document.getElementById('textbox1').value;   
  8. }  
  9.