473,465 Members | 1,960 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Q: DataGrid data format

Hello,
In my DataGrid, I used DataFormatString="{0:d}" for a float type field, it
gave me error.
How can I force user type a float number in a cell? I also need to force
user to type only one character in another cell, is it possible?
Thanks,
Jim.

Nov 19 '05 #1
3 1257
JV
Assuming you mean ASP.NET datagrid, keep in mind that web applications
typically don't work identically to windows applications. Usually the user
enters their data and validation is performed all at once when some sort of
submit button is clicked. Yeah, not as nice a UI as windows, but it can be
quite a challenge to achieve the same kind of UI on a web page.

If you really want that, you will probably need to create some validator
objects in your EditItemTemplate, or write some client-side javascript of
your own.

"JIM.H." <JI**@discussions.microsoft.com> wrote
Hello,
In my DataGrid, I used DataFormatString="{0:d}" for a float type field, it
gave me error.
How can I force user type a float number in a cell? I also need to force
user to type only one character in another cell, is it possible?
Thanks,
Jim.

Nov 19 '05 #2
Thanks for the reply,
How should I set validator for a cell in the datagrid, can you give me an
example?
Thanks,
Jim.

"JV" wrote:
Assuming you mean ASP.NET datagrid, keep in mind that web applications
typically don't work identically to windows applications. Usually the user
enters their data and validation is performed all at once when some sort of
submit button is clicked. Yeah, not as nice a UI as windows, but it can be
quite a challenge to achieve the same kind of UI on a web page.

If you really want that, you will probably need to create some validator
objects in your EditItemTemplate, or write some client-side javascript of
your own.

"JIM.H." <JI**@discussions.microsoft.com> wrote
Hello,
In my DataGrid, I used DataFormatString="{0:d}" for a float type field, it
gave me error.
How can I force user type a float number in a cell? I also need to force
user to type only one character in another cell, is it possible?
Thanks,
Jim.


Nov 19 '05 #3
Jim:

Have you looked at using ASP.NET validation controls?

http://support.microsoft.com/default...b;en-us;316662

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Thu, 7 Apr 2005 12:23:04 -0700, JIM.H.
<JI**@discussions.microsoft.com> wrote:
Hello,
In my DataGrid, I used DataFormatString="{0:d}" for a float type field, it
gave me error.
How can I force user type a float number in a cell? I also need to force
user to type only one character in another cell, is it possible?
Thanks,
Jim.


Nov 19 '05 #4

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

Similar topics

3
by: Zürcher See | last post by:
Someone has implemented a Datagrid Button for the Windows.Form?
7
by: Matthew Wieder | last post by:
Hi - I have a datagrid that has a black header and the rows alternate white and gray. The problem is that until items are added to the grid, the grid appears as a large black rectangle, which is...
1
by: J.B | last post by:
I have a datagrid that will display different datasets, (it runs different sprocs based on a value in the querystring) but it will always return 6 columns. The 5th and 6th columns are always Date...
4
by: yer darn tootin | last post by:
Does anyone know the sort expression for a column that's data has been returned in the format, eg '07 Jul 05'?? The sort expression {..:"dd mmm yy"} doesn't work ( if the column was returned as...
4
by: hope | last post by:
Hi, How can I format a string field using Data Formatting Expression property in datagrid? For example: format last name from BROWN to Brown. Thanks
1
by: jimb | last post by:
I can get the dropdownlist into the datagrid, and I can populate it, but I can't read it. Anybody have a working example of a dropdownlist in an editable grid? Thanks. -- .....
6
by: Agnes | last post by:
I understand it is impossible, but still curious to know "Can I freeze several column in the datagrid, the user can only scroll the first 3 columns (not verical), for the rest of the coulumn, it is...
2
by: Gummy | last post by:
Hello All, I have a webpage that has two dropdown listboxes. Based on what is selected in these dropdown listboxes, it filters a DataGrid . That works fine. In the DataGrid , when I go to edit...
0
by: | last post by:
I have a question about spawning and displaying subordinate list controls within a list control. I'm also interested in feedback about the design of my search application. Lots of code is at the...
0
by: webaccess | last post by:
Hi Friends ..!! I want to use datagrid/dataview control to data in tablular format,also I want to add paging and format the data of table column. Problem is data is coming from API Dom in as...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.