I have a gridview which i need to populate from a products database, where a user can click on a certain
product (row) and gets directed to a new page with that product ID (where he will see the product details
and so on..)
while this seems easy if i bind the gridview to a SQL Datasource, i face few problems:
1- I need to trim the product descrption and only display the first 30 characters ; some products descrption
is much more than 30 characters and i dont want to display all of it in the gridview ..
2- there is a date/time field in my sql query, which appears in the gridview as "10/21/2010 12:00:00 AM". I
don't want to display the time stamp, but only the date. any idea how?
3- if there are no data to display , the gridview header (product name, product description, entry date,
etc..) will disappear and thus the user will be confused..
As a workaround, I'm thinking of capturing the date in a Datatable, after having manipulated it as required
above, and them running a databind on the gridview, which is feasible but has its own challenges:
1- how do u display a URL with the product ID as a variable?
I'm guessing the first method is better, but I couldn't figure it out...
View Complete Post