?
Solved

.NET VB 2008 Add multiple textboxs to a datagrid cell

Posted on 2012-04-03
3
Medium Priority
?
145 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 2000 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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

765 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