Solved

.NET VB 2008 Add multiple textboxs to a datagrid cell

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
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…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

863 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

24 Experts available now in Live!

Get 1:1 Help Now