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.

New and need some help on basic problem.

Thread ID:

Created:

Updated:

Platform:

Replies:

24663 Feb 8,2005 06:50 PM Feb 9,2005 08:26 PM Windows Forms 3
loading
Tags: GridControl
Jennifer Morgret
Asked On February 8, 2005 06:50 PM

I am new to SyncFusion and after looking around awhile I did not see a straightforward way of doing what seems to be a simple thing. I need to know how to set a cell to accept numeric data and set a specific range say 0 to 100 with 2 decimal places. I don''t need the decimal to show without typing it but if it does that is fine. I would also like to have a cell accept a date 01/01/2001 and set a range of min and max for the date 01/01/1970 - 01/01/2050. I would like the / to show in the cell. I was able to use the editmask for the date but didn''t know how to get the range set. Do I need to handle that in a validation event? I was not able to get the numeric cell working with the number of digits and decimal places that I wanted. Suprisingingly the thing I thought would be the most difficult, added a dropdown to a cell, was the easiest. Any help would be appreciated. Thank you, Jennifer

Administrator [Syncfusion]
Replied On February 8, 2005 08:00 PM

Hi Jennifer, for a numeric cell with 2 digits you can set GridStyleInfo.CellValueType = typeof(double); and GridStyleInfo.Format = "0.00"; this works with the regular textbox cell type. The validation of the text can happen either when the user leaves the cell (CurrentCellValidating) or while the user types text (CurrentCellValidateString) into the cell. Regarding the date validation. Yes, that should be handled in the CurrentCellValidating event. Just set e.Cancel = true if you do not want to accept the data. Optionally you can set grid.CurrentCell.ErrorMessage. Stefan >I am new to SyncFusion and after looking around awhile I did not see a straightforward way of doing what seems to be a simple thing. > >I need to know how to set a cell to accept numeric data and set a specific range say 0 to 100 with 2 decimal places. I don''t need the decimal to show without typing it but if it does that is fine. > >I would also like to have a cell accept a date 01/01/2001 and set a range of min and max for the date 01/01/1970 - 01/01/2050. I would like the / to show in the cell. > >I was able to use the editmask for the date but didn''t know how to get the range set. Do I need to handle that in a validation event? I was not able to get the numeric cell working with the number of digits and decimal places that I wanted. Suprisingingly the thing I thought would be the most difficult, added a dropdown to a cell, was the easiest. > >Any help would be appreciated. > >Thank you, > >Jennifer

Jennifer Morgret
Replied On February 9, 2005 07:02 PM

Thanks. That helps. The only problem I still have is that I might have two double cells, one Day of Year (1-365) and the other Number Of Items (0-999999). Although they are different cells they are both going to the same validation event and I don''t really have a way to distinguish which range to use in validation. I guess I will have to look at the identifier cell next to the input cell first. If you have any suggestions let me know. Thanks again. Jennifer

Administrator [Syncfusion]
Replied On February 9, 2005 08:26 PM

Just check grid.CurrentCell.RowIndex and grid.CurrentCell.ColIndex. Stefan >Thanks. That helps. The only problem I still have is that I might have two double cells, one Day of Year (1-365) and the other Number Of Items (0-999999). Although they are different cells they are both going to the same validation event and I don''t really have a way to distinguish which range to use in validation. I guess I will have to look at the identifier cell next to the input cell first. If you have any suggestions let me know. > >Thanks again. > >Jennifer

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.

;