|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Q: DataGrid during editHello,
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. > 1. when I click edit it enable to edit all the fields on the screen, Yes, set:> can I > disable a few of them for editing. <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 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 > > > > > 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 > > > > > 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
Other interesting topics
FCKeditor implementation in ASP.NET
IndexOutOfBounds on databinding aspNetEmail with Asp.net Problems with Update and MySqlDataAdapter System.NullReferenceException raised on site Required field validator Problem with databinding expression Arrays and DataReader link on datagrid DirectorySearcher - whats wrong with this?! |
|||||||||||||||||||||||