468,256 Members | 1,451 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,256 developers. It's quick & easy.

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 1253
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Aaron Ackerman | last post: by
2 posts views Thread by pmcguire | last post: by
6 posts views Thread by Lars Netzel | last post: by
6 posts views Thread by Doug Bell | last post: by
8 posts views Thread by | last post: by
3 posts views Thread by Przemek M. Zawada | last post: by
reply views Thread by kermitthefrogpy | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.