Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / August 2007

Tip: Looking for answers? Try searching our database.

How to create DataGrid column parser?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
olek - 30 Aug 2007 17:02 GMT
In my .net application I use Windows.Forms.DataGrid bound to the datasource
to dispaly database contents. The bounding is done with GridColumnStyle and
its  property MappingName which is associated with the name of a DataTable
column. Moreover the Format property of GridColumnStyle is set to "c2" to
dispaly numeric values as currency. It works fine however only in one
direction when the data is beeing displayed in the grid. The troubles start
when I want to input data via this grid. I can not just change the value in
the cell because it has currency suffix. It is necessary to remove the suffix
and then value passes validation and it is stored in the DataTable. When I am
working with a simple control (e.g. TextBox) I can modify its Binding and add
a parser. In case of DataGrid I can not get to the Binding. The
BindingContext property of the DataGrid is empty when columns are created.
Could you please suggest how to add a parser to DataGrid control column to
accept "c2" numeric values?
ClayB - 30 Aug 2007 17:55 GMT
Here is a Microsoft KB that discusses one way to format column
contents in a DataGrid (though not through a parser).

http://support.microsoft.com/default.aspx?scid=kb;en-us;Q318581

====================
Clay Burch
Syncfusion, Inc.
olek - 30 Aug 2007 22:00 GMT
Tanks. Though I prefer C# the sample code from KB in VisualBasic is very
helpful.

   A.Kniat

> Here is a Microsoft KB that discusses one way to format column
> contents in a DataGrid (though not through a parser).
[quoted text clipped - 4 lines]
> Clay Burch
> Syncfusion, Inc.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.