datepicker in datagridview

naresh

Active member
Joined
Jul 4, 2006
Messages
38
Programming Experience
1-3
I have 2 Questions regarding DataGridView
1. How can i keep dollar symbol and give the validation not entering the text data. I think the question is clear.
eg : $455 is right
$a33 is wrong
if i enter 334 it should automatically come $334

------------------------------------------

2. I want one column of the datagridview to be datepicker.


Thanks in advance
Naresh
 
Please make the effort to post in the most appropriate forum, not just the forst one you come to. VS.NET General is for general questions regarding the IDE. This is a Windows Forms question and thus belongs in the Windows Forms forum. Moved.

There is no property of the column itself that will set a currency format. You'd have to handle the CellValidating event of the grid and, if the current column is your currency column, validate the value using Decimal.TryParse, which allows you to specify a number format that can include currency.

There is no standard column type for the DateTimePicker. You can create your own column types to support any control you like. Microsoft provide an example of doing this and, fortunately for you, the control they use for the example is the DTP.

http://msdn2.microsoft.com/en-us/library/7tas5c80.aspx
 
Thanks both the solutions worked for me.
Sorry for posting in the inappropriate Place. this doesnt happen from next time. Any how thanks once again
Naresh
 
Back
Top