Click here to Skip to main content
15,174,933 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: i want to erase two datatables with a single button please help Pin
Augusto10011-Sep-19 5:16
MemberAugusto10011-Sep-19 5:16 
GeneralRe: i want to erase two datatables with a single button please help Pin
Richard MacCutchan11-Sep-19 7:38
mveRichard MacCutchan11-Sep-19 7:38 
GeneralRe: i want to erase two datatables with a single button please help Pin
Augusto10013-Sep-19 7:58
MemberAugusto10013-Sep-19 7:58 
GeneralRe: i want to erase two datatables with a single button please help Pin
Richard Deeming13-Sep-19 8:21
mveRichard Deeming13-Sep-19 8:21 
AnswerRe: i want to erase two datatables with a single button please help Pin
Richard Deeming10-Sep-19 2:33
mveRichard Deeming10-Sep-19 2:33 
QuestionHow to perform non-case search in DataGridViewComboBoxColumn Pin
mo14923-Sep-19 9:09
Membermo14923-Sep-19 9:09 
SuggestionRe: How to perform non-case search in DataGridViewComboBoxColumn Pin
CHill604-Sep-19 0:38
mveCHill604-Sep-19 0:38 
GeneralRe: How to perform non-case search in DataGridViewComboBoxColumn Pin
mo14924-Sep-19 5:58
Membermo14924-Sep-19 5:58 
Sorry for the confusion.

The error from my post in more clear terms are:

Private Sub DataGridView1_DataError(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewDataErrorEventArgs) Handles MyBase.DataError
{
' DataGridViewDataErrorContexts.Display
' DataGridViewDataErrorContexts.Formatting
Debug.WriteLine(e.Context.ToString())
}

My ComboBox code would not do you any good because it is full of structure data references which would not make sense to you but here is what causes the problem, hopefully more clear.

When I initialize the DataGridView columns, for the combobox object I load the list value which is the filename of the source xml file which happens to be "Foodlion" (note case).
Dim cmb As New DataGridViewComboBoxColumn()
cmb.Items.Add("Foodlion")

I then create a row with the value for the ComboBox which happens to be "FoodLion" (case difference)
because that's the way it was originally created in the xml file.
Me.Rows.Add(dataArray())

This causes the above error whenever the cell is Formatted by the DataGridView.
Making sure the data and the combobox list item are the same case fixes the problem.

So something in the DataGridView formatting doesn't like the case difference. Therefore
that's why I 'assumed' that the ComboBox or underlying code was doing a case sensitive
search; My Bad.

Your Q. Why not load the combobox using either the .ToLower() or .ToUpper() functions?

When the xml file is created the filename is saved in the xml data (in a particular case).
The 'case' of the filename of the file that is stored on disk can change. When I enumerate
the xml files on disk (Directory.GetFiles(path, "*.xml")), I use that filename to load into
the combobox list as above (cmb.Items.Add("Foodlion"). If its' case is not the same as what is stored in the xml file,
I get the DataError.

I just asked the question in case someone may have encountered this type of issue with DataGridViewComboBoxColumn.
I think I have found a work around 'HACK' by saving the filename in the xml file in a particular
format and then formatting the filename from disk the same way.
I hate to HACK code.

Again, sorry for the confusion. Frown | :(
Hope this is clearer.

Thanks Smile | :)
GeneralRe: How to perform non-case search in DataGridViewComboBoxColumn Pin
CHill605-Sep-19 1:02
mveCHill605-Sep-19 1:02 
GeneralRe: How to perform non-case search in DataGridViewComboBoxColumn Pin
mo14925-Sep-19 6:42
Membermo14925-Sep-19 6:42 
QuestionLinq, GroupBy, Select, First() or Last() Pin
jkirkerx28-Aug-19 13:38
professionaljkirkerx28-Aug-19 13:38 
AnswerRe: Linq, GroupBy, Select, First() or Last() Pin
Maciej Los28-Aug-19 22:24
mveMaciej Los28-Aug-19 22:24 
GeneralRe: Linq, GroupBy, Select, First() or Last() Pin
jkirkerx29-Aug-19 7:59
professionaljkirkerx29-Aug-19 7:59 
AnswerRe: Linq, GroupBy, Select, First() or Last() Pin
Richard Deeming29-Aug-19 8:14
mveRichard Deeming29-Aug-19 8:14 
GeneralRe: Linq, GroupBy, Select, First() or Last() Pin
jkirkerx29-Aug-19 9:32
professionaljkirkerx29-Aug-19 9:32 
QuestionTrying to make a fixed asset program using visual studio and sql server I got a conversion error varchar to numeric Pin
Augusto10026-Aug-19 7:51
MemberAugusto10026-Aug-19 7:51 
AnswerRe: Trying to make a fixed asset program using visual studio and sql server I got a conversion error varchar to numeric Pin
ZurdoDev26-Aug-19 8:38
professionalZurdoDev26-Aug-19 8:38 
AnswerRe: Trying to make a fixed asset program using visual studio and sql server I got a conversion error varchar to numeric Pin
Richard Deeming27-Aug-19 3:55
mveRichard Deeming27-Aug-19 3:55 
GeneralRe: Trying to make a fixed asset program using visual studio and sql server I got a conversion error varchar to numeric Pin
Augusto10027-Aug-19 6:36
MemberAugusto10027-Aug-19 6:36 
GeneralRe: Trying to make a fixed asset program using visual studio and sql server I got a conversion error varchar to numeric Pin
Richard Deeming27-Aug-19 6:40
mveRichard Deeming27-Aug-19 6:40 
GeneralRe: Trying to make a fixed asset program using visual studio and sql server I got a conversion error varchar to numeric Pin
Augusto10027-Aug-19 7:23
MemberAugusto10027-Aug-19 7:23 
GeneralRe: Trying to make a fixed asset program using visual studio and sql server I got a conversion error varchar to numeric Pin
Richard Deeming27-Aug-19 7:30
mveRichard Deeming27-Aug-19 7:30 
GeneralRe: Trying to make a fixed asset program using visual studio and sql server I got a conversion error varchar to numeric Pin
Augusto10027-Aug-19 7:36
MemberAugusto10027-Aug-19 7:36 
GeneralRe: Trying to make a fixed asset program using visual studio and sql server I got a conversion error varchar to numeric Pin
Richard Deeming27-Aug-19 8:07
mveRichard Deeming27-Aug-19 8:07 
GeneralRe: Trying to make a fixed asset program using visual studio and sql server I got a conversion error varchar to numeric Pin
Mycroft Holmes27-Aug-19 16:14
professionalMycroft Holmes27-Aug-19 16:14 

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.