Each option, selected by checkbox or dropdown (probably) will add on to the SQL data source to pull only the information needed and display it in a gridview.
For instance, the initial query is:
Select C.Name, From Clients as C INNER JOIN Rep_Client as RC on RC.Client_ID = C.ID INNER JOIN Employees as Emp on Emp.ID = RC.Emp_ID AND Emp.ID = '10' AND RC.Eng_ID is NULL Where IsNull(C.Terminated, 'False') = 'False'
If the user wants to see what their role with that client is, they would click a checkbox that would update the data source and add the following:
( Select RC.Position From Employees as Emp INNER JOIN Rep_Client as RC on RC.Emp_ID = Emp.ID Where Emp.ID = @Emp AND RC.Client_ID = C.ID AND RC.Eng_ID is NULL ) as [My Position],
A lot of these columns are datetime data type in SQL. I need to format it in the gridview as
How can I do this, preferably referring to the column using the column name of "My Position" and not a numeric...
If this can NOT be done....
The other option is to query everything and format it - and then hide columns in the gridview based on items that are not checked. Would this be easier? (Doesn't sound as efficient to me).
If anyone has a much smarter way to do this let me know!