Question Populating and Editing GridViews

Ste_Moore01

Member
Joined
Aug 12, 2013
Messages
6
Programming Experience
3-5
Hi,

I wasn't sure where to put this topic, so if it's in the wrong place I apologise.

I'm new to developing in VB.NET and ASP.NET and I am trying to make a website with an editable GridView.

I am using Visual Studio 2005 and have got to the stage where I need a GridView.
I have populated the GridView with 10 columns ProjectID, Description, MON, TUE, WED, THUR, FRI, SAT, SUN, and Total from a SQL Data Source and Stored Procedure and have set it to automatically generate an edit button.

The GridView automatically sets everything as a Label until you click Edit and it then changes everything to a TextBox.

When I click Edit I want the GridView to change one of the columns (ProjectID) to a DropDownList that is populated with values from a SQL Select query, and when you select something in this list, another column (Description) needs to automatically change to a value based on the content of the ProjectID column.

The ProjectID column would need to be able to set the Description column to be Miscellaneous if 0 is selected, Holiday if 1 is selected and Sick if 2 is selected etc..

VB.NET:
ProjectID   Description   MON   TUE   WED   THU   FRI   SAT   SUN   Total
0           Miscellaneous 8     8     8     8     4     0     0     36
1           Holiday       0     0     0     0     0     8     8     16
2           Sick          0     0     0     0     4     0     0     4
Along with this I need Description to only be manually editable if Miscellaneous is selected, but it needs to update automatically depending on the value of ProjectID.

I've searched through what seems like thousands of websites and I can figure out how to change a column to a DropDownList when being edited but that's about it.

Any help would be greatly appreciated!

Thanks in advance. :-D
 
Back
Top