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.

MonthCalender cell in Grid

Thread ID:

Created:

Updated:

Platform:

Replies:

71063 Jan 14,2008 06:34 AM Jan 14,2008 12:20 PM Windows Forms 1
loading
Tags: Tools
sunitha
Asked On January 14, 2008 06:34 AM

Hi,

I have attached my code here. I have MonthCalender cell in my grid now i have to restrict the user from entering the text in this cell.
I have tried with different dropdownstyles but it's not working.Can you please suggest me the better solution.

Thanks






MonthCalender.zip

Jeba S [Syncfusion]
Replied On January 14, 2008 12:20 PM

Hi Sunitha,

If you want to avoid your user entering the text in MonthCalender cell, then you can try using CurrentCellValidateString. This event is hit keystroke by keystroke and you can test e.Inner.Text to see if it is something you want to accept.

Below is the code snippet:

private void gridGroupingControl1_TableControlCurrentCellValidateString(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCurrentCellValidateStringEventArgs e)
{
GridCurrentCell cc = this.gridGroupingControl1.TableControl.CurrentCell;
if(cc.RowIndex >=4 && cc.ColIndex == 3)
{
try
{
DateTime dt = DateTime.Parse(e.Inner.Text);
}
catch
{
e.Inner.Cancel = true;
}
}
}

Please refer to the below KB article for more details on Validation of a cell.
http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=340

Kindly let us know if you need any further assistance.

Regards,
Jeba.



CONFIRMATION

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.

;