473,327 Members | 2,012 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Datagrid.columns

Hi, I am seeking out information on working with 'columns' in code.
for instance I have a column on a datatable that is of type boolean.
In code I wish to test to see if that column is true or false.

I think typing the code:

if ( datagridname.columns[columnname] = true) do something

would work, but it give a compile error.

How should I handle trying to test a boolean value in code?

Thanks!!!

Oct 5 '07 #1
2 1130
On Oct 5, 9:32 am, Soulless <dgmsal...@gmail.comwrote:
Hi, I am seeking out information on working with 'columns' in code.
for instance I have a column on a datatable that is of type boolean.
In code I wish to test to see if that column is true or false.

I think typing the code:

if ( datagridname.columns[columnname] = true) do something

would work, but it give a compile error.

How should I handle trying to test a boolean value in code?

Thanks!!!
If I enter:

dataGridDaemons.Rows.Add();

no row is added. Any ideas?

I understand that I am better off adding the row programatically
through the datatable. Any ideas on that?

Oct 5 '07 #2
Hi,

"Soulless" <dg*******@gmail.comwrote in message
news:11*********************@g4g2000hsf.googlegrou ps.com...
Hi, I am seeking out information on working with 'columns' in code.
for instance I have a column on a datatable that is of type boolean.
In code I wish to test to see if that column is true or false.

I think typing the code:

if ( datagridname.columns[columnname] = true) do something

Please clarify, you first talk about datatable and then later about a
DataGrid.

In any case you will have to cast from object (that is the type you get from
getting a value) to bool:

if ( true == (bool)DataTable.Rows[0][["columnname"] )
Oct 5 '07 #3

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

Similar topics

0
by: Reb | last post by:
I am using a datagrid within another datagrid. My second datagrid is expand/collapse one. I am facing some error. This is my code. ExpandGrid.aspx <form id="Form1" method="post"...
2
by: Josef Meile | last post by:
Hi, I'm using a ComboBox, some Textboxes, and a DataGrid to represent a many-to-many relationship between Person and Course. Each time that I change the value in the ComboBox (which for now is...
1
by: Amber | last post by:
The DataGrid allows you to make columns visible or invisible on demand - even edit and other special columns. This article will show you how it is done. Some developers have reported problems...
3
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that...
4
by: tshad | last post by:
I am having trouble with links in my DataGrid. I have Links all over my page set to smaller and they are consistant all over the page in both Mozilla and IE, except for the DataGrid. Here is a...
2
by: CSL | last post by:
I am using the DataGrid in a Windows Application, how can I adjust the widths of each column individually.
7
by: CanoeGuy | last post by:
I have been trying for the last two weeks to display a dynamic DataGrid. The data that I'm pulling from a SQL Server DB will have whole columns that will be either NULL or 0. I want to display...
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. -- .....
7
by: Arpan | last post by:
Assume that a database table has the following 4 columns - ID, UserID, Subject & Marks. I am retrieving the records existing in this DB table & displaying them in a DataGrid like this: <script...
3
by: rn5a | last post by:
A SqlDataReader is populated with the records from a SQL Server 2005 DB table. The records retrieved depends upon 2 conditions (the conditions depend on what a user selects in an ASPX page). If...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.