Solved

.NET VB 2008 Add multiple textboxs to a datagrid cell

Posted on 2012-04-03
3
139 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
  • 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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

832 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