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.
Unfortunately, activation email could not send to your email. Please try again.

Cell type !!

Thread ID:





16943 Jul 27,2004 11:58 PM Jul 28,2004 07:30 AM Windows Forms 5
Tags: GridControl
Lokesh Luthra
Asked On July 27, 2004 11:58 PM

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

Administrator [Syncfusion]
Replied On 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

Lokesh Luthra
Replied On 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

Administrator [Syncfusion]
Replied On 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?

Lokesh Luthra
Replied On 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

Administrator [Syncfusion]
Replied On 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.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.