Solved

.NET VB 2008 Add multiple textboxs to a datagrid cell

Posted on 2012-04-03
3
137 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
Comment Utility
0
 

Author Comment

by:JamesDBuskirk
Comment Utility
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
Comment Utility
Sorry for the exceedingly long delay, I had forgotten all about this. Thank you for the help.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

763 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now