GridView (ASP.net)

Capodecina
Permabanned
Joined
31 Dec 2003
Posts
5,172
Location
Barrow-In-Furness
How can I limit the size of the GridView when Editing? It expands to a stupid size and breaks my website :(

I've tried changing the width in the EditRowSize properties but it does nothing.

Also looking for some advice on what i'm doing.

Since you can't input data using the GridView but I would like an input section that pretty much resembles the way it's layed out, I was going to create a button which generates a new row in the database but with blank fields, then do an autopostback so the user can click edit and then add the values into the GridView.

Does that seem sensible or is there a better way?
 
Thanks :)

My only problem with using that is that I don't really understand what's going on in the VB code part (i'm new to this). So I feel like a spoon using it, plus there's no point in just stealing without understanding.
 
VB dude :)

Also does anyone know how I can validate the input into the GridView fields? I'll need it for editing and inputting.

I'm not sure if a GridView is the best option though, because ideally I need some fields to be drop down and populated from a list in the database?
 
Last edited:
I'll just have to give it a go Kevin I think. I've sorted limiting the size thank you very much :D

As for the drop down lists. I'm a little confused as to what to do.

Ideally i'd like to be able to present it like a gridview, but when I click edit it shows a drop down box (populated from a database) that allows the user to select a value from the list, and then submit the value they have selected. It should show the value they have selected when being presented in the GridView.

For example, selecting a project code from a Projects table, but submitting it to a different table to be stored.

Thanks for the help.
 
I don't want it in a new table. I'll try explain what i'm trying to achieve a little better.

Developing a system that will capture hours people have spent doing something based on a list of tasks. For example:

ID TASK DATE MON TUE WED THU FRI
----------------------------------------------------------
1 001231 10/07/88 1.5 6 6 3 10
2 002222 10/07/88 8.0 7 4 7 10
3 004213 13/07/88 1.5 6 4 7 10



I'd like the task to be a down down list, populated from data in another table. With all of the data shown above stored in its own table along with a UserID (for who submitted it). I'm not sure if there's a better way of doing it.

If I added the drop down list in the way you said, would I have to change the Update command the GridView uses to add the value selected in the drop down box when it's selected?

I'm new to this so sorry if i'm not explaining myself too well, I have only just started learning. I do appreciate the help though.
 
I'm not scared of coding don't worry, just looking for a point in the right direction and checking to make sure i'm on the right path :D

I'll give it a go and let you know thank you :)

I'm using VWD.
 
Back
Top Bottom