Click here to Skip to main content
15,885,660 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

I am making a appointment calendar application. (Calender with big Squares)

To create calendar I have used datagridview.

In this application, event will be added on selected Cell/date and will display that event in calendar

for that i have to add control in selected datagridview cell but i did not succeed to add cell

If you have any suggestion for how to add multiple control in one/selected datagridview cell, it will most helpfull to me

Thanks in advance
Posted
Updated 30-Jul-15 19:44pm
v2

1 solution

Do you use WPF? If yes add a content control to this cell (grid/stackpanel/wrappanel....)

If you use Winforms you can also add an additional grid or another "container" into your cell.
 
Share this answer
 
Comments
KirtiZare 31-Jul-15 5:50am    
Thanks

I am using winform.

can you give me the example of using an additional grid or another "container" into datagridview cell.
stibee 31-Jul-15 5:51am    
show the which you have
KirtiZare 31-Jul-15 7:22am    
Following is the code through which i have create a calender using datagridview

Public Sub CreateCalender()
dgvCalender.Rows.Clear() 'Clear Datagridview Row
Dim i As Integer = 0
Dim startDate = New Date(now.Year, now.Month + j, 1)
Dim endDate = startDate.AddMonths(1).AddDays(-1)
Dim numberOfDays As Integer = (endDate.Date - startDate.Date).Days + 1

For dayCount As Integer = 0 To (numberOfDays - 1)
If startDate.AddDays(dayCount).Day = 1 OrElse startDate.AddDays(dayCount).DayOfWeek = DayOfWeek.Monday Then
dgvCalender.Rows.Add()
End If

dgvCalender.Rows(i).Cells("Col" & startDate.AddDays(dayCount).DayOfWeek.ToString()).Value = startDate.AddDays(dayCount).Day

If now.Day = startDate.AddDays(dayCount).Day AndAlso j = 0 Then
dgvCalender.Rows(i).Cells("Col" & startDate.AddDays(dayCount).DayOfWeek.ToString()).Style.BackColor = Color.Gray
End If

If startDate.AddDays(dayCount).DayOfWeek = DayOfWeek.Sunday OrElse startDate.AddDays(dayCount).Day = 31 Then
i = i + 1
End If
Next dayCount

lblMonthName.Text = mfi.GetMonthName(now.Month + j).ToString() & " - " & DateTime.Now.Year
End Sub

Now I want to add multiple control in datagridview cell.

It should look like for example

"http://demos.telerik.com/aspnet-ajax/scheduler/examples/month-view/defaultcs.aspx".

It is teleric control where we can add,edit,delete appointment, but i dont want to use telerik control or any other third party
stibee 31-Jul-15 7:28am    
Please modify your question with that code.... If you then format the code it is easier to read. I hope that you paid for telerik licence. So you have support from telerik. They are very fast.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900