473,382 Members | 1,225 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,382 software developers and data experts.

LINQ With DataGridView In C#

Hello

In C# I am trying to populate a grid view with a result of a LINQ Query as follows:

dc stands for DataContext

var ItemList = (from items in dc.Products
select new { items.ItemCode, items.ItemName });
dataGridView1.DataSource = ItemList;

(dc stands for DataContext)

It works fine, however I cannot modify the values in the gird sine the value are read only, what am I missing to be able to edit the values?
Mar 18 '08 #1
0 1229

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: =?Utf-8?B?VmFuZXNzYQ==?= | last post by:
I want to develop a datagridview allowing column selection and filtering, like this: http://www.codeproject.com/KB/grid/GridFilter.aspx This example is using dataset. My question is if: a) I...
15
by: EDBrian | last post by:
My problem is this. Our clients create different fields they want to collect and we allow them build dynamic filters, reports etc... We run some TSQL to actually create the column and all works...
0
by: =?ISO-8859-1?Q?S=F8ren_Reinke?= | last post by:
Hi there. I am trying to get to know LINQ in combination with a bindingsource and a datagridview. In the framework we have at work we have created a usercontrol to do filtering via...
1
by: Lacutas | last post by:
Hi I'm having some problems getting a dynamic LINQ query to work on my DataSet. The idea is that a user selects certain criteria, and then the LINQ query filters through the dataset making the...
18
by: Andrus | last post by:
Marc, Thank you very much. I have issue on implementing add row properly using this. User presses down arrow in last row in grid starting adding new row. Then user changes its mind desiding...
1
by: Arved Sandstrom | last post by:
This seems to be something so simple that none of the hundred-odd tutorials and forum threads that I have looked at (:-)) apparently thinks it's a problem. In a nutshell, I have two...
2
by: =?Utf-8?B?anVsaW8=?= | last post by:
I am trying to use Update to save changes made on two DataGridView's to two tables (Posts & PostDetails) with a FK relationship. I say private void bUpdate_Click(object sender, EventArgs e) {...
3
by: Vivien Parlat | last post by:
Hello, I am currently using VB.Net 2008 express. I use linq to perform queries on a database, and I'm using the following link's source to convert those queries into DataTables i can then bind...
13
by: Dan Tallent | last post by:
I have a query which I would like to convert to LINQ. I am having problems finding good examples or references that cover more complex queries. Here is the SQL command I would like to rewrite...
0
Sepidar
by: Sepidar | last post by:
hi, I have a DataGridView on my winform linked to a BindingSource linked to a Linq to SQL class. My problem is when I update my underlying class, the BindingSource will not notified and my...
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...
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
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.