473,801 Members | 2,513 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

datagridview column names

I have a datagridview that was created by dragging an SQL stored procedure
onto the form. The SQL query has fields for Monday, Tuesday, etc.

I am trying to set some of the values with the DefaultValuesNe eded event.
When I right click on the control and select Edit Columns I can see a column
that appears to be named Monday.

The code is:
private void spApplicantMeal ListDataGridVie w_DefaultValues Needed(object
sender, DataGridViewRow EventArgs e)
{
e.Row.Cells[9].Value = ThisClientId;
e.Row.Cells["Monday"].Value = 0;
}

When I run the program I get an error: {"Column named Monday cannot be
found.\r\nParam eter name: columnName"}

I go into Edit columns and Click on Add new column and select Monday as a
DataBound column. I add the column and then I see two columns that appear to
be named Monday. I run the program and then it works and shows the correct
data in both of the columns!! I can delete the original column and it works
correctly from then on.

Why? What are the default names for the columns?
Jul 25 '07 #1
0 3583

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

Similar topics

2
9687
by: David Veeneman | last post by:
How can I set a bound DataGridView control to use a dataset table's column captions, instead of column names? I'm working with a DataGridView control, which I have bound to a table in a dataset. The dataset is created at run time, so I don't know column headers in advance. The table's column captions are set at run time, using the DataColumn.Caption property. The table is bound to the grid using the grid's DataSource property. Here is my...
4
10086
by: Aaron Smith | last post by:
Ok, this is an odd one, but I could use some assistance with the framework 2 in VB.Net... I want to have a DataGridViewColumn, only have it use the ComboBox, then when they drop down the combobox, open up another datagridview instead of the combobox dropdownlist. The reason I want to do this, is so I can show more than one column at a time in the drop down list. Instead of trying to make a multi-column combo, I thought it would be much...
3
94276
by: sklett | last post by:
I'm changing from a DataGrid to a DataGridView and have run across a problem. The items that are bound to the DataGrid have an int Property that represents a primary key of a lookup table in my database. For example: table JobTypes 1 | Manager 2 | Controller 3 | Supervisor table Employee
0
1226
by: hangdee | last post by:
I want to create 2 same structure datagridview in a form. But when I set same column name in datagridview, it prompts that same name is used by another component. So is it true that we cannot have same column names for 2 datagridview in the same form? I have a function to format the 2 datagridviews, so I cannot use column names to refer?
0
1338
by: Leanne | last post by:
I created a datagridview with two columns. The first column is textboxColumn (CategoryID), second one is a DataGridViewComboBoxColumn, call it "name". I hope the name column will only display all the names related to the CategoryID, not all the names from the table. I have two datasource, dsCategoryID contains all the Category IDs from database, dsName contains all the names for all the Category IDs. The "name" column has the following...
2
6385
by: sajjeelhassan | last post by:
hi can any one tell i found a problem ...while during work on datagridview checkbox is in the 2nd column of the datagridview having header "REGISTER" and a textbox in the 1st column of the datagridview having header "NAME"... i want to select those names whome corresponding checkbox is checked..
3
215
by: =?Utf-8?B?VHJlY2l1cw==?= | last post by:
Hello, Newsgroupians: I'm creating a control derived from DataGridView. I'd like the user to click a row and have the row highlight in yellow. I'd then like the user to click a column and have the column highlight in yellow. Where the row and column intersect, I'd like the cell to take on a red color. It's synonymous to a grid matrix for many maps... EXA: How many miles from one city to another:
4
2378
by: =?Utf-8?B?anAybXNmdA==?= | last post by:
I use unbound DataGridView controls in my form (simply because I have to manually message my data before populating the DataGridView with it). Say I clear all the info from the DataGridView: DataGridView1.Columns.Clear() Now I manually add new columns to fill: DataGridView1.Columns.Add("Date_Time", "Date_Time")
2
1230
by: sreenu123 | last post by:
Hi I already bind a DataGridView to a databse. My DataGridView is showing column names as it is in the table. I want to show user-friendly column names in the grid instead of column names in the database table. Please help me in this reagard. Thanx in advance
0
9698
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10298
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10277
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10055
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9105
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5489
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4265
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 we have to send another system
2
3785
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.