PC Review


Reply
Thread Tools Rate Thread

ComboBox in a cell in a list?

 
 
Lars Netzel
Guest
Posts: n/a
 
      23rd Aug 2005
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


 
Reply With Quote
 
 
 
 
Cor Ligthert [MVP]
Guest
Posts: n/a
 
      23rd Aug 2005
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


 
Reply With Quote
 
Lars Netzel
Guest
Posts: n/a
 
      24th Aug 2005
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" <(E-Mail Removed)> wrote in message news:%(E-Mail Removed)...
> 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]" <(E-Mail Removed)> wrote in message
> news:e%(E-Mail Removed)...
>> 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
>>

>
>

 
Reply With Quote
 
Lars Netzel
Guest
Posts: n/a
 
      25th Aug 2005
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]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Combobox list based on choice in previous combobox Slim Slender Microsoft Excel Programming 0 2nd Aug 2011 11:37 AM
Combobox list based on choice in previous combobox Slim Slender Microsoft Excel Programming 0 2nd Aug 2011 11:16 AM
Limit ComboBox list by previous ComboBox results David Microsoft Access Form Coding 1 7th Aug 2009 07:09 PM
Change Combobox list to list more than 1 cell.value Corey Microsoft Excel Programming 2 5th Jan 2007 01:35 AM
Values contained in value list of second combobox based on value selected in first combobox. Anthony Microsoft Access Forms 16 6th Mar 2004 04:07 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:41 AM.