Last post Oct 01, 2020 06:05 PM by coreysan
Sep 30, 2020 05:18 PM|coreysan|LINK
I'm learning some of the data controls for aspx forms. What I'm trying to accomplish is emulate a Windows App that has a GridView for user data input. You know, the classic Excel type of appearance and usage.
So in aspx, is there a control that just allows data input into the grid, easily? Something very basic, as if you had a small Excel form right there in the body of the aspx page!
Oct 01, 2020 02:04 AM|Sean Fang|LINK
There are indeed some spreadsheet controls for ASP.NET however they are not for free (just the
opposite, a bit expensive).
If you need to use excel-like control, a feasible way is to use grid view and manually add functionalities on it.
At least, you are able to implement followings:
Hope this can help you.
Oct 01, 2020 02:22 AM|coreysan|LINK
Thanks Sean. I appreciate your advice. I tried working with the gridview, and adjusting the width of columns was harder than I thought,
for some reason. And when I tried to rezize the width below 30px it wouldn't respond. SO on that score, it's an uphill battle.
But if that's the only meaningful control I can use (for free) then I guess that's it.
Do you think I should suck it up and work with it, or try a native table?
Oct 01, 2020 02:45 AM|KathyW|LINK
A GridView renders as a Table. CSS on a table would give you the same issues as for a GridView. For example, you can't resize a table column to be smaller than the largest entry in that column plus any padding (defined or defaulted by the browser).
A GridView comes built in with the ability to display a grid of data and edit the data in that grid, but doing only one row at a time.
If you want the GridView to be all editable at once, not one row at a time, you can do that, but it requires you to write your own code to set all the rows in edit mode, and your own code to iterate through all the GridView rows and update the database rather
than using the GridView's built in one-row-at-a-time "update". There are examples all over the web on how to do this.
Similarly if you are looking for an empty grid to add new data, not to update existing data, that can also be done by a GridView, but again, you have to write your own code to iterate through the cells and insert the rows into the database.
Oct 01, 2020 06:05 PM|coreysan|LINK
I think you expressed it best. It turns out my boss suggested writing a for loop and generate a series of text boxes for our needs.
Seems to be the least path of resistance! I also think you convinced me to suck it up and really get to know GridView!
Thanks so much, both to you and to Sean.