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

Home Posts Topics Members FAQ

Select an item from DataGridViewCom boboxCell

2 New Member
I have a DataGridView in which one of its columns is a DatagridViewCom bobox. This column contains values as
1. "ROAMING"
2. "MOBILE"
3. "TELEPHONY" ...

I want to select an index from this DatagridViewCom boboxCell programmaticall y, for example 2 ("MOBILE").

Is anyone knows an easy way of doing this.

Thak you
Jul 21 '06 #1
2 8839
coldflame
19 New Member
I have a DataGridView in which one of its columns is a DatagridViewCom bobox. This column contains values as
1. "ROAMING"
2. "MOBILE"
3. "TELEPHONY" ...

I want to select an index from this DatagridViewCom boboxCell programmaticall y, for example 2 ("MOBILE").

Is anyone knows an easy way of doing this.

Thak you
Hi hope this will give you some idea

<asp:DropDownLi st id="methdselect " runat="server" datasource='<%# Methodlist.item s %>' SelectedIndex=' <%#GetStateInde x(DataBinder.Ev al(Container, "DataItem.Metho d")) %>'></asp:DropDownLis t>

Protected Function GetStateIndex(B yVal Method As String) As Integer
dim i As Integer = Methodlist.Item s.IndexOf(Metho dlist.Items.Fin dByText(Method) )
Return i
End Function

Where Methodlist is arraylist of all the methods you have included in the comboxbox i used to bind the same arraylist with comobox

Regards
Jul 21 '06 #2
kofteros
2 New Member
Thank you for the reply

I am writing an application form and not an asp.
The values of the DataGridViewCom boboxCell are retrieved from a database table (dataset).

e.g.
CType(DataGV1.C olumns(1), DataGridViewCom boBoxColumn).Da taSource = DataSet1
CType(DataGV1.C olumns(1),DataG ridViewComboBox Column).Display Member = "Table2.PRODUCT _CON_DESCRIPTIO N"
CType(DataGV1.C olumns(1), DataGridViewCom boBoxColumn).Va lueMember = "Table2.PRODUCT _CON_ID"

I am trying to select an item in a specific Cell of this Datagrid. So even though I can find the index of the value I cannot find a method to set the new selectedIndex.
I am confused.
Jul 24 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
3042
by: Moshazu | last post by:
I am attempting to use the DataGridView control in my software and have not been able to easily find answers to a couple of questions that I have. 1. Is the only way to change the data in a DataGridViewComboBox during the runtime the way that I have done it here? If not, is there an easier way? Dim tmpCMBRow As New DataGridViewRow tmpCMBRow.CreateCells(Me.grid)
0
3074
by: Jay | last post by:
I am using Windows .Net 2.0 SDK I have a DataGridView control in a windows form. None of my controls are databound prior to run time. I am creating a string array with which I want to populate each DataGridViewComboBoxCell programmatically. Some of the items in the comboboxcell controls may be the same, but most will not, so I can not populate the DataGridViewComboBoxColumn. I have tried adding rows to the datagrid using Rows.Add. I have...
2
7499
by: Andrew Lias | last post by:
Let us say that I have a table with two sets of values as such: Item Extension --- ---- 100023 1 100025 1 100025 2 100028 1 100029 1 100029 2
1
4030
by: Sunray | last post by:
I have a form called the sales form and i have 2 sets of listboxes So what happens is. i add items form the bottom set of list boxes which are bound to a data base to the top set of list boxes which are not bound, I select from the bottom set and add to the top set which works fine, but now i decide to remove an item from the top set. when i tried to use a remove item code it worked fine, it did delete the item form the list but it added...
0
2153
by: Bruno Neves Pires Silva | last post by:
Hello, everybody. How can I get the selected item index in a DataGridViewComboBoxCell, in a datagridview?
0
3414
by: news.microsoft.com | last post by:
Hello- I'm having a dickens of a time trying to set the value on a DataGridViewComboBoxColumn. I actually have two DataGridViewComboBoxColumns in my datagrid view. First, I'm setting up the grid/column as follows.. DataGridViewComboBoxColumn someColumn = new DataGridViewComboBoxColumn();
0
2884
by: =?Utf-8?B?R2FkeUM=?= | last post by:
HI I populate one col. in a dataiewgrid with a combocell as DataGridViewComboBoxCell. (create on the fly and assign it to cell) I need to avid arrow user's up/down on that cells. All the grid events ignore edit state of combocell. Any idea? Thanks in advance.
1
3252
by: JB | last post by:
Hi All, Is there a way to programmatically open the drop down list of a DataGridViewComboBoxCell? Thanks JB
4
2726
by: Martin Horst | last post by:
Hi, I've got a Windows Form DataGridView with several DataGridViewComboBoxCell columns. The Items collection of the DataGridViewComboBoxCell can take any kind of objects. But when the user selects another item inside the combobox, the Value property always returns a string. In my case, I need the real object which was added to the items collections. Is there any way to prevent this conversion. Thanks in advance
0
9666
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
9511
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10200
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
9984
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...
1
7529
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6769
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5418
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?
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.