Click to See Complete Forum and Search --> : Datagrid...


NinaWilliam
03-19-2006, 01:54 AM
Hi,

I have a page to view appointments records in my application.. aslo, i give the users the ability to search for spescific records
so my questiuon is: do i create 2 datagrid one to view records returned by the defualt query and the other one to view records of the search query?
and control their visibility depending on the events.. or there is other way to do this?

please if you anyone have experience with view and search process.. please tell me are you using the same datagrid for view and search or two, one for view and the other for search?

Nina

takkie
03-19-2006, 11:20 PM
Either way will work.

If you use 2 datagrid, then you can specify what column to display at design time. But if you use 1 datagrid, then you will not be able to specify which column to display at design time, you must do it at runtime.

Like, say, the default query returns 4 columsn, then you create a view for the default query, just stick it to the datagrid1.datasource. Then your datagrid will display all 4 columns, And say your search query returns 6 columns, then you create a view for the search query, and stick it to datagrid1.datasource, and the datagrid will dipslay 6 columns.

But you will have to understand, if you need to display different colors, fonts, etc... for default and search, then you will have to do alot of formatting at your code behind, depending on which query it is doing..

-tak

sirpelidor
03-20-2006, 02:40 PM
if the result (columns, data type, etc) of your appointments records is same as your result of spescific records, then I would just stick with the same datagrid, and change the SQL statement.