Solved

.NET VB 2008 Add multiple textboxs to a datagrid cell

Posted on 2012-04-03
3
142 Views
Last Modified: 2013-06-24
I am using Datagrid for the first time and am creating a custom calendar control. I'd like to add multiple textboxs to datagrid cells.  

I am currently placing all my appointment text into the single textbox control.

My end goal is for each appointment to place a group of six editable textboxes using two horizontals lines in a cell.

here is the code

    Public Sub ReloadCalendar(ByVal ldate As Date, ByVal Selected As Integer)
        Try
            LoadQBEventsForMonth(ldate)   ' loads TheAggArray with appointments for the month from quickbooks 
            ClearDGV() ' clears the datagridview
            dgvCalendar.CellBorderStyle = DataGridViewCellBorderStyle.Raised
            MonthName.Text = monthstr(ldate.Month)
            Dim fdate As DayOfWeek = GetFirstOfMonthDay(ldate)
            Dim idate As Integer = 1
            Dim row As Integer = 0
            Dim column As Integer = fdate
            Do
                'Dim newTextBox As New TextBox
                'newTextBox.Text = idate
                'newTextBox.BackColor = Color.AliceBlue
                If Not TheAggArray(idate) = "" Then     ' we have appointments(s) for this date
                    dgvCalendar.ShowCellToolTips = True
                    dgvCalendar(column, row).ToolTipText = TheAggArray(idate) ' add appointment text to tooltip
                    dgvCalendar(column, row).Value = idate & " !!!"   ' place the day of month on the correct cell with an alert
                Else
                    dgvCalendar(column, row).Value = idate   ' place the day of month on the correct cell
                End If
                column += 1
                If fdate = DayOfWeek.Saturday Then
                    row += 1
                    column = 0
                End If
                fdate = tdate(fdate)
                idate += 1
                If idate = Date.DaysInMonth(ldate.Year, ldate.Month) + 1 Then
                    Exit Do
                End If
            Loop
        Catch ex As Exception
        End Try
    End Sub

Open in new window

0
Comment
Question by:JamesDBuskirk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 37805293
0
 

Author Comment

by:JamesDBuskirk
ID: 37806141
It is indeed a winform. I am reading the articles now, thank you.I'll get back this evening when I can try it.
0
 

Author Closing Comment

by:JamesDBuskirk
ID: 39272800
Sorry for the exceedingly long delay, I had forgotten all about this. Thank you for the help.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question