Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 505527
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:36:29+00:00 2026-05-13T06:36:29+00:00

i have a DataGridView responsible for showing a bit of data and two of

  • 0

i have a DataGridView responsible for showing a bit of data and two of my columns allow for user input using comboboxes.

The trouble is that one column only needs to show preset values in it’s list, but the other needs to both show the presets and allow for the user to enter in their own values.

i accomplish this by showing the editing control for the combobox with this bit of code:

Private Sub DGV_EditingControlShowing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewEditingControlShowingEventArgs) Handles DGV.EditingControlShowing
    'todo: figure out which control is being edited (the reason or the action) and only allow the action column to allow user input
    If TypeOf e.Control Is DataGridViewComboBoxEditingControl Then
        Dim cb As ComboBox = e.Control
        cb.DropDownStyle = ComboBoxStyle.DropDown
    End If
End Sub

This allows for user input on both comboboxes in the DGV, but i only want to allow for user input for one of them.

Is there any way to detect which column in the DGV the editing control is coming from so that i dont run this code for both columns?

Am i missing a better way of doing this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T06:36:29+00:00Added an answer on May 13, 2026 at 6:36 am

    What about e.Control.EditingControlDataGridView.CurrentCell.ColumnIndex?

    Or maybe just DGV.CurrentCell.ColumnIndex?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have DataGridView with two columns. The first column is TextBoxCol(DataGridViewTextBoxColumn) and the Second
I have datagridview with checkbox column, but I want, that some of the columns
I have a datagridview which I'm using for data entry. I've done this before
I have datagridview which fills data from database, there are columns where I have
I have a DataGridView with unbound data that contains three different DataColumns . The
I have a datagridview bound to a bindingsource. Two of the columns contain values
I have DataGridView which contains two ComboBox columns. The second ComboBox will be filled
I have a DataGridView that I want to query using Linq (C# WinForm). I
I have a datagridview that is linked to a three columns in the database,
I have a DataGridView with cells from a database file that contains data. Basically,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.