Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / June 2006

Tip: Looking for answers? Try searching our database.

Adding rows to a bound table that is bound to DataGridView(DataSou

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kevin Burton - 21 Jun 2006 19:54 GMT
If I add rows to a table like:

               _dtManualOrderItem.Rows.Add(mo)

How does the DataGridView get notified of this event? I don't see a Bind or
Rebind method. If I remove the binding and readd it:

           dgvOrderItems.DataSource = Nothing
           dgvOrderItems.DataSource = _dtManualOrderItem

Then the columns that I want displayed disappear or are reset. Anyway the
result is I see columns that I don't want to see. How would be the best way
to add a row to the table and have it update the DataGridView?

Thank you.

Kevin
Kevin Burton - 21 Jun 2006 21:10 GMT
As an addition. I have been able to add rows to the table and the grid seems
to be updated (the Rows property shows an addition) but I don't see the
values of the rows on the display. After adding a row to the bound table do I
need to Update to get it to display?

> If I add rows to a table like:
>
[quoted text clipped - 13 lines]
>
> Kevin
Kevin Burton - 22 Jun 2006 06:05 GMT
I think I have found the problem but I am not sure about the solution. My
application defines the columns to be displayed as follows:

       Dim dgTextCol As DataGridViewTextBoxColumn = New
DataGridViewTextBoxColumn()
       dgTextCol.HeaderText = "Customer ID"
       dgTextCol.Name = "CustomerID"
       dgTextCol.Width = 60
       dgTextCol.ReadOnly = True
       dataGridView1.Columns.Add(dgTextCol)

When this code is introduced the columns in each of the rows go blank. If I
skip this then the columns are displayed. How else do I set these kind of
properties plus limit the columns that are displayed from the DataSet?

Somewhat related. Notice that the ReadOnly property is set for the the
column above I would like to make some columns ReadOnly and some editable. I
saw in the documentation that the ReadOnly property for the row overrides the
properties in the column. But I don't see where to set or clear the ReadOnly
property for a row.

Thank you for your help with these two questions.

Kevin

> If I add rows to a table like:
>
[quoted text clipped - 13 lines]
>
> Kevin

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.