Home All Groups Group Topic Archive Search About
Author
18 Mar 2005 9:59 PM
JIM.H.
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.

Author
18 Mar 2005 10:22 PM
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:

<asp:BoundColumn ReadOnly="true"></asp:BoundColumn>

> 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.

-Brock
DevelopMentor
http://staff.develop.com/ballen
Are all your drivers up to date? click for free checkup

Author
21 Mar 2005 2:17 PM
JIM.H.
thanks, DataFormatString="{0:MM/dd/yyyy}"  worked.

Show quoteHide quote
"Brock Allen" wrote:

> > 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:
>
> <asp:BoundColumn ReadOnly="true"></asp:BoundColumn>
>
> > 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.
>
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>
>
>
>
Author
21 Mar 2005 1:47 PM
JIM.H.
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.

Show quoteHide quote
"Brock Allen" wrote:

> > 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:
>
> <asp:BoundColumn ReadOnly="true"></asp:BoundColumn>
>
> > 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.
>
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>
>
>
>
Author
21 Mar 2005 5:41 PM
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.

-Brock
DevelopMentor
http://staff.develop.com/ballen



Show quoteHide quote
> 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.
>
> "Brock Allen" wrote:
>
>>> 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:
>>
>> <asp:BoundColumn ReadOnly="true"></asp:BoundColumn>
>>
>>> 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.
>>
>> -Brock
>> DevelopMentor
>> http://staff.develop.com/ballen

Bookmark and Share