How can I manually add rows to datagridview.

Hello.
What is the elegant way to add rows to datagridview that is bounded to 
bindingSource object.
(Only manually. I need sample code, please).

Thanks :) 

0
Mr
5/20/2010 3:46:54 PM
dotnet.languages.vb 830 articles. 0 followers. Follow

5 Replies
1421 Views

Similar Articles

[PageSpeed] 2

Mr. X. wrote:
> Hello.
> What is the elegant way to add rows to datagridview that is bounded to 
> bindingSource object.
> (Only manually. I need sample code, please).
> 
> Thanks :)

You would add new items to the object, if the object was a collection of 
objects as an example were being bounded and rebind the object.
0
Mr
5/20/2010 9:16:45 PM
I think when I use bounded component - it is too complicated to handle it 
manually,
so maybe I should give up, and use unbounded datagridView.

Thanks :)

"Mr. Arnold" <Arnold@Arnold.com> wrote in message 
news:OLMnDHG#KHA.4816@TK2MSFTNGP02.phx.gbl...
> Mr. X. wrote:
>> Hello.
>> What is the elegant way to add rows to datagridview that is bounded to 
>> bindingSource object.
>> (Only manually. I need sample code, please).
>>
>> Thanks :)
>
> You would add new items to the object, if the object was a collection of 
> objects as an example were being bounded and rebind the object. 

0
Mr
5/21/2010 4:27:44 AM
Also, I have heard of linq - don't know much about it.
Is linq a good solution ?

"Mr. X." <nospam@nospam_please.com> wrote in message 
news:u4V143J#KHA.5808@TK2MSFTNGP02.phx.gbl...
> I think when I use bounded component - it is too complicated to handle it 
> manually,
> so maybe I should give up, and use unbounded datagridView.
>
> Thanks :)
>
> "Mr. Arnold" <Arnold@Arnold.com> wrote in message 
> news:OLMnDHG#KHA.4816@TK2MSFTNGP02.phx.gbl...
>> Mr. X. wrote:
>>> Hello.
>>> What is the elegant way to add rows to datagridview that is bounded to 
>>> bindingSource object.
>>> (Only manually. I need sample code, please).
>>>
>>> Thanks :)
>>
>> You would add new items to the object, if the object was a collection of 
>> objects as an example were being bounded and rebind the object.
> 
0
Mr
5/21/2010 4:34:25 AM
Add rows to your bindingsourse.

In fact that is all.


"Mr. X." <nospam@nospam_please.com> wrote in message 
news:ObZ7uOD#KHA.148@TK2MSFTNGP06.phx.gbl...
> Hello.
> What is the elegant way to add rows to datagridview that is bounded to 
> bindingSource object.
> (Only manually. I need sample code, please).
>
> Thanks :) 

0
Cor
5/21/2010 6:13:33 AM
"Mr. X." <nospam@nospam_please.com> wrote in message 
news:OP6io7J%23KHA.5164@TK2MSFTNGP02.phx.gbl...
> Also, I have heard of linq - don't know much about it.
> Is linq a good solution ?
>

Yes Linq is a good solution. However, using Linq is about using objects and 
OOP, which will force a change in your thinking on how develop .NET 
solutions. I'll give you my spill on it, because the key to learning .NET is 
do you understand OOP and how to use OOP.


What is Object-oriented-programming?

 (OOP) is a programming paradigm that uses "objects" and their interactions 
to design applications and computer programs.

The key concepts of OOP are the following:

Class

Object

Instance

Method

Message passing

Inheritance

Abstraction

Encapsulation

Polymorphism

Decoupling



http://en.wikipedia.org/wiki/Object-oriented_programming

No matter what development platform Java,  .Net or others  OOP is OOP.

http://math.hws.edu/eck/cs124/downloads/OOP2_from_Univ_KwaZulu-Natal.pdf

http://www.blackwasp.co.uk/ObjectOrientedConcepts.aspx


What are design patterns?

Design patterns are recurring solutions to software design problems you find 
again and again in real-world application development. Patterns are about 
design and interaction of objects, as well as providing a communication 
platform concerning elegant, reusable solutions to commonly encountered 
programming challenges.

 http://www.developer.com/design/article.php/1502691

http://www.dofactory.com/Patterns/Patterns.aspx

http://computerprogramming.suite101.com/article.cfm/patterns_and_antipatterns

http://msdn.microsoft.com/en-us/library/ms954638.aspx

http://www.designpatternsfor.net/Presentations.aspx?tid=3&cid=4

What is Object Relational Mapping?

(ORM) is a programming technique for converting data between incompatible 
type systems in relational databases and object-oriented programming 
languages. This creates, in effect, a "virtual object database," which can 
be used from within the programming language. There are both free and 
commercial packages available that perform object-relational mapping, 
although some programmers opt to create their own ORM tools.

http://en.wikipedia.org/wiki/O-RM

http://www.objectmatter.com/vbsf/docs/maptool/ormapping.html

 What is Language Integrated Query?

 LINQ is a Microsoft .NET Framework component that adds native data querying 
capabilities to .NET languages.

Microsoft LINQ defines a set of query operators that can be used to query, 
project and filter data in arrays, enumerable classes, XML, relational 
database, and third party data sources. While it allows any data source to 
be queried, it requires that the data be encapsulated as objects. So, if the 
data source does not natively store data as objects, the data must be mapped 
to the object domain. Queries written using the query operators are executed 
either by the LINQ query processing engine or, via an extension mechanism, 
handed over to LINQ providers which either implement a separate query 
processing engine or translate to a different format to be executed on a 
separate data store (such as on a database server as SQL queries). The 
results of a query are returned as a collection of in-memory objects that 
can be enumerated using a standard iterator function such as C#'s foreach.

Many of the concepts that LINQ has introduced were originally tested in 
Microsoft's C? research project. LINQ was released as a part of .NET 
Framework 3.5 on November 19, 2007.

http://en.wikipedia.org/wiki/Language_Integrated_Query

 What is Linq-to-SQL?

LINQ to SQL, a component of Visual Studio Code Name "Orcas", provides a 
run-time infrastructure for managing relational data as objects without 
losing the ability to query. It does this by translating language-integrated 
queries into SQL for execution by the database, and then translating the 
tabular results back into objects you define. Your application is then free 
to manipulate the objects while LINQ to SQL stays in the background tracking 
your changes automatically.

http://msdn.microsoft.com/en-us/library/bb425822.aspx

What is ADO.NET Entities framework?

ADO.NET Entity Framework is an object-relational mapping (ORM) framework for 
the .NET Framework. This framework is Microsoft's first ORM offering for the 
..NET Framework. While Microsoft provided objects to manage the 
Object-relational impedance mismatch (such as a DataSet).

ADO.NET Entity Framework is included with .NET Framework 3.5 Service Pack 1 
and Visual Studio 2008 Service Pack 1, released on 11 Aug 2008. It also 
includes the capability of executing LINQ against ADO.NET Entity Framework 
entities

http://en.wikipedia.org/wiki/ADO.NET_Entity_Framework

Here are two links that will help you too in your understanding of how it 
all ties together. You should get both of the materials in the links.

http://www.pankaj-k.net/spubs/bookreviews/Head_First_Design_Patterns/index.html
http://www.dofactory.com/Framework/Framework.aspx 

0
Mr
5/23/2010 10:46:21 AM
Reply:

Similar Artilces:

How large can the MS Money software ITSELF get, over time? (plz re
I've been using MS Money for years. The last time I upgraded it was to Small Business v 2006 as I run a small business from my home office. I have my pers and bus financials on there since the 90's (not sure of very 1st transaction...). Features-wise, there's no reason for me to upgrade or change anything, and, I also on occasion need to view certain Reports which by nature need to include data from old now-closed bank and credit card accounts so I do not want to "archive" anything at all. But.. I'm wondering, how long can this go on? that is, entering financia...

How to launch report from add-in?
Hi all, I am trying to launch a report from POS addin(RMS). but it is giving an error related to the storng name of the assembly. Can anyone please tell me how I can use the native crystal report engine that is there with POS. so that I need not embed my own crystal report dll. Any other suggestion would help. thanks Hi, The company that made some addins for me and use some printing from the addin, added the software: Crystal Reports for .NET Framework 2.0 (x86) After installing CRRedist2005_x86.msi into my system I can use their reports. Koit Lahesoo "KSS" <KSS@dis...

missing folders! can't import archive.pst file!
help! i made an archive.pst file to back up my folders. then i moved my personal folders from under the "outlook today" folder to under a new "personal folders" folder. they were there. it was fine. then i closed and re- started outlook, and they were gone! and i tried to view and/or import the archive.pst file, but it didn't work! help! -marie What happens if you search for the .pst file after enabling searching hidden and system folders? --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. After searching goo...

how can Modify the Restock Quantity of a Purchase Order...
Hello to all. is there a way to modify a Purchase order in order to have it to have the Reorder Quantity equals to the Restock Quantity? For Instance: I have a stock of quantity 2 of a given item in the store at the moment of make the PO, and I have my restock Level set to 12. it will give me by default a order of 10 (2+10=12)... but in the warehouse I have the 12 packs of that item, so I would like to have my Purchase order to order one more time the same 12 Items in order to restock it directly from the warehouse's 12 pack.. Thanks in advance. Aldo Aldo, I'm not sure I fol...

Can't use my password in 2005
I know 2005 seems to have a lot of issues, but I can't find any answers for my problem. I installed Money 2005 from 2003. Now it tells me that my password or e-mail is incorrect, and I can't open my file I was running in 2003. I had no problems in 2003. I've done everything I can think of that seemed at all relevant from this newsgroup and microsoft support. Other relevant info: -I have the most updated version (14.0.120.1105) -I can't open my file or the backups (same error for all) -I used my passport for 2003, and I can still log into passport web site...

group & summarize diff rows of data that have something in common
I am trying to arrange a large amount of data (inventory) in 2 different ways. 1) Group all identical parts into one row and 2) Group all identical locations into one row. I dont know how to do this. I am dealing with over 3,000 rows. Any suggestions? Depending on your workbook layout, you may be able to use a pivot table to summarize the data. There are instructions in Excel's Help, and Jon Peltier has information and links: http://peltiertech.com/Excel/Pivots/pivotstart.htm pkunAAC wrote: > I am trying to arrange a large amount of data (inventory) in 2 different &g...

Can a form with drop down menus search in other forms?
I am trying to design a database to where the switchboard will lead to a form that has various drop down menus for searching purposes. Let's say that on this form, one of the companies in the "Company Name" drop down menu is Company A. I want for Access to pull all forms that have "Company A" in it. So for example, I would end up with 1 record displayed out of 25. Is this even possible? -- Natasha Well, you really search WITH forms; you don't search FOR forms. Maybe this will help. http://datapigtechnologies.com/flashfiles/searchform.html ...

can't reply or forward messages
I use Outlook Web Access Version 5.5 SP4 for our companies internet email. I can view all of my emails just fine. However, when I try to reply, reply all, or forward any email, I hear a "clicking" noise, the window closes, and nothing happens. I believe that this started after I installed Windows XP SP two ...

Add Ship-To Address to PO?
Hello, Great Plains 8.0 with Purchase Order Processing (just upgraded from 6.0/APOP). We would like the ability to print the shipping address stored on the order header, not the address stored by line item. There will NEVER be a time when we will have multiple ship-to addresses on the same PO. I'm certainly not about to manually add a ship-to address to each line of a 1500 line purchase order. Since the data is stored on the PO header, and we can type it in, I don't understand why it won't print out. The ship-to section is just blank, or prints the address for site ID ...

How can I get Positive values only from the random number generat.
I am generating a random group of numbers using Excel's add-in "Random Number Generator". I am using the normal distribution, but I want positive values only. I know that the test I am doing will work with the negative values I have generated, because the mean/stdev are correct. However, the activity for which the numbers are associated can never be negative, so my presentation will be less effective. Any ideas? You could use the randbetween function and specify a positive range i.e. =Randbetween(1,10000000) HTH Jimbola "Markw3700" wrote: > I am gene...

Hide row and column labels
How can I hide the row and column headings in a spreadsheet. (the a, b, c, etc. across and the 1, 2, 3, etc. down) Thanks! Hi Pam! Use: Tools > Options > View Remove check from "Row and Column Headers" OK -- Regards Norman Harker MVP (Excel) Sydney, Australia njharker@optusnet.com.au How about programmatically? On Fri, 25 Jun 2004 06:20:20 +1000, "Norman Harker" <njharker@optusnet.com.au> wrote: >Hi Pam! > >Use: > >Tools > Options > View >Remove check from "Row and Column Headers" >OK Record a macro while you...

How can I get a unique list of a column?
I have a column which is the name of cities. There are about 5 cities which is repeated in 50 records (rows). I want to get the name of this 5 cities in a separate column. How can I do this? TIA Rasoul Khoshravan Use Data>Filter>Advanced Filter. There is an option to filter unique records. -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Yabi" <khoshravan@gmail.com> wrote in message news:1176190587.423150.254060@q75g2000hsh.googlegroups.com... >I have a column which is the name of cities. There are about 5 cities >...

Need to add Section Letters after page numbers in my footers
I need to add a section (i.e. SB) after the page number in my footer so it will show up in my TOC. How do I do that? There is no way to do exactly what you want in Word. The best you can do is insert the numbering from Word's heading styles (see http://word.mvps.org/faqs/numbering/chapternumber.htm) or from SEQ fields (see the "Adding chapter numbering" section of the article at http://sbarnhill.mvps.org/WordFAQs/TOCTips.htm). -- Stefan Blom Microsoft Word MVP "Barbados56" <Barbados56@discussions.microsoft.com> wrote in message news:657...

Can't delete Favorites folder!
When I attempt to delete a Favorites folder in IE8, I get: "Access is denied. Make sure the disk is not full or write protected and that the file is not currently in use". Any suggestions? Hi, That is the expected behavior for Vista and Win7(?). Can I ask why you want to delete your Favorites folder? IE8 will not work properly without a Favorites folder. On Vista and Win7 it is a special folder that cannot be moved or deleted. Regards. "J. Earthling" <earthling@planet.earth> wrote in message news:eb73gk0sKHA.4712@TK2MSFTNGP04.phx.gbl......

Deleting Rows 04-20-10
Hi Folks, I want to delete two rows - one row has the words "Employee Name" in the first column, and the row before it. This for-next loop removes the row with "Employee Name": For Lrow = LastRow To FirstRow Step -1 If .Cells(Lrow, "A").Value = "Employee Name" Then _ .Rows(Lrow).Delete Next Lrow Any suggestions how to delete the row with "Employee Name" and the one before it? Thanks! Scott Here is one way, without a lot of re-write. For Lrow = LastRow To FirstRow S...

Add line to horizontal bar chart
I've made a bar chart with horizontal bars (the Y axis running from left to right as you look at the screen). I would like to convers my second series from a bar to a line, but whatyever I do Excel seems to create it on a secondary Y axis that is vertical. When I go into 'format data series' it won't let me plot it on the primary axis as the whole thing is greyed out. Can anybody help me? I'm working in Excel 97 by the way. Hi, Have a look at these examples. http://www.andypope.info/charts/averageline.htm Cheers Andy Hrafn wrote: > I've made a bar chart ...

Want to add lot numbers
We have changed our paperwork flow, so now I have the manufacturing lot codes available when I invoice my customer. Is there a way I can attach the lot code to the particular line of an invoice in GP 9.0? Thanks, Phil ------=_NextPart_0001_81876982 Content-Type: text/plain Content-Transfer-Encoding: 7bit Hi Phil, Thank you for your question today. Can you tell me where in Great Plains you see these codes? I'm not familiar with your terminology so if you tell me where you see them I'll be able to determine if they are something that can be put on the SOP invoice. Angela...

customise timeline
Hi there, I need to set up a customised timeline with a "day 0" - it's to do a month end timetable for an accounting function. Day 0 would be the last day of the month and is the reference point day -3, -2, -1, 0, 1, 2, 3 4 etc Do you know how I can set this up? At the moment it goes from day 1 to day -1 and I need a day 0 in between. Thanks Thanks, Hi robbo, Are you trying to customize the Gantt chart timeline? If so, I'm sorry, the answer is no. I hope this helps. Let us know how you get along. Julie Project MVP Visit http://project.mv...

How to add sender email automatically in Outlook 2002
Please tell me how to send setup for all my sender email address can automatically put into my address book, for example like outlook express you can do that pretty easy. Right click on the senders address, select add to contacts. This is the only way in Outook 2002 and later. --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the (insert latest virus name here) virus, all mail sent to my personal account will be deleted without reading. After searching google.groups.com and finding no answer, Erick asked: | Please tell me how to send ...

Can I migrate my old Exchange 5.5 from NT4 to 2003 server?
Totally have no idea about how to do it. Any tips, please. Thanks a lot Hi, Exchange 5.5 will not run on Windows 2003. Exchange 5.5 will run on Windows 2000. The only version of Exchange that will run on Windows 2003 is Exchange 2003. -- Thanks, James Burrage This posting is provided "AS IS" with no warranties, and confers no rights. Please do not send email to this address, post a reply to this newsgroup. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm "yuner" <annie_bai2000@yahoo.com> wrote in m...

Excel VBA
I have been able to get a button that inserts rows but also need th formula in the new row to copy from the row moved. Below is my code for inserting rows. What would I add to have th formulas across the row to copy to the new row?? Sub Macro4() Range("TotalRev").Select ActiveCell.Offset(-1, 0).Select Selection.EntireRow.Insert Range("COGS").Select ActiveCell.Offset(-1, 0).Select Selection.EntireRow.Insert End Sub Thank -- Message posted from http://www.ExcelForum.com David McRitchie has some code you can steal at: http://www.mvps.org/dmcritchie/excel/insrtrow.htm &...

Can't see inbox mail messages
Have been working with Outlook on this laptop and was working. Started it up recently and when I go to the Inbox, it indicated I have (8) messages in the shortcut bar but where the messages are listed, there are no messages. I looked for an alternate Inbox but do not see one. Any ideas as to what is happening? Appreciate the help Alden Do you have any views set on the in-box, such as unread messages or have you sorted by Icon? >-----Original Message----- >Have been working with Outlook on this laptop and was >working. Started it up recently and when I go to the >In...

Can not get Excel macros to format/save charts--help??? :(((((
Help??:((( I've spent the last 5 days searching on this forum for problems similar to what I have but no luck! I am trying to use Excel macro to create a simple bar chart and to format the chart type/etc...but the macro keeps erroring when I try to run it. The debug points to " ' Set ActiveChart = ActiveSheet.ChartObjects(Chart1)" run time error 1004. No matter what I name the chart, it errors. I'm advanced at Excel but not editing macros with VB. I'm at my wits end and hope that someone can help me :(( Hi, You do not set the Activechart ob...

copy rows and paste onto visible only
All, I want to copy say 10 rows and then paste into another 10 rows. Problem is the destination rows are not contiguous. there are 4-5 rows in between each of these rows which are grouped. is there a way to do that. I tried the visible cells property but that does not work. Any help of direction is much appreciated. thanks much, RK Something like; Sub CopyToVisibleRows() Dim rCell As Range, rCell2 As Range Dim lPasteRow As Long lPasteRow = 1 For Each rCell In Sheet1.Range("A1:A10") rCell.EntireRow.Copy For Each rCell2 In Sheet2.Range(&quo...

Can you apply a swatch to grayscale TIF? (Like InDesign does?)
InDesign has a way to drag a color swatch over a non transparent grayscale TIF and colorize the black areas. Does Publisher 2003 have any ways of doing that also? and how? Greg <Greg@discussions.microsoft.com> was very recently heard to utter: > InDesign has a way to drag a color swatch over a non transparent > grayscale TIF and colorize the black areas. Does Publisher 2003 have > any ways of doing that also? and how? See Mary's response to your post of 24 minutes before this one. -- Ed Bennett - MVP Microsoft Publisher ...