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

About the Combobox in Datagrid!

I have used examples and a class called DataGridComboboxColumn from an
example I found on SyncFusion.

I had to add another Event to get the SelectedIndexChanegd event working but
I did that in the Class... and now I realized I need to get that even from
the form.

How do I add a SelectedIndexChanged handler in the form where I'm using the
DataGridComboBoxColumnn?

/Lars
Nov 20 '05 #1
5 1225
Lars
The article at the following link has a download demo that includes a class
for all kinds of datagrid columns, including creating and handling a
combobox in a datagrid.
http://www.knowdotnet.com/articles/kdngrid.html

HTH
Les Smith
http://www.knowdotnet.com

"Lars Netzel" <[no_spam_please]la*********@qlogic.se> wrote in message
news:eK**************@TK2MSFTNGP10.phx.gbl...
I have used examples and a class called DataGridComboboxColumn from an
example I found on SyncFusion.

I had to add another Event to get the SelectedIndexChanegd event working but I did that in the Class... and now I realized I need to get that even from
the form.

How do I add a SelectedIndexChanged handler in the form where I'm using the DataGridComboBoxColumnn?

/Lars

Nov 20 '05 #2
Hi Lars

I added it on the wrong question.

You can try this

In the DataGridComboBox column class you can add
Public Event ComboSelectedIndexChanged()

Than you can make an event in that class for the SelectedIndexChanged which
has the row
RaiseEvent ComboSelecteIndexChanged()

Than in the form you have to make the combobox global (private) withevents,
than you can catch it. I did try it however did not look for side effects, I
saw it fires more than you probably want so that you should prevent too.

I hope this helps?

Cor

Nov 20 '05 #3
I'm not as good as you might think I am... I can't compile!

what does this error mean?

" Method 'ComboBoxColumn_SelectedIndexChanged' cannot handle Event
'ComboSelectedIndexChanged' because they do not have the same signature."

/Lars
"Cor Ligthert" <no**********@planet.nl> skrev i meddelandet
news:%2****************@tk2msftngp13.phx.gbl...
Hi Lars

I added it on the wrong question.

You can try this

In the DataGridComboBox column class you can add
Public Event ComboSelectedIndexChanged()

Than you can make an event in that class for the SelectedIndexChanged which has the row
RaiseEvent ComboSelecteIndexChanged()

Than in the form you have to make the combobox global (private) withevents, than you can catch it. I did try it however did not look for side effects, I saw it fires more than you probably want so that you should prevent too.

I hope this helps?

Cor

Nov 20 '05 #4
Hi Lars,

Something more complete

In the top of your program under windows designer code this
Private WithEvents cmbTxtCol As DataGridComboBoxColumn

Than you have also to change this sentence with
Dim cmbTxtCol as new DatagridComboboxColumn
to
cmbTxtCol = New DatagridComboboxColumn

Than in the declaration of the Class DatagridComboboxColumn
Public Event ComboSelectedIndexChanged(ByVal _
sender As Object, ByVal e As System.EventArgs)

And before the end of that class (not the nokeyupcombo class)

Private Sub ColumnComboBox_SelectedIndexChanged _
(ByVal sender As Object, ByVal e As System.EventArgs) _
Handles ColumnComboBox.SelectedIndexChanged
RaiseEvent ComboSelectedIndexChanged(sender, e)
End Sub

And than you can add the event in your program by choosing it from the
comboboxes.
(It still is a quick and dirty solution)

I hope this helps

Cor
Nov 20 '05 #5
Thank you! You have saved my a** at work today:)

/Lars
"Cor Ligthert" <no**********@planet.nl> skrev i meddelandet
news:%2******************@TK2MSFTNGP12.phx.gbl...
Hi Lars,

Something more complete

In the top of your program under windows designer code this
Private WithEvents cmbTxtCol As DataGridComboBoxColumn

Than you have also to change this sentence with
Dim cmbTxtCol as new DatagridComboboxColumn
to
cmbTxtCol = New DatagridComboboxColumn

Than in the declaration of the Class DatagridComboboxColumn
Public Event ComboSelectedIndexChanged(ByVal _
sender As Object, ByVal e As System.EventArgs)

And before the end of that class (not the nokeyupcombo class)

Private Sub ColumnComboBox_SelectedIndexChanged _
(ByVal sender As Object, ByVal e As System.EventArgs) _
Handles ColumnComboBox.SelectedIndexChanged
RaiseEvent ComboSelectedIndexChanged(sender, e)
End Sub

And than you can add the event in your program by choosing it from the
comboboxes.
(It still is a quick and dirty solution)

I hope this helps

Cor

Nov 20 '05 #6

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

Similar topics

0
by: Gamze | last post by:
Hi, In my vb.net windows application ,i have combobox which is populated by sqlserver database table.When i select value from combobox ,value saved in to other table of my database and i use to...
3
by: Bill C. | last post by:
Hello, I know this has been discussed a lot already because I've been searching around for information the last few weeks. I'm trying to implement a DataGridComboBoxColumn class. I've found...
2
by: john sutor | last post by:
Does anyone know how to create a combobox in a standard datagrid? I can create check boxes , but not the combobox
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...
2
by: pei_world | last post by:
I want to implement a key hit with enter to dropdown a combobox that is in the datagrid. in this case I need to override its original behaviours. I found some codes from the web. Does anyone know...
2
by: jaYPee | last post by:
i have search a lot of newsgroup and some website to find a sample for multi column combobox in datagrid but no luck. there are so many sample i found but it is not located in datagrid. i would...
1
by: John Doe | last post by:
Now i know how to manually add a combobox to a datagrid, but how would i handle the recordset below? ID | FirstName | LastName | Job -------------------------------- 1 |Joe | Smith |...
0
by: dbuchanan | last post by:
ComboBox databindng Problem == How the ComboBox is setup and used: My comboBox is populated by a lookup table. The ValueMember is the lookup table's Id and the DisplayMember is the text from a...
1
by: fiaolle | last post by:
Hi The first set of source code is the class for a combobox in a grid, hopefully. In the second set of code we try to use the combobox class, but the grid is empty. I don't understand how this...
4
by: JJGarcia | last post by:
Hi Everyone, I'll try to explain the process I'm following, I'm new to this so I'm triying the easy way first, probably the lasyest too! I created a new Project, drag in to it a SQLConnection,...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...

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.