Hi,
I am developing one windows based application using c#.
I have one datagird and one search button. By clicking on the search button it wil connect to the database and get data and bind it to the datagrid.
My requirement is after clicking on the search button one dialogbox like thing should be shown which wil contain a lable and a cancel button. If we click on the cancel button it should stop executing the query and it should not fetch the data. so, the datagrid will be empty.
Is there any way to do this functionality. It is very urgent for me.
If somebody knows please help me.
Thanks and regards
Pallavi.B
I am developing one windows based application using c#.
I have one datagird and one search button. By clicking on the search button it wil connect to the database and get data and bind it to the datagrid.
My requirement is after clicking on the search button one dialogbox like thing should be shown which wil contain a lable and a cancel button. If we click on the cancel button it should stop executing the query and it should not fetch the data. so, the datagrid will be empty.
Is there any way to do this functionality. It is very urgent for me.
If somebody knows please help me.
Thanks and regards
Pallavi.B
Niradhip ChakrabortyPosted Jan 14, 2008, 11:25 AM
Hey u can use the following code in windows application. Add the code inside your search button event.
DialogResult temp = MessageBox.Show("Are you sure,do you want to perform search operation?","Search", MessageBoxButtons.OKCancel);
if (temp == DialogResult.OK)
{
//code for searching from database
}
cheers,
niradhip
PallaviPosted Jan 11, 2008, 6:56 AM
Hi Manish,
First of all thanks for your reply.
I am working on a windows application. I cann't use Javascript.
If u know any solution for winforms please let me know.
Thanks and Regards
Pallavi
Blocked AccountPosted Jan 10, 2008, 6:18 AM
Add the javascript on that button. I am sending you the code for that.
imageButton.Attributes.Add("onclick", "javascript:return " +
"confirm('Do you want to search the record. " +
"')");
Hope, It will help you.
Happy Coding!!