Q: DataGrid during edit

G

Guest

Hello,
I am editing my table through DataGrid, two questions:
1. when I click edit it enable to edit all the fields on the screen, can I
disable a few of them for editing.
2. Is it possible to format date and number in the datagrid?
Thanks,
Jim.
 
B

Brock Allen

1. when I click edit it enable to edit all the fields on the screen,
can I
disable a few of them for editing.

Yes, set:

2. Is it possible to format date and number in the datagrid?

<asp:BoundColumn DataField="Column" DataFormatString="{0:C}"></asp:BoundColumn>

Where DataFormatString specifies essentially how you want ToString for that
column to be formatted.
 
G

Guest

can you be more specific about DataFormatString, I need to show dd/MM/yyyy, I
just check it quickly, I could not figure out quickly.
 
B

Brock Allen

Check the docs on DateTime.ToString() -- the version that allows you to pass
a format parameter. It explains the different strings to pass to control
the date time formatting.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top