473,398 Members | 2,088 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

make dropdown winder than column in DataGridView

I need to make dropdown list wider than column width.
I tried code below but dropdown width is not increased when I open dropdown.
How to increase it ?
using System;
using System.Windows.Forms;

class Form1 : Form {

[STAThread]
static void Main() {
try {
Application.Run(new Form1());
}
catch (Exception e) {
MessageBox.Show(e.ToString());
}
}

private DataGridView dataGridView1 = new DataGridView();

public Form1() {
Controls.Add(this.dataGridView1);
Load += new EventHandler(Form1_Load);
}

private void Form1_Load(object sender, EventArgs e) {
DataGridViewComboBoxColumn
col = new DataGridViewComboBoxColumn();
col.DropDownWidth *= 3;
dataGridView1.Columns.Add(col);
}
}
Jun 27 '08 #1
0 1366

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: David Veeneman | last post by:
How can I set a bound DataGridView control to use a dataset table's column captions, instead of column names? I'm working with a DataGridView control, which I have bound to a table in a dataset....
4
by: Matt | last post by:
I have been searching all over the web for a way to sort a DataGridView based on the actual text being shown in a ComboBox column as opposed to the underlying value (an ID in this case). Can anyone...
3
by: sklett | last post by:
I'm changing from a DataGrid to a DataGridView and have run across a problem. The items that are bound to the DataGrid have an int Property that represents a primary key of a lookup table in my...
0
by: polaris431 | last post by:
I would like to have a combobox control that when clicked, displays a DataGridView in-place of the normal dropdown list. I want it to be a DataGridView with editing capabilities. The DataGridView...
0
by: mahesh.nimbalkar | last post by:
I want to use Multi column sorting in DataGridView. The scenario is like this: 1) DataGridView has two columns; Id and name 2) User clicks on Id column and DataGridView is sorted...
1
by: Brano | last post by:
Hi all, I have a datagridview that has one column it is of type DropDownListColumn but I only want the user to be able to add new rows by making a selection from the dropdown. I want all the...
0
by: PromisedOyster | last post by:
I have a datagridview. One of the database bound columns shows a code. However, when I drop down this combo, I would like to see a code + description as this may help the user select the...
0
by: Lloyd Sheen | last post by:
I have been trying for last couple of hours, googling etc to find how to use a simple one column datagridview where the one and only column is a dropdown combobox. I have not been successful , I...
0
by: JB | last post by:
Hi All, I have a DataGridView with a column showing a combo box containing non binded values (i.e. I set the values in the Combo myself using ComboBoxColumn.Items.Add). I also want this Combo...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.