I am having some problems getting only a date to show in my table..
I got some help on a previous question, but ran into another problem. These are the things we have added:
((BoundField)gvEmployeeReview.Columns[1]).DataFormatString = "{0:d}"; //date hired column
((BoundField)gvEmployeeReview.Columns[8]).DataFormatString = "{0:d}"; //next review column
Here is the aspx page http://pastebin.com/DnH3wcAG
and here is the code behind page http://pastebin.com/yY2nbbEG
When I run it, I get:
“Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index” and its on this line “Line 158: ((BoundField)gvEmployeeReview.Columns[1]).DataFormatString = “{0:d}”; //date hired column”
Any help trying to fix this problem would be fantastic. I haven’t had any luck
I just redid the page and built the table in gridview rather than building it in the code…in the end it was just much easier..had to change a bit of the code…but it all turned out good..thanks for all the input