1,105,221 Community Members

I need advice ,, error with combobox have Parameters in DataGrid

Member Avatar
ebrahim1
Newbie Poster
6 posts since Nov 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

hi
The idea is to make DataGrid contains a field of type combobox it have another data source to choose from those and save data in the DataGrid , this is possible and without any problems..
But when make Parameters to filter data in the combobox and when i try add records have different Parameters ,, error will appears.
An example may not be logical, but I hope that shows what I mean

link: https://rapidshare.com/files/2458729470/FilterComboBox.zip

thank

Member Avatar
john.knapp
Posting Whiz in Training
221 posts since Oct 2012
Reputation Points: 25 [?]
Q&As Helped to Solve: 22 [?]
Skill Endorsements: 4 [?]
 
0
 

In the future, please "clean" your project/solution before compressing and uploading.
It saves everyone time and diskspace...

Member Avatar
john.knapp
Posting Whiz in Training
221 posts since Oct 2012
Reputation Points: 25 [?]
Q&As Helped to Solve: 22 [?]
Skill Endorsements: 4 [?]
 
0
 

My first piece of advice is to turn on "Option Strict"
Right-Click Project in Solution Explorer -> Select Properties (last item on context menu)
Select Compile Tab -> "Option Strict" -> click dropdown and select "On"

Rebuild your application, resolve those 2 errors regarding implicit type conversions and see what happens.

Member Avatar
ebrahim1
Newbie Poster
6 posts since Nov 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Mr.john.knapp thank you to your advice, i do it. but the error still exists.

Member Avatar
john.knapp
Posting Whiz in Training
221 posts since Oct 2012
Reputation Points: 25 [?]
Q&As Helped to Solve: 22 [?]
Skill Endorsements: 4 [?]
 
0
 

I'll let you know what I find

Member Avatar
ebrahim1
Newbie Poster
6 posts since Nov 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Mr.john.knapp ,, Thanks again, but you can solve the error

Member Avatar
john.knapp
Posting Whiz in Training
221 posts since Oct 2012
Reputation Points: 25 [?]
Q&As Helped to Solve: 22 [?]
Skill Endorsements: 4 [?]
 
0
 

The error I see is DataGridViewComboBoxCell value is not valid, is that the same error you get?

The default error message also says to handle the data error event, did you do that? If not, add this code to Form1.vb

Private Sub StudentsDataGridView_DataError(ByVal sender As Object, _
                                          ByVal e As DataGridViewDataErrorEventArgs) _ 
                                           Handles StudentsDataGridView.DataError
    If e.Exception IsNot Nothing Then
        MessageBox.Show(e.Exception.Message, e.Exception.Source)
    End If
End Sub
Member Avatar
john.knapp
Posting Whiz in Training
221 posts since Oct 2012
Reputation Points: 25 [?]
Q&As Helped to Solve: 22 [?]
Skill Endorsements: 4 [?]
 
0
 

From what I see in a Google Search using that error, and in particular this discussion, it appears to be an issue with the way your data is bound to the DataGridView.

Member Avatar
ebrahim1
Newbie Poster
6 posts since Nov 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Mr.john.knapp i ded not handle error so i will add the code i think it will be handle it.
thank you so much

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article