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

How add row to grid bound to IEnumerable(Of Employee)?

Hi,

I have a grid (Infragistics UltraGrid but I don't think that matters) that
is bound to data source IEnumerable(Of Employee).

How do I add a row to the grid (i.e. to the underlying data source, I
suppose?

I';m used to my data sources being DataTable so easy. Not sure what to do
here.

Thanks,
Ron

Jun 27 '08 #1
1 3146
Ronald S. Cook wrote:
Hi,

I have a grid (Infragistics UltraGrid but I don't think that matters)
that is bound to data source IEnumerable(Of Employee).

How do I add a row to the grid (i.e. to the underlying data source, I
suppose?

I';m used to my data sources being DataTable so easy. Not sure what to
do here.

Thanks,
Ron
IEnumerable is a data *source*, not something that you can reliably add
data to. Of course, the object might actually be a List<Employeeor
similar, but unless you know the underlying type (and know that it won't
change at runtime), I would avoid attempting to add something.

Instead, add data to a new List<Employeeand bind to this new list,
which you can easily manipulate:

List<Employeelist = new List<Employee>(enumerable);
grid.DataSource = list;

--
Lasse Vågsæther Karlsen
mailto:la***@vkarlsen.no
http://presentationmode.blogspot.com/
PGP KeyID: 0xBCDEA2E3
Jun 27 '08 #2

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

Similar topics

3
by: Kenneth | last post by:
Hello all, I'm trying to do some form validation on a form that collects its data into a multidimensional array, and on submitting that re-writes the values as hidden form elements (a form that...
1
by: Rhiner Dan | last post by:
Here are the errors from my Dev-c compiler //////////////////////////////////////////////////////////////////////////// Building Makefile: "C:\Dev-Cpp\Makefile.win" Executing make... make.exe...
1
by: Ike | last post by:
Does anyone here remember how to discern the upper bound of an array in asp, pre-.NET ? Thanks, Ike
6
by: Tom | last post by:
I need to make up a 'grid' of controls at run time. The controls (of which I wrote) I will instantiate, then I need to arrange these in a row/column layout. For example, let's say I instantiate 20...
1
by: Manuel Canas | last post by:
Hi There, I have been batleing with this now that I'm at the end of my rop here. What I'm doing here is this; 1 - retrieving some data from the database with a data reader (with a search...
4
by: Mark Gibson | last post by:
Hi, I've been playing about with array's, and found the concat operator '||' quite useful, apart from the fact that prepending an element places it in a lower subscript. Is there a way of...
0
by: p.mc | last post by:
Hi all, I'm writing a database to hold images with captions, keywords etc. I want to provide a search results page which will display a thumbnail and title for each image. I've achieved this...
4
by: parez | last post by:
Hi All, is there anyway i can take collection(IEnumerable) of a particular type as a paramter for a function. Thanks in advance.
2
by: Claudia Fong | last post by:
Hi, How can I create a grid of 20 Columns by 30 Rows using asp.net? Cheers! Claudi *** Sent via Developersdex http://www.developersdex.com ***
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
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.