473,394 Members | 1,787 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,394 software developers and data experts.

ComboBox in a cell in a list?

I have, in earlier projects, had som serious problems with ComboBoxColumns
in a datagrid. And now I'm in a projects where I needs sometthing like that
again.. but I really do not want to work with Datagrid in Windows.Form cause
they are buggy and ComboBoxes are not easy to work with there (especially
not when you need Multi Columns in the Comboboxes as well).

Is there a better way or a better object to use when doing this sort of
stuff?

Could one place ComboBoxes as a column in ListViews?

best regards
/Lars netzel
Nov 21 '05 #1
12 1402
Lars Netzel wrote:
I have, in earlier projects, had som serious problems with ComboBoxColumns
in a datagrid. And now I'm in a projects where I needs sometthing like that
again.. but I really do not want to work with Datagrid in Windows.Form cause
they are buggy and ComboBoxes are not easy to work with there (especially
not when you need Multi Columns in the Comboboxes as well).

Is there a better way or a better object to use when doing this sort of
stuff?

Could one place ComboBoxes as a column in ListViews?

best regards
/Lars netzel


What bugs are in the Windows Datagrid. I use it all the time w/o
finding any bugs.

Chris
Nov 21 '05 #2
For example you need to created your own class inheriting the DataGrid and
add this to get rid of a problem I dont rememmber right now.. (can't find
address in my Favorites right now that described the bug I bumped into)

Protected Overrides Function ProcessKeyPreview(ByRef m As Message) As
Boolean
Return False

End Function

And try Right-Align a column that's the most right column in the grid and
rename the header of that columnheader and see what happens to the text, I
always get a clipping, about half the last character..

And just a lot of bad vibes from many problems I've had during the process
of my last project... compared to the Datagrid in APS-NET (which has
everything you need from start and works completely bug free all the time)
it sucks...

I think maybe the Extended Datagrid Object (which is free nowdays) would be
good to use but I'm not sure if there are limitation in that that will
result in TONs of work.. (like Creating MultiColumnComboBoxColumn for a
datagrid (that coul dbe DataBounded).. I never got it working very well)

So.. can you have ComboBoxes in a ListView Column instead or it that buggy
and tricky?

Best Regards/

Lars Netzel


"Chris" <no@spam.com> wrote in message
news:e3**************@tk2msftngp13.phx.gbl...
Lars Netzel wrote:
I have, in earlier projects, had som serious problems with
ComboBoxColumns in a datagrid. And now I'm in a projects where I needs
sometthing like that again.. but I really do not want to work with
Datagrid in Windows.Form cause they are buggy and ComboBoxes are not easy
to work with there (especially not when you need Multi Columns in the
Comboboxes as well).

Is there a better way or a better object to use when doing this sort of
stuff?

Could one place ComboBoxes as a column in ListViews?

best regards
/Lars netzel


What bugs are in the Windows Datagrid. I use it all the time w/o finding
any bugs.

Chris

Nov 21 '05 #3
Lars,

It is your opinion however I find it strange that you want to take the
combobox and not the datagrid.

Just my thought,

Cor
Nov 21 '05 #4
What do you mean? Take the ComboBox and not the Datagrid?

I need some sort of List with dynamic number of rows and about 6 fields...
and in two of the fields I need to place a ComboBox...

If this is made BEST with placing a ComboBox in a DataGrid.. I guess I'll
have to get into that again.. But I wanted to ask around to see if there are
any better solutions.. for example the Extended Datagrid or maybe to place a
ComboBox in a ListView... I do not have the Time in this project to sit and
try so I want to know if anyone knows better and can answer me directly...
What's the best approach?

best regards
/Lars Netzel
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Lars,

It is your opinion however I find it strange that you want to take the
combobox and not the datagrid.

Just my thought,

Cor

Nov 21 '05 #5
Lars,

I tell this because I have the idea that the combobox is the control with
the most bugs. You seldom see regulars answering questions about that, I
always think because they know the last.

In VB2005 the combobox is integrated in the DataGrid.

See for some other things about the datagrid our website.
There are as well two methods for a combobox in a datagrid in versions
before 2005.

http://www.windowsformsdatagridhelp.com/default.aspx

I hope this helps,

Cor
Nov 21 '05 #6
Thankx you... I have now managed to get this work with the provided Sample
from that link you gave me (for the Extended One).

But how do I get to work with the Events of the Combo... I need to add a
handler for the SelectedIndexChanged Event somehow.. when do I do this?

/Lars


"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:uo**************@TK2MSFTNGP12.phx.gbl...
Lars,

I tell this because I have the idea that the combobox is the control with
the most bugs. You seldom see regulars answering questions about that, I
always think because they know the last.

In VB2005 the combobox is integrated in the DataGrid.

See for some other things about the datagrid our website.
There are as well two methods for a combobox in a datagrid in versions
before 2005.

http://www.windowsformsdatagridhelp.com/default.aspx

I hope this helps,

Cor

Nov 21 '05 #7
Lars,

That seems for me to become very complex. What you want to do with that
event.

As it is, is it just place the data (or as I remember me the value with the
extended column version) in the row .

You never can catch a single item change in a datagrid.

Cor
Nov 21 '05 #8
What I want to achieve is to change the Item in the Combobox in a column and
then fill in a bunch of data in the textcells on the same row.

Like this..

3 columns in the Grid (Product, Price, Description)

I the first I have a Combobox column and the Combobox is flled with
Productnames and when I select one I want the Price and Description for that
product to be automatically filled to the rest of the column on that row.

/Lars
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:e%****************@tk2msftngp13.phx.gbl...
Lars,

That seems for me to become very complex. What you want to do with that
event.

As it is, is it just place the data (or as I remember me the value with
the extended column version) in the row .

You never can catch a single item change in a datagrid.

Cor

Nov 21 '05 #9
Well actually... I think I fixed it..

In the DataGridComboColumnStyle Class I added this

Public Event ColumnComboBoxSelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)

....and then in the Event that has the SetColumnValueAtRow (which is ComboChanged) I Raised that event..

...and then, in the Form Class, when setting the properties for this style and adding it to the DataGridTableStyle I added a handler

'COMBOBOX

Dim statestyle As New DataGridComboColumnStyle(ds.Tables("States"), "State", "State")

statestyle.MappingName = "State"

statestyle.HeaderText = "States"

ts.GridColumnStyles.Add(statestyle)

AddHandler countrystyle.ColumnComboBoxSelectedIndexChanged, AddressOf ColumnComboBox_SelectedIndexChanged

And then

Public Sub ColumnComboBox_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)

MsgBox(CType(sender, DataGridCombo).SelectedValue)

End Sub

Which Worked fine:) Then I can take that Value and search for a Row in the ComboBox Source and then grab whatever mpre fields I need and add to the cells on the same row in the grid

This wouldn't give me any problems later on or?

/Lars Netzel



"Lars Netzel" <ui****@adf.se> wrote in message news:%2****************@TK2MSFTNGP15.phx.gbl...
What I want to achieve is to change the Item in the Combobox in a column and
then fill in a bunch of data in the textcells on the same row.

Like this..

3 columns in the Grid (Product, Price, Description)

I the first I have a Combobox column and the Combobox is flled with
Productnames and when I select one I want the Price and Description for that
product to be automatically filled to the rest of the column on that row.

/Lars


"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:e%****************@tk2msftngp13.phx.gbl...
Lars,

That seems for me to become very complex. What you want to do with that
event.

As it is, is it just place the data (or as I remember me the value with
the extended column version) in the row .

You never can catch a single item change in a datagrid.

Cor


Nov 21 '05 #10
Lars,

Glad you succeeded.
This wouldn't give me any problems later on or?


That is something I or anyone else helping in this newsgroup never can tell.
That is your own responsibility by good testing your program.

You wrote about bugs. There is nobody who leaves a bug if he had knew it
before.

Cor
Nov 21 '05 #11
Hi

If I found a bug and I cant get around it.. I don't always have time to
spend trying to get around it. I'm can't debit my customers for stuff like
that.

/Lars
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:eY**************@tk2msftngp13.phx.gbl...
Lars,

Glad you succeeded.
This wouldn't give me any problems later on or?


That is something I or anyone else helping in this newsgroup never can
tell. That is your own responsibility by good testing your program.

You wrote about bugs. There is nobody who leaves a bug if he had knew it
before.

Cor

Nov 21 '05 #12
Lars,

I mean if you find a bug that you self made (or are you the one who never
does that). Do you keep that in your program?

Cor
Nov 21 '05 #13

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

Similar topics

3
by: PeterZ | last post by:
G'day, After doing much searching and pinching bits of ideas from here there and everywhere I came up with a fairly 'clean' solution of including a comboBox into a dataGrid column. You can...
5
by: Aaron Ackerman | last post by:
I have a bound combobox the appears on a cell within the column of my bound grid when the user clicks on a cell n(In my vb.net WinForm app). I am trying to allow the adding of an item to that bound...
2
by: pmcguire | last post by:
OK. So I've been to http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp and learned a lot about what I might do with a datagrid. But I'm STILL not able to do what I want to do. I want to be able...
6
by: Lars Netzel | last post by:
I have ask this before and I got a link to a solution where you actually show a new from on top of everything with a listbox in, where you can have multicolumns.. and that's what I use now.. That...
6
by: Doug Bell | last post by:
Hi I have a datagrid with a combo box, I need to populate the combo with data dependant on the record value. eg for record 1, field Warehouse = 2R so combo would allow selection of locations...
4
by: Aziz | last post by:
Hello, I'm using a DataGrid to add a product to an order. I would like to fill in a child field (a foreign key) by bringing up a ComboBox inside the the datagrid cell (like in the latest Northwind...
8
by: | last post by:
I am sure this has been asked and answered, but here goes anyway... VS.Net 2005, VB.Net How can you display more than one field in the displaymember property of a combobox inside the...
3
by: Przemek M. Zawada | last post by:
Dear Group, I'm developing sample window form, using DataGridView control, which is filled with data through BindingSource, which is based on type of object, as follow: public sampleClass {...
2
by: jit007 | last post by:
HI all , I am creating a UI using VBA program where I am using OWC 11 control. What I want is that--- when user will select the pricular cell(say, D4) in the OWC spreadsheet, a combo box appears...
1
by: Man4ish | last post by:
Hi, How Eventlistner can be used with rendred combo box. I got one example of combobox in table as follows . /* * Copyright (c) 1995 - 2008 Sun Microsystems, Inc. All rights reserved. * ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...

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.