Click here to Skip to main content
15,909,652 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralQuery For Getting Last Child Note - Sourabh Das Pin
Dot Net Jantu30-Aug-09 22:54
Dot Net Jantu30-Aug-09 22:54 
GeneralRe: Query For Getting Last Child Note - Sourabh Das Pin
Mycroft Holmes30-Aug-09 23:12
professionalMycroft Holmes30-Aug-09 23:12 
QuestionAbout Crystal Report Viewer using Dataset Pin
drexler_kk30-Aug-09 21:31
drexler_kk30-Aug-09 21:31 
AnswerRe: About Crystal Report Viewer using Dataset Pin
Mycroft Holmes30-Aug-09 22:53
professionalMycroft Holmes30-Aug-09 22:53 
QuestionRe: About Crystal Report Viewer using Dataset Pin
drexler_kk30-Aug-09 23:25
drexler_kk30-Aug-09 23:25 
AnswerCrystal Report using Dataset Pin
David Mujica31-Aug-09 3:20
David Mujica31-Aug-09 3:20 
AnswerRe: About Crystal Report Viewer using Dataset Pin
εїзεїзεїз31-Aug-09 6:30
εїзεїзεїз31-Aug-09 6:30 
QuestionEditable DataGridViewComboBoxColumn Pin
C#Coudou30-Aug-09 19:37
C#Coudou30-Aug-09 19:37 
hi mates,

i have an editable DataGridViewComboBoxColumn,
i've used the gridMeasure_CellValidating and gridMeasure_EditingControlShowing from msdn samples.

the comboboxcolumn can now be editable but the problem is everytime i add an item, i got the error here.,

Private Sub gridMeasure_CellValidating(ByVal sender As System.Object, _
            ByVal e As System.Windows.Forms.DataGridViewCellValidatingEventArgs) _
            Handles gridMeasure.CellValidating

        If (TypeOf CType(sender, DataGridView).EditingControl Is DataGridViewComboBoxEditingControl) Then

            Dim comboBoxColumn As DataGridViewComboBoxColumn = _
               Me.gridMeasure.Columns(2)

            If (e.ColumnIndex = comboBoxColumn.DisplayIndex) Then
                If (Not comboBoxColumn.Items.Contains(e.FormattedValue)) Then
                    <code>comboBoxColumn.Items.Add(e.FormattedValue)</code> -->'Items collection cannot be modified when the DataSource property is set.
                End If
            End If
        End If
    End Sub

* I found a solution here

If you want to add an item to the bound combobox, you can add it beforehand in the SQL statement. E.g.
If I want to select a list of authors, then want to add another one then.
SELECT first_name, last_name FROM authors
UNION SELECT 'Joe', 'Bloggs'


But i don't know where to put that statement in my code. could somebody help me or give another solutions on how to add an item with a bound combobox meaning i have a datasource.

thanks in advance, Wink | ;)

C# コードMicrosoft End User
2000-2008




「「「「「「「「「「「「「「「「「「「「「「「「「「「「
The best things in life are free
」」」」」」」」」」」」」」」」」」」」」」」」」」」」


AnswerRe: Editable DataGridViewComboBoxColumn Pin
εїзεїзεїз30-Aug-09 21:18
εїзεїзεїз30-Aug-09 21:18 
GeneralRe: Editable DataGridViewComboBoxColumn Pin
C#Coudou30-Aug-09 21:48
C#Coudou30-Aug-09 21:48 
AnswerRe: Editable DataGridViewComboBoxColumn Pin
εїзεїзεїз30-Aug-09 21:20
εїзεїзεїз30-Aug-09 21:20 
GeneralRe: Editable DataGridViewComboBoxColumn Pin
C#Coudou30-Aug-09 21:53
C#Coudou30-Aug-09 21:53 
GeneralRe: Editable DataGridViewComboBoxColumn Pin
εїзεїзεїз30-Aug-09 22:02
εїзεїзεїз30-Aug-09 22:02 
GeneralRe: Editable DataGridViewComboBoxColumn Pin
C#Coudou6-Sep-09 16:05
C#Coudou6-Sep-09 16:05 
GeneralRe: Editable DataGridViewComboBoxColumn Pin
εїзεїзεїз7-Sep-09 5:54
εїзεїзεїз7-Sep-09 5:54 
GeneralRe: Editable DataGridViewComboBoxColumn Pin
C#Coudou8-Sep-09 18:39
C#Coudou8-Sep-09 18:39 
GeneralRe: Editable DataGridViewComboBoxColumn Pin
εїзεїзεїз8-Sep-09 19:12
εїзεїзεїз8-Sep-09 19:12 
GeneralRe: Editable DataGridViewComboBoxColumn Pin
C#Coudou8-Sep-09 20:16
C#Coudou8-Sep-09 20:16 
GeneralRe: Editable DataGridViewComboBoxColumn Pin
εїзεїзεїз8-Sep-09 20:31
εїзεїзεїз8-Sep-09 20:31 
GeneralRe: Editable DataGridViewComboBoxColumn Pin
C#Coudou8-Sep-09 22:18
C#Coudou8-Sep-09 22:18 
GeneralRe: Editable DataGridViewComboBoxColumn Pin
εїзεїзεїз8-Sep-09 22:23
εїзεїзεїз8-Sep-09 22:23 
GeneralRe: Editable DataGridViewComboBoxColumn Pin
C#Coudou9-Sep-09 18:27
C#Coudou9-Sep-09 18:27 
GeneralRe: Editable DataGridViewComboBoxColumn Pin
εїзεїзεїз9-Sep-09 20:17
εїзεїзεїз9-Sep-09 20:17 
GeneralRe: Editable DataGridViewComboBoxColumn Pin
C#Coudou10-Sep-09 15:33
C#Coudou10-Sep-09 15:33 
GeneralRe: Editable DataGridViewComboBoxColumn Pin
εїзεїзεїз10-Sep-09 16:04
εїзεїзεїз10-Sep-09 16:04 

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.