ASP.net Edit "cell" in GridView

Hi

In my ASP.net web app a user selects a from and to date and a datatable loads into a GridView with a column
for each date. I want a user to be able to select one of the items or "cells" in the gridview and change the number in it.
Ordinarily I use template columns to do this because I know exactly which columns will load but in this
case any number of date columns can load.

1
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Lansing Nye-MaddenNetwork AdministratorCommented:
How do you go about generating the columns? Are they created individually, one-at-a-time, or are they part of a larger data set schema?
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
I generate the columns individually or one at a time at the line marked "HERE"

    Dim dtNew As New DataTable()
        'Dim dtLineIDs As New DataTable() 'hidden LineID values
        dtNew.Columns.Add("EmployeeID")
        dtNew.Columns.Add("EmployeeName")
        For i As Integer = 0 To UBound(arrDates) 'Loop through and add date columns
            oDateColumn = arrDates(i).ToString("dd MMM yyyy")
            dtNew.Columns.Add(oDateColumn) "HERE
            oLineIDColumn = "LineID " & oDateColumn 'Hidden Line ID values
            dtNew.Columns.Add(oLineIDColumn)
        Next i

Open in new window

Obadiah ChristopherDeveloper User InterfaceCommented:
How do u enable editing for the cell?

Can you handle the RowDatabound event of the gridview and add a click event for each of the cells?

https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.gridview.rowdatabound

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Thanks
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.