We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Cell type !!

Hi One small Question I have the cell type of type "monthcalender" but I dont want that I should allow the user to enter the data in that cell Can i restrict the user

5 Replies

AD Administrator Syncfusion Team July 28, 2004 01:46 AM

If you do not want your users dropping the calendar or tying into the cell, then try using teh style.Clickable and style.ReadOnly properties to prevent this. Me.gridControl1(1, 1).CellType = "MonthCalendar" Me.gridControl1(1, 1).CellValueType = GetType(DateTime) Me.gridControl1(1, 1).CellValue = DateTime.Now Me.gridControl1(1, 1).Clickable = False Me.gridControl1(1, 1).ReadOnly = True


LL Lokesh Luthra July 28, 2004 05:04 AM

Hi Clay When I use the read only property (grid(1, 1).ReadOnly = True) then in that case I am not Able to edit the cell.But at the same if I change the value of the calender that change is not reflected.it remains as the original value only. regards Lokesh


AD Administrator Syncfusion Team July 28, 2004 05:56 AM

When I set Me.gridControl1(1, 1).Clickable = False, I cannot drop the calendar so the value of the Calendar cannot be changed as it is never dropped. Do you see the calendar when Clickable = false?


LL Lokesh Luthra July 28, 2004 06:12 AM

Okiee Clay I am refrasing my Question.I have a grid cell and I set the grid(1,1).celltype = "calendermonth".Now when I click on the cell I get the calender in front of me I selected one date from the calender and its there in the textbox(the calender control).Now the problem I can click inside that cell and I can enter "Lokesh Luthra" WHICH ACTUALLY IS NOT AT ALL ACCEPTABLE .sO HOW i CAN STOP USER TO ENTER IN TO THE CELL THE TYPE OF WHICH IS MONTHCALENDER REGARDS lOKESH


AD Administrator Syncfusion Team July 28, 2004 07:30 AM

To validate a cell value, there are several options. If you set grid(1,1).CellValueType = GetType(DateTime), then the grid will display a message as your user tries to leave the cell with something invalid. If you want to control things yourself, and not rely on the grid to display the message, then handle the CurrentCellValididating event. In your handler, get the new string from grid.CurrentCell.renderer.ControlText, and check it to see if it is something you want in the cell. If no, set e.cancel = true. This event will be hit as you leave the cell. If you want to try validating on each keystroke, you can use the CurrentCellValidateString method.

Loader.
Live Chat Icon For mobile
Up arrow icon