Click here to Skip to main content
16,010,351 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questiondatagridview in vb.net 2008 Pin
jigneshDPatel6-Jan-09 19:07
jigneshDPatel6-Jan-09 19:07 
AnswerRe: datagridview in vb.net 2008 Pin
Mycroft Holmes6-Jan-09 20:27
professionalMycroft Holmes6-Jan-09 20:27 
AnswerRe: datagridview in vb.net 2008 Pin
Jay Royall7-Jan-09 0:36
Jay Royall7-Jan-09 0:36 
GeneralRe: datagridview in vb.net 2008 [modified] Pin
jigneshDPatel7-Jan-09 1:03
jigneshDPatel7-Jan-09 1:03 
GeneralRe: datagridview in vb.net 2008 Pin
Jay Royall7-Jan-09 1:35
Jay Royall7-Jan-09 1:35 
GeneralRe: datagridview in vb.net 2008 Pin
jigneshDPatel7-Jan-09 1:50
jigneshDPatel7-Jan-09 1:50 
GeneralRe: datagridview in vb.net 2008 Pin
Dave Kreskowiak7-Jan-09 2:25
mveDave Kreskowiak7-Jan-09 2:25 
QuestionDatagridview add new rows -- Error Pin
Chrispie1236-Jan-09 18:36
Chrispie1236-Jan-09 18:36 
Hi

I am having the following problem with a data grid (This is my child grid). My data grid is bound to a binding source which is bounded to a dataset filled with data.

I want the user to be able to add new rows and as they add rows certain fields needs to be populated (There fields is not visible in my grid) with data from my parent dataset.

I add the data in the following handler
AddHandler dataset.table.TableNewRow, AddressOf AddNewPreRow


Private Sub AddNewPrePopulatedWarehouseLocationRow(ByVal sender As Object, ByVal e As System.Data.DataTableNewRowEventArgs)
            e.Row.Item("ColumnName") = CStr(SelectedParentRow.ColumnName)             
        End Sub


If the user moves to a new row the values is populated (if I make the invisible columns visible I can see that they do get populated) and if the user goes back the row
disappears like i want to. I also do a validation on the CellEndEdit and in here I make use of the rowindex.

But the problem comes when the user goes to the new line enter a value in the first cell (By this time the dgv seems to be taking this as a new row and it is not "Dirty anymore"
And it shows a new line with * beneath this line) which is all ok.....

This far we have 2 lines -
1. The line that i just created and added info into the first column (This line has a pencil next to it)
2. An empty line beneath it (This line has a * next to it)

If i use the mouse and click on another row
1. The newly add line with the pencil next to it cleans itself (I suppose this is because i did not enter all the required fields yet and the data binding discards the data)
But the empty line remains there
2. Now the validation fires for this line and a get a Index <XX> does not have a value
3. There is now 2 empty lines then new one now has a Play button sign and the line beneath it has a *

In my validation i check for the following to execute validation
If (dgv.Rows(RowIndex) IsNot Nothing) AndAlso Not dgv.Rows(RowIndex).IsNewRow AndAlso dgv.IsCurrentRowDirty Then  --> result in true


Please if someone knows how to fix this i will appreciate it.

Thanks,
Chris
AnswerRe: Datagridview add new rows -- Error Pin
Mycroft Holmes6-Jan-09 20:25
professionalMycroft Holmes6-Jan-09 20:25 
AnswerRe: Datagridview add new rows -- Error Pin
Dave Kreskowiak7-Jan-09 6:31
mveDave Kreskowiak7-Jan-09 6:31 
GeneralRe: Datagridview add new rows -- Error Pin
Chrispie1237-Jan-09 17:05
Chrispie1237-Jan-09 17:05 
QuestionTrying to use XPath on HTML document using XPathNavigator, help on parsing invalid HTML? Pin
ultrafez006-Jan-09 12:19
ultrafez006-Jan-09 12:19 
AnswerRe: Trying to use XPath on HTML document using XPathNavigator, help on parsing invalid HTML? Pin
Dave Kreskowiak7-Jan-09 6:27
mveDave Kreskowiak7-Jan-09 6:27 
GeneralRe: Trying to use XPath on HTML document using XPathNavigator, help on parsing invalid HTML? Pin
ultrafez007-Jan-09 14:09
ultrafez007-Jan-09 14:09 
QuestionSave function for VB.Net Pin
rafaelz696-Jan-09 10:33
rafaelz696-Jan-09 10:33 
AnswerRe: Save function for VB.Net Pin
EliottA6-Jan-09 10:36
EliottA6-Jan-09 10:36 
QuestionHow to update form control from an embedded form Pin
sohaib_a6-Jan-09 7:00
sohaib_a6-Jan-09 7:00 
AnswerRe: How to update form control from an embedded form Pin
EliottA6-Jan-09 7:16
EliottA6-Jan-09 7:16 
GeneralRe: How to update form control from an embedded form Pin
sohaib_a6-Jan-09 8:51
sohaib_a6-Jan-09 8:51 
GeneralRe: How to update form control from an embedded form Pin
EliottA6-Jan-09 8:53
EliottA6-Jan-09 8:53 
GeneralRe: How to update form control from an embedded form Pin
sohaib_a6-Jan-09 9:45
sohaib_a6-Jan-09 9:45 
GeneralRe: How to update form control from an embedded form Pin
EliottA6-Jan-09 9:48
EliottA6-Jan-09 9:48 
GeneralRe: How to update form control from an embedded form Pin
Dave Kreskowiak6-Jan-09 10:02
mveDave Kreskowiak6-Jan-09 10:02 
GeneralRe: How to update form control from an embedded form Pin
EliottA6-Jan-09 10:33
EliottA6-Jan-09 10:33 
GeneralRe: How to update form control from an embedded form Pin
sohaib_a6-Jan-09 11:01
sohaib_a6-Jan-09 11:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.