473,789 Members | 2,799 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataGridView and comboboxes

Hello

can anyone tell me if its possible to have mixed colum-types inside
one colum in a Datagridview under Net 2.0?

I need to have comboboxes (with different content), inputfields and
DateTimePicker inside one column depending on some flag on the
DataRow.

I am not using databinding.

Any example would be very welcome.

_tia rene

Aug 21 '07 #1
2 1862
In article <11************ **********@d55g 2000hsg.googleg roups.com>,
ReneMarxis wrote:
can anyone tell me if its possible to have mixed colum-types inside
one colum in a Datagridview under Net 2.0?
Yes, it seems to be as simple as creating a new datagridview cell of
the type you need and assigning it to the desired row and column.
Any example would be very welcome.
This sets the first row to use a combo box cell:

for (int i = 0; i < numColumns; i++)
{
DataGridViewCom boBoxCell cbx = new DataGridViewCom boBoxCell();
cbx.Items.Add(" ");
cbx.Value = "";
mainDataGridVie w.Rows[0].Cells[i] = cbx;
filterBoxes[i] = cbx;
}

Hope this helps

Mike

Aug 27 '07 #2
On 27 Aug., 18:49, Mike Blake-Knox <mik...@communi ty.nospamwrote:
In article <1187703143.672 256.142...@d55g 2000hsg.googleg roups.com>,

ReneMarxis wrote:
can anyone tell me if its possible to have mixed colum-types inside
one colum in a Datagridview under Net 2.0?

Yes, it seems to be as simple as creating a new datagridview cell of
the type you need and assigning it to the desired row and column.
Any example would be very welcome.

This sets the first row to use a combo box cell:

for (int i = 0; i < numColumns; i++)
{
DataGridViewCom boBoxCell cbx = new DataGridViewCom boBoxCell();
cbx.Items.Add(" ");
cbx.Value = "";
mainDataGridVie w.Rows[0].Cells[i] = cbx;
filterBoxes[i] = cbx;

}

Hope this helps

Mike
WOOT thanks ...... this is very very simple ...... can t understand
why i didn t get this.

many thanks

Sep 7 '07 #3

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

Similar topics

10
13359
by: milk-jam | last post by:
I'm trying to set my datagridview so that the first row will be left blank and to use it as a filtering filed for the datagridview. Until now I was using 2 datagridview the upper one with a header that sort and one row for filtering and the lower one with no header for the data. Only it is very complicated to work this way cause for example when the user click on sort on the upper datagridview I need to sort the lower grid and so on when...
1
1080
by: Sam | last post by:
Hi, Databound comboboxes in a datagridview control, are not editable! Therefore if I want to let my user adding a value which is not part of the list, it wouldn't work! Is there a work around? Has anyone come across this problem before? Thx
2
16349
by: Nathan | last post by:
Hi, I have a datagridview bound to a List of objects (ObjectA). Each ObjectA contains an ObjectB property. Class ObjectA { public ObjectB objB {} }
2
1039
by: Ketan Dixit | last post by:
Hi , I am developing a ASP.NET web application in which I am using a datagridview. It is an editable gridview. My grid has almost 5000 items and i am required to show these items in a single page (using a scrollable div). One of the columns of the datagridview is Combobox column. Combobox column works fine until there are only a few records in the grid. But for 5000 records it is not showing the comboboxes properly.(Means when scrolling...
2
1307
by: Ketan Dixit | last post by:
Hi, I am developing an application which uses datagridview.The grid contains about 5000 records and i am showing them all in a single page by putting a scrollabe div around datagridview (I am required to do so.. ) The grid has a column having comboboxes. These combos work fine for a few hundred records but for 5000 records some of the combos disappear while scrolling , which is quite irritating Is there any other way to solve this without...
2
1769
by: ashishtarlekar | last post by:
Hi all, I have to add comboboxes in the first row of datagridview for mapping the database fields. For e.g. I have to show Id, FirstName, LastName in each comboboxes in the first row. if i select a database which contains 2 fields then this data should be displayed from second row so that the user can choose the header name for this two columns from comboboxes like Id, FirstName, LastName etc. Can anybody tell me the solution?
3
6331
by: =?Utf-8?B?Sm9obiBCdW5keQ==?= | last post by:
New to databinding in vs2005, I always did it manually in 2003. I have no problem loading comboboxes, and a change in that combobox changes the data in the textboxes but I can not figure out a way to get the data in a datagridview to change. For example 2 columns are ID and amount_paid, the datagridview loads on form load with all ID's and amounts. How do I get it to only bring back the selected ID. Sounds like I may need to change the SQL...
1
10152
by: Trey | last post by:
I have an unbound datagridview with three comboboxes (e.g. A, B, C) All three comboboxes share the same datasource and use the same valuemember. If I change the value of say combobox A, then B and C change also. My problem is that B and C do not show the update until after I click off of combobox A. I want B and C to update as soon as I make the selection on A. How do I do this? Thanks, Trey Private Sub...
0
985
OuTCasT
by: OuTCasT | last post by:
Hi all. i got a student/product management application. now on the main page there is a datagridview with 4 columns, Name | Description | Qty | Price ----------------------------------------------------- the name and description fields are comboboxes that are bound to the db, i knw on web forms u can use one dropdownlist selection to populate the next dropdownlist info, how can one do that in a datagridview for win forms ? And i...
0
9665
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10199
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9983
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9020
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5417
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4092
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3697
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.