473,322 Members | 1,522 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Writing a Date in DataGrid cell

hello i'm writing a C# windows application and i dataGrid which contains
Kinds of Payment and one of the cells is a Payment Date witch the user is
entering and i want that after entering 2 numbers automaticy a "/" will
appear so the user won't have to enter it by it self. i manged to do it in a
simple text box but couldn't do it in my dataGrid.
for example i want that if the user entered 12 so a "/" will be written and
then the user entered 03 another "/" will appear and then the user will enter
the year 04 so at the end it will be written 12/03/04.

how can i do it????

thanks...
Nov 16 '05 #1
2 1273
guy
Hi
This is quite simple,you have to catch event of cell changed and check the
text so far,if there are 2 digits for the day so put / and the others the
same.

"Gidi" wrote:
hello i'm writing a C# windows application and i dataGrid which contains
Kinds of Payment and one of the cells is a Payment Date witch the user is
entering and i want that after entering 2 numbers automaticy a "/" will
appear so the user won't have to enter it by it self. i manged to do it in a
simple text box but couldn't do it in my dataGrid.
for example i want that if the user entered 12 so a "/" will be written and
then the user entered 03 another "/" will appear and then the user will enter
the year 04 so at the end it will be written 12/03/04.

how can i do it????

thanks...

Nov 16 '05 #2
hi guy,
it's not so simple. i tried it and while you are still at the same cell the
text is empty, only when you leave the cell the data is changing.

how can i do it???

"guy" wrote:
Hi
This is quite simple,you have to catch event of cell changed and check the
text so far,if there are 2 digits for the day so put / and the others the
same.

"Gidi" wrote:
hello i'm writing a C# windows application and i dataGrid which contains
Kinds of Payment and one of the cells is a Payment Date witch the user is
entering and i want that after entering 2 numbers automaticy a "/" will
appear so the user won't have to enter it by it self. i manged to do it in a
simple text box but couldn't do it in my dataGrid.
for example i want that if the user entered 12 so a "/" will be written and
then the user entered 03 another "/" will appear and then the user will enter
the year 04 so at the end it will be written 12/03/04.

how can i do it????

thanks...

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Emerson | last post by:
The following assumes a System.Windows.Forms.DataGrid with a System.Data.DataTable set as the DataSource. I'm programming in C# Here's my scenario I click in a cell on a DataGrid. I enter some...
7
by: Mike L | last post by:
This is for a Win form. SP sends back the PostMark date to my datagrid, shows proper date in datagrid. When user clicks on datagrid, the code sends the current row to text box. The text box...
2
by: Daniel Walzenbach | last post by:
Hi, I created an ASP.NET Datagrid where a single row can be selected by clicking anywhere on the row (according to...
1
by: strout | last post by:
I know it's dumb ... sometimes frustrating I want the text and a dropdownlist align with both side of a table cell, i.e. text align left and dropdownlist align right. I cannot add more cells to...
4
by: Suzanne | last post by:
Hi all, I'm having problems with datagrids and the currentcellchanged event. My problem is this: I have a datagrid on a form, if the user changes the text in a cell on the datagrid then tries to...
4
by: tg | last post by:
Visual Studio 2003 My problem is that I am dynamically creating a datagrid on pageload. The datagrid is completely dynamic as it is based on the number of columns returned from a recordset. The...
13
by: pmcguire | last post by:
I have a DataGrid control for which I have also created several new extended DataGridColumnStyles. They behave pretty nicely, but I can't figure out how to implement Selected Item formatting for...
0
by: henk | last post by:
Hi, In my datagrid, a date time picker becomes visible when a user navigates to eg column 3. (with CurrentCellChanged and datetimepicker1.AddReqInfo.Visible = True) This works fine BUT: When I...
3
by: Jim in Arizona | last post by:
I have a gridview that's being populated from an access db query. The problem I'm having is that the date/time fields in access that are populating the gridview are showing both date and time, when...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.