Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Need Button And Combo In MS Datagrid


Is there any way to get a combo dropdown and/or a button in a Standard MS DataGrid.

OR

I thought I saw a MS FLEX Grid that might have more functionallity. Is that a possibility?

thanks...




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Combo In Datagrid(button Property Of Datagrid)
Hi,
We are working on datagrid and want to know how the button property
of the datagrid used. We have been working on this and are stuck as
to how to use each cell of the grid as combo box.

Datagrid - Combo - No Button
Hello everybody!
I know, it's easy for you!
Well, I would like to activate a combo inside a datagrid with
the hide/unhide technique but during the grid navigation and
not pressing a cell button. Any suggestion? Thanks a lot!

How To Get The Value From Listview To The Datagrid By The Datagrid's Button
how to get the value from listview to the datagrid by the datagrid's button.
since the datagrid is empty, so i cant retrieve the value of listview to the datagrid....


and here i had attach a sample... ..
so. pls help me to fix this problem...

DataGrid With Combo Box.
I want to give a DataGrid the appearance of having a Combo Box for one the columns. I am thinking I can do this by having an invisible Combobox on my form and any time the column receives focus I could move the combo box to that column and make it visible. When a value is chosen from the combo box it will turn back invisible and the value will be inserted into the datagrid column.

1) I’m not sure what property I should use to detect when the column receives focus. I was trying "BeforeColEdit" but the event doesn't fire until I start to type. I am looking for an event that will fire as soon as the cursor is placed there.


'move combobox over Type column datagrid
Private Sub dgdeposit_BeforeColEdit(ByVal colindex As Integer, ByVal KeyAscii As Integer, Cancel As Integer)
If colindex = 5 Then
MsgBox "Working"
End If
End Sub

2) How would you suggest obtaining the coordinates to where the combo box will be placed? I was thinking of "Mouse_Up" but I'm afraid if they click in the middle of the column the combo box will not be lined up correctly.

I have heard there is some information in the MSDN for doing this type of thing but I haven’t been able to find it. Any thoughts or advice would be appreciated.

Eric

Combo V Datagrid
hi iam looking for a way or example on how to use a combo list to choose what fields from a database is shown in a datgrid format
any help

DataGrid And Combo Box
Is it possible to have a combo box embedded in a datagrid? I've searched for this question already and didn't see any sample code. Can someone point me to some sample code on how to do this.

Thanks
essa

Combo Box Into Datagrid
Does anyone know how to put a combo list into a datagrid to perform a drop down list for data entry?

I'm using the ButtonClick event and now need to bind the column with the appropriate values. Any ideas?

Datagrid/combo Box Help
hey all,

I have a Datagrid linked to a table in an access database. I want to populate the 1st field oin the record of the datagrid with values from another table that the user can select using a drop down box in the datagrid control. i have searched extensivly but have found no sample code to put in the event click sub nor have i found any properties setting sor anything to help.

i am also just a beginning programmer so the more details the better. if anyone knows of a tutor or a book that would cover this i would greatly appreciate it!!

jason

Combo Box On A DataGrid?
Is it possible to have a combo box embedded in a datagrid? I've searched for this question already and didn't see any sample code. Can someone point me to some sample code on how to do this.

Thanks
essa

Datagrid Combo
I have a datacombo in a datagrid everything is working good but I would like to add another event to the button click. I want when the user click the button and it drop down a list of a table the user may select an option and then change de value on the next column of the grid. More clear I have a table called chart account with the fields Account No. and Type of Account and Account Name. The combo grid shows the account number when the user clcik the button on the grid then I want to place the fields Type of account and Account Name fields to the next columns. I have an idea how can I do that but it does not work I did like this;


Code:
Private Sub DataGrid1_ButtonClick(ByVal ColIndex As Integer)

If ColIndex = 1 Then

DataList1.Top = DataGrid1.Top + DataGrid1.RowTop(DataGrid1.Row) + DataGrid1.RowHeight
DataList1.Left = DataGrid1.Left + DataGrid1.Columns(ColIndex).Left

DataList1.Width = DataGrid1.Columns("1").Width
DataList1.Height = 1440
DataList1.Visible = Not DataList1.Visible

If DataList1.Visible Then
DataList1.Text = DataGrid1.Text
DataList1.ZOrder
End If

End If


With rschart
Datagrid1.columns(2).text = !AccType
Datagrid1.columns(3).text = !AccName
End With

End Sub


I got a message like this

"3265 Item can't be found in the collection corresponding to the requested name or ordinal"

Someone please help me

Edit by mkoslof: Added vb tags and spacing for easier reading. Thanks

Combo Box And Datagrid Help
i need a combo box that is able to list out all the tables in the access database, and on selection, the data in the selected table will be displayed on the datagrid bound on adodc..

can any1 help?
i've uploaded an example attachment

Combo Box On Datagrid In Vb.net
how to place a comobox in a column of a datagrid and get the selected item of it to save to database in vb.net

Combo Box Datagrid Vb6.0
--
HI guys i want to add a combo box to my data grid in vb6.0 so that user can
select a value and that get saved in database in access



Thanks in Advance

Combo Box In Datagrid
--Boundary_(ID_W2C/u7VIZ/VweLOM0qE5gA)
Content-type: text/plain; charset=iso-8859-1
Content-transfer-encoding: 7BIT

I have tried all the solutions which are provided in this forum but i was unable to get data in the combo box from the record source (access database).If anyone can help me in that it will be appreciated

Thanx
Abhishek

--Boundary_(ID_W2C/u7VIZ/VweLOM0qE5gA)
Content-type: text/html; charset=iso-8859-1
Content-transfer-encoding: 7BIT

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2600.0" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#c0c0c0>
<DIV><FONT face=Arial size=2>I have tried all the solutions which are provided
in this forum but i was unable to get data in the combo box from the record
source (access database).If anyone can help me in that it will be
appreciated</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanx</FONT></DIV>
<DIV><FONT face=Arial size=2>Abhishek</FONT></DIV></BODY></HTML>

--Boundary_(ID_W2C/u7VIZ/VweLOM0qE5gA)--

COMBO BOX IN DATAGRID
Hi All,

How do I implement a combo box in a datagrid. The record source of the combo box is a table.

Any help including code will be very much appreciated.

Thx.

Use Combo In Datagrid
Use combo in datagrid ...?

Combo Box In Datagrid
How Can I add a combo box in MS datagrid control 6.0 in visual basic 6.0?

Regards
Michael

Michael Sakellis
Athens-Greece

Combo Box On A DataGrid
This isn't working. What I'm trying to do is have a combo box appear when you click on certain column fields. Essentially, I want a column of combo boxs (using the DataGrid) and when you select the item within the combo box it populates the field associated within the DataGrid.


Can anyone help me with this?

Essa

Datagrid And Combo Box
i want to have a combo box option in a column of a datagrid.

how do i do that?


thank you in advance.

Combo Box And Datagrid Help
i need a combo box that is able to list out all the tables in the access database, and on selection, the data in the selected table will be displayed on the datagrid bound on adodc..

can any1 help?
i've uploaded an example attachment

How To Set A Combo Box In A Datagrid?
I know i can set a combo box in a datagrid by using the event "buttonClick".
But how to set it in the datagrid? Thanks for help.

Combo Box In Datagrid?
Is that possible to have a combo box in datagrid?

Row Selection On Datagrid From Combo
Hi

I have a datagrid which displays a lot of data from an SQL table. The first row is a part number.

I have a combo box with the relevant part numbers listed. All I want to do is select a part number from the combo box and have the datagrid select the row where the part number matches.

I originally had the datagrid set up so that when you selected a part number, it filtered the grid to display only that part number which worked well but unfortunately, I can't modify the data in that filtered view, only in the full list view.

Any ideas?

Thanks

My original code which filters on part number but doesn't remember any changes made. This is why I wish to select the row on the datagrid which matches the combo box entry and then I will be able find the record and edit it without it losing the changes.



Code:
Set cn = New ADODB.Connection
Set RS = New ADODB.Recordset

If cboPart.Text = "" Then 'if no part number is selected then list all parts
SQL = "SELECT Part, TaskType, TaskStatus, Batch, Source, Destination, Item, SourceQty, DestinationQty, UOM, UserId, Serial, Sort, DTAdded, DTUpdated, TaskSubType, SAPQty, Land1, Priority, HasHeaderText, HasLineText, HeaderText, LineText, Override, TaskStage From BR_TaskList ORDER BY Part"
Else 'else only list the records relating to the selected part
SQL = "SELECT Part, TaskType, TaskStatus, Batch, Source, Destination, Item, SourceQty, DestinationQty, UOM, UserId, Serial, Sort, DTAdded, DTUpdated, TaskSubType, SAPQty, Land1, Priority, HasHeaderText, HasLineText, HeaderText, LineText, Override, TaskStage From BR_TaskList WHERE Part = '" & cboPart.Text & "' ORDER BY Part"
End If

cn.Open "Provider=SQLOLEDB;Data Source=10.225.100.150;Initial Catalog=Live_MBC;User Id=sa"
cn.CursorLocation = adUseClient
RS.Open SQL, cn, adOpenDynamic, adLockBatchOptimistic

Set DataGrid1.DataSource = RS
DataGrid1.Refresh

DataGrid &amp; Combo Boxes
Hi all,

Does anyone know if you can add combo boxes to cells within a datagrid. If you can, how?

Any help would be appreciated.

Thanks.

How To Refresh Datagrid According To Combo Box ?
Hi,

In one of my forms I have a Combo Box with certain category names. I also have a Datagrid. I want that as the user clicks for an option in Combo Box the Datagrid should be refreshed accordingly with different queries. How to do this?

Combo And Datagrid Query
Hello,

I am using VB6 and Access. I have a datagrid on a form with a combo box.

The idea is that i want to select a name from the combo box and in turn populate the grid with data related to the name. So if I select PETER then I want to display any info against his name.

My query is called qryassigned and the field where the names are is called job assigned to.

When i select a name from the combo I get the following error:

Run time error 3001 - arguments are of the wrong type or are in conflict with one and other.

Thanks in advance.

Here is some code:

Code:
Dim WithEvents adoPrimaryRS As Recordset
Dim WithEvents adoPrimaryRS2 As Recordset
Dim WithEvents adoPrimaryRS3 As Recordset

Private Sub Combo1_Click()
Set adoPrimaryRS3 = New Recordset

adoPrimaryRS3.Open "SELECT * FROM qryassigned " & "WHERE job assigned to = " & "'" & Combo1.Text & "'", db, OpenStatic

Set grdDataGrid.DataSource = Nothing
adoPrimaryRS3.Requery
Set grdDataGrid.DataSource = adoPrimaryRS3

End Sub

Private Sub Form_Load()
Dim db As Connection
Set db = New Connection
db.CursorLocation = adUseClient
db.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=D:griddb1.mdb;"

Set adoPrimaryRS = New Recordset
Set adoPrimaryRS2 = New Recordset

'adoPrimaryRS.Open "select * from qrynotassigned", db, adOpenStatic, adLockOptimistic

adoPrimaryRS2.Open "select [username]from tblusername", db, adOpenStatic, adLockOptimistic

Do While Not adoPrimaryRS2.EOF
Combo1.AddItem "" & adoPrimaryRS2![username]
adoPrimaryRS2.MoveNext
Loop
adoPrimaryRS2.MoveFirst
db.Close

End Sub
Private Sub cmdRefresh_Click()
'This is only needed for multi user apps
On Error GoTo RefreshErr
Set grdDataGrid.DataSource = Nothing
adoPrimaryRS.Requery
Set grdDataGrid.DataSource = adoPrimaryRS
Exit Sub
RefreshErr:
MsgBox Err.Description
End Sub
Private Sub cmdClose_Click()
Unload Me
End Sub

Combo Box Inside A Datagrid !!!
hi frenz,

I have a tabstrip
Inside that i have a frame and inside frame there's a datagrid

Now what i want is if i click on a particular cell of the datagrid then a combo box should appear on that cell exactly with the same dimension of the cell.

plz help me urgently
prashant

Data Combo And DataGrid
how will I be able to do this?...

I have a Datacombo bounded to a table(Fields: Au_ID, AuthorName) and DataGrid bounded to a another table(Fields: Au_ID, BooksWritten). For my database, Im using MS Access. How can I make the DataGrid list only records that corresponds to Au_ID selected in the Datacombo ?

Thanks in advance...

COMBO BOX IN THE MSFLEXGRID OR IN DATAGRID
Hello to everyone,

How can use combo box in the MSFLEXGRD or In DATAGRID? Do anyone have any
idea. There is in KNOWLEDGE BASE 2 article exists but code is too much
longer (The article no, q201197)

Does anyone have any alternative method or any other ideas? If anyone knows
could you provide me the coding...?

Thanking you all in advance.

Regards
Arun

DataGrid Search Using Combo Box
Hi

I have a datagrid which displays a lot of data from an SQL table.  The first row is a part number.

I have a combo box with the relevant part numbers listed.  All I want to do is select a part number from the combo box and have the datagrid select the row where the part number matches.

I originally had the datagrid set up so that when you selected a part number, it filtered the grid to display only that part number which worked well but unfortunately, I can't modify the data in that filtered view, only in the full list view.

Any ideas?

Thanks

My original code which filters on part number but doesn't remember any changes made. This is why I wish to select the row on the datagrid which matches the combo box entry and then I will be able find the record and edit it without it losing the changes.

CODESet cn = New ADODB.Connection
Set RS = New ADODB.Recordset

If cboPart.Text = "" Then 'if no part number is selected then list all parts
    SQL = "SELECT Part, TaskType, TaskStatus, Batch, Source, Destination, Item, SourceQty, DestinationQty, UOM, UserId, Serial, Sort, DTAdded, DTUpdated, TaskSubType, SAPQty, Land1, Priority, HasHeaderText, HasLineText, HeaderText, LineText, Override, TaskStage From BR_TaskList ORDER BY Part"
Else 'else only list the records relating to the selected part
    SQL = "SELECT Part, TaskType, TaskStatus, Batch, Source, Destination, Item, SourceQty, DestinationQty, UOM, UserId, Serial, Sort, DTAdded, DTUpdated, TaskSubType, SAPQty, Land1, Priority, HasHeaderText, HasLineText, HeaderText, LineText, Override, TaskStage From BR_TaskList WHERE Part = '" & cboPart.Text & "' ORDER BY Part"
End If

cn.Open "Provider=SQLOLEDB;Data Source=10.225.100.150;Initial Catalog=Live_MBC;User Id=sa"
cn.CursorLocation = adUseClient '***VERY IMPORTANT TO AVOID ERROR 7004!
RS.Open SQL, cn, adOpenDynamic, adLockBatchOptimistic

Set DataGrid1.DataSource = RS
DataGrid1.Refresh

Combo Box In A Column Of Datagrid In Vb6
I am calling data through ADO and dumping into datagrid. The table structure is
Itemcode, Itemname, qty, rate, amount and remarks. I want that all the itemcode should dump into one combo bix in first col of datagrid and when i select the itemcode from itemcode combo box the itemname should be display on second cell automatically, and same for all the rows in datagrid.

Please help me to dump all the data in combo box in a column of datagrid in Visual Basic 6. nitin@alsahel1.com

Thanks & Regards,

Nitin

Combo Box Click / Keypress With Datagrid
Okay, I am trying to use a dropdown list in a datagrid and I've set up a combobox to do it. But, I'm having some problems with the combo box.

The biggest problem is when the user clicks the up/down arrows to navigate the combobox, the datagrid's row moves up and down accordingly too! Because of this, when I press Enter to save the chosen item to the grid, the row has now changed so it saves to the wrong row! Does anyone have any ideas at all why this is happening? I tried not allowing navigation on the datagrid and it still does it!


----
The other problem is, when the user finds what they want and click it, I need that written into the datagrid. Right now they have to click it, then press Enter to accept what they've clicked. If I put the code to write to the datagrid in the Click event, it does that even if a key was pressed...not just for a mouse click...so it thinks a keypress is a mouse click...then what's the point of the keypress events???

Combo Box In DataGrid Or FlexGrid [ * Not Resolved *]
How can i place a button or combo box either in the datagrid or in flex grid???

How To Place Make A Datagrid Combo
I wornder to know how to build a combo into a datagrid column??? Big question anybody know any method for this. At hte present time I trying to write a code but I cannot find any apropiate property for this.

thank you

Linking Datagrid To Data Combo Box VB6
I would like to be able to select an item in my combo box and have it displayed in the datagrid. (Both fields are in the same table.)
How do I do this using the Data Environment Designer?

Datagrid With Controls E G Textbox, Combo Box
Is there such a way that i could place a controls like Combo box, texbox inside a data grid control in VB 6.0 so that when i add a data onto the datagrid i will select a list in the control... or suggestion what control will i use? Thanks...

DataEnvironments And DataGrid/Combo Controls In VB6
Hi All,

I am developing an application using VB6 and as part of this I have created a new DataEnvironment, which connects to my backend database. I have created three commands within the connection, which are as follows:

cmd_profile - linked to a DataCombo box on the main form and displays data correctly
cmd_goals - Linked to a DataGrid on the main form and displays data correctly.  Has a FK relationship with cmd_profile.
cmd_goalDetails - Linked to another DataGrid on the main form and displays data correctly.  Has a FK relationship with cmd_goals

What I have been trying to do is to link the three commands, so that when the user selects an item from the DataCombo it automatically updates the two data grids.  I can get this working fine if I link cmd_goals and cmd_goalDetails (done by setting the relation in cmd_goalDetails to point to the matching field in cmd_goals), but if I try this with the cmd_profile command it all stops working - even the ones that were working previously.

I have determined that if I attach cmd_profile to a dataGrid instead of a dataCombo then it all works fine, so it is obviously something to do with the combo box.  I need to include the combo box in my application though....

Has anyone any ideas how I can fix this?

Thanks in advance


Andrew

DataGrid + Combo Example In ComboGrid2.zip Help Needed
I found a good example of how to use a comboBox in a dataGrid on this site and downloaded it some time ago. The file is called ComboGrid2.zip (I think, I only have the directory now).
I have a question about how it works but I can't remember who posted it and a search doesn't find it!

I have a grid working with the lookup data I need appearing in a combo in the right place (replacing the key field values). This works fine and gives me the interface I need.
The problem is that I need to allow the user to select from different tables so I need different versions of the grid to be set up for each table.
If I setup the grid during the Form_Load event everything is fine, but when I setup the grid after the form has loaded (as if it was a user defined event), it resets the first field in the first record to NULL and obviously fails to save the record.

Any ideas who created this example or how to solve this problem?

Cheers,


Mac

Copy Data From DataGrid Into Combo
Hello All members
The attached code allow the user to copy data to Combo box from datagrid.
I want if there is 2 same record,the combo will take only one record from the the same record
I hope you can understand my question

please check the attached code

Thanks alot for advice


Egyptian Man

Edited by - khaledagwa on 11/9/2004 12:51:43 AM

How To Display A Combo Box Or A Check Box In A DataGrid
Hi,

does anyone no how to convert a DataGrid cell from textfield to combo box that displays specific values when the user clicks on the cell?

From the DataGrid's property pages dialog box, I can select Layout tab, select the column I wish to change from the column combo box and then click on the Button check box. OK, this displays the combo box but it 's empty. How can I fill it with values?

How can I display a checkbox in DataGrid cell that is bound to a boolean value? I 've tried DataGrid's property pages dialog box, select Format tab, select the column I want from the combo box, click on CheckBox format type but don't see any difference.

Thanks in advance for your replies.

Best regards,

John.

Datagrid Along With Checkbox,dtpicker,combo
Thanx lot for solving previous problem datagrid connectivity with recordset by code. Now I need one more source code through which i can get datagrid along with checkbox,dtpicker1,combo1. Checkbox will be attached with first column of datagrid, dtpicker1 will be attached with 2nd column of datagrid like that.

Kindly help in this regard.

Thanks & Regards

Abhijeet

Using The Button In A DataGrid?
I noticed under the "Layout" tabe there is an option to add a button to a particular cell. When in runtime it appears to add a dropdown button to the cell.

My question is, how do I program values to that button? For instance I want the user to click the button and have an option to select either "Y" or "N". Then put whatever value they select into that cell. Can anyone please help?

Datagrid Button
I would like to ad a button to a datagrid and program with it. Can I only do this with a web form and not vb? I want add a button to select the row and then display a new page. My datagrid is working from a sql server db from a stored procedure. Any help on the best route to take? Thanks.

Button On The Datagrid.
i am new on VB6 . and i wan to create the datagrid wif the button. mean when i click the button . if will show me the details of the record or pop me to others window. Can i do that ? or anyone of u have an others suggestion ??

Datagrid And Button
Hello there

Can someone tell med how to link a combo box to cell in a datagrid. (Datagrid.Columns.Add(4).Button = True)


Best regards
Pet

DataGrid Button
I'm trying to use the datagrid button, however I don't understand the syntax of it, does anybody know how to use it or of a place that has a sample

Thanks PJC

VB6 DataGrid And 'the' Button
VB allows one to add a button to a datagrid column at design time but I cannot find any description of how to populate a drop down list that might result from clicking the button at run time.  I've read every book on VB6 I own, checked the MSDN, read FAQs, etc.  I've spent the last hour cruising this site looking but, alas, I still don't know how to populate that list (or even if its possible).

I would appreciate help even if it only points me toward a good book that deals with the subject.

thanks

jtp

Button In Datagrid
I have a database with filenames and now i want to display those files in the second column of a datagrid. In the first column there must be a commandbutton. If you press this button, the file in that row must be opened.

Bert Apperlo

Datagrid And Button
I am working on a datagrid and would like to
provide a combo box type control when on a particular
column of the grid.

Some documentation I have looked at has mentioned that "You can then write code to drop down the
desired control from the cell". It then procedes
to tell you NOTHING. Thanks MSDN!!

If anyone knows how to display a control as if it
were part of the datagrid I would be extremely
grateful.

Thanks Everyone!!

Copyright © 2005-08 www.BigResource.com, All rights reserved