Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

User Control - Updating Grid View on main page

Status
Not open for further replies.

lnaec

Programmer
Oct 25, 2006
5
GB
I am trying to write a user control that would gather search criteria from user and would update data grid on main form.

Essentially this is just a search box that would be used in number of different place on website.

I am not sure how to tie in information gathered by user control and then pass it over to datagrid or how to force datagrid to update - apart from using Session Variables.

I was thinking of how to make this control do more work than just gather info.

Your ideas are most valued.
 
You could create a Public Property in your user control that exposed the necessary information. This method means that any page can retrieve the information from your control and update itself as necessary.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Good man! this sounds right. What do you think is the best way to refresh datagrid after search button had been pressed? if you dont mind me asking.

btw, I am using microsoft's smart tags to produce grid view ( this suck, I know).

Thanks for your help!
 
What is your user control doing? Is it actually running a query to get the results?


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
To be honest, I dont know. It seems that making a dumb control that simply gathers data defeats the purpose of doint it separately from main page.

I was thinking of a way to encapsulate all search functionality within this control and have datagrid only diplay data. On other hand, should't main page that deals with data representation workout how to retrive data and display it?

I am not sure how to separate workload for different components. What do you think?
 
It sounds like you would be best creating the search box and the results box in the user control itself. This way it can simply be dropped onto any page and you don't have to worry about updating any controls on a page.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top