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 / February 2006

Tip: Looking for answers? Try searching our database.

Determining the Type for a datagrid column

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mh1mark - 15 Feb 2006 15:58 GMT
I have a datagrid with several columns.  When trying to validate the column
by looping through each column in the collection using a subscript I need to
first determine whether the column is defined as a string or an integer.  Is
there a function that will allow me to do this?  Note that the column types
and data remain the same.  I just need to know whether the column is defined
as a string or integer to decide what validations to  do.

Example:

       Dim r As DataRow
       Dim cols As DataColumnCollection
       Dim c As DataColumn
       cols = dstable1.Tables("Table1").Columns
       
       For Each r In dstable1.Tables("Table1").Rows
           For Each c In cols
               If r(c, DataRowVersion.Current)   ??? is string or integer  
???
                        do something
           next c
       next r

thanks
Morten Wennevik - 15 Feb 2006 18:55 GMT
Hi mh1mark

Would you by any chance be looking for the DataColumn.DataType property?

> I have a datagrid with several columns.  When trying to validate the column
> by looping through each column in the collection using a subscript I need to
[quoted text clipped - 18 lines]
>
> thanks

Signature

Happy coding!
Morten Wennevik [C# MVP]


Rate this thread:







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.