Last post Apr 26, 2012 10:02 PM by Decker Dong - MSFT
Apr 25, 2012 12:22 PM|chetanom|LINK
I'm sending a Key-Value pair with the Target URL. Based on this Key-Value Pair, I would like to search the GridView present in the Target Page. Can somebody please help me out with it?
The Target Page contains a GridView with Columns "JobNo", "Customer", "JobDate".
I'm sending the Key-Value pair for JobNo as below in the Target URL,
So when this URL loads, it should search and present me the GridView with only information for JobNo=1234
Apr 25, 2012 12:42 PM|Shoaib.Rashid|LINK
In page load event get value of JobNo from your QueryString
String strJobNo =Request.QueryString["JobNo"].ToString();
DataRow filteredRows = datatable.Select("JobNo like '%" + strJobNo+ "%'");
Apr 25, 2012 12:53 PM|chetanom|LINK
I got an error saying DataRow and datatable doesn't exist
Meanwhile, I tried the following code
GridView1.DataSource = ObjectDataSource3.Select(Items => Items.JobNo == Request.QueryString["JobNo"]);
But for this also I got an error saying "system.web.ui.webcontrols.objectdatasource does not contain a definition for SELECT"
Apr 25, 2012 12:56 PM|Shoaib.Rashid|LINK
On target page what is the type of your GridView dataSource from which you want to filter one record.
Apr 25, 2012 01:04 PM|chetanom|LINK
Actually, I got it working. I selected the Parameter JobNo for my SelectCommand in the ObjectDataSource and let it pass the value through Query String.
Thanks for your help
Apr 26, 2012 10:02 PM|Decker Dong - MSFT|LINK
Congratulation！Welcome to our forum next time to chat with us about technology as well as share more nice solutions……