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

Datagrid selection

Hi There,

I have a form with a datagrid, and some text/combo-boxes and a button.
When I select a record in the datagrid an press the button I want to
see the valeus of the cells from tehe selected record in the
text/combo-boxes.

At this point I only get the first record shown even when i select the
second record.

The code for showing the values is:

edtTitel.Text = m_rstTblFilms.Fields("Titel").Value

But I cant find anywhere a code to let it apply on the selected
record.

Can anyone show me the right direction???

ps. I'm using an ADODBconnection
Nov 20 '05 #1
5 1303
Hi Niels,
I have a form with a datagrid, and some text/combo-boxes and a button.
When I select a record in the datagrid an press the button I want to
see the valeus of the cells from tehe selected record in the
text/combo-boxes.


I do not understand that at all, you select a record in the datagrid, you
push on a button, and want to see the selected values from the selected
records in the text and in the comboboxes.

Where do you want to see the values and what values you want to see?

The code you are showing is how to set a field from a recordset row in a
textbox nothing more.

Sorry, I real have tried 5 times to understand what you are after.

Cor
Nov 20 '05 #2


the datagrid is for viewing an selecting only
I want to be able to make changes in the text and comboboxes.
So when I have 3 colums in the Datagrid (lets say: Name, Adress and
city) each colum is linked to a box. (like a fill-in form)

My next step is to try to save the changed values into the database
again.

I'm still a beginner in programming in VB.net so 'm trying to find out
what is possible and how to program those things.

I hope you understand better now.

Anyway thanks for your reply

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #3
Hi Niels,

You are using a recordset, that makes it very difficult to work with a
datagrid.

When you want to use that recordset, than you have first to make from your
recordset a kind of table, there are a lot om those you can take however not
the recordset because that does not fit on a datagrid, while a datatable is
the most easy one.

You have to bind that table to the datagrid and you can fill the table one
by one using those textboxes and comboboxes as you said.

Than you have to update your recordset with that table again

And than you can update it to your database.

And that while there are much more easier ways to go.

Did you ever look in the resource kit to those very simple samples.

VB.net Resource kit
http://msdn.microsoft.com/vbasic/vbrkit/default.aspx

And if you have problems installing the resource kit
http://msdn.microsoft.com/vbasic/vbr...q/#installvdir

There are in that resourcekit very few update databasse commands, when you
are that far reply here or look at the "dataadapter update" and do not
forget the "commandbuilder".

The one you sure forget is to take care of the last update with the
"endcurrentedit".

However you can start and ask your questions in this newsgroup, you sure get
answers.

You can crosspost it to the newsgroup,
microsoft.public.dotnet.framework.adonet than as well.

I hope this helps?

Cor


Nov 20 '05 #4
My intension is to make a kind of fill-in form
The Datagrid will only be for reading an selecting.

When a record is selected and I press the button the values of each cell
in the selected record will be copied to the text an comboboxes so that
I can edit them.

The next step will be to save the edited values into the database.

Maybe this is not the effective way, but i'm a beginner in programming
VB.net and I'm exploring what is possible an how to program.

I hope you understand, what I'm trying to explain :-)

Anyway, thanks for your reply

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #5
Thanks for the reply, i'm going to have a look at all of it.

The RecourceKit cd didnt work for me i got installation errors. so i'm
going to try the suggestions you made.

Thanks again for all.

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #6

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

Similar topics

8
by: Ashish Shridharan | last post by:
Hi All I have been trying to add a control to the header cell of a datagrid on my ASP.NET page. These controls are defined in the HTML as ASP.NET web controls. They are being added into the...
2
by: Chris Plowman | last post by:
Hi all, I was wondering if anyone can help me with a really annoying problem I have been having. I made a derived datagrid class that will select the row when a user clicks anywhere on a cell...
6
by: BBFrost | last post by:
I'm using Net 1.1 (2003) SP1 & Windows 2000 Here's the issue ... Rows 12 thru 24 are selected in a datagrid. The user now unselects rows 12 thru 24 and selects rows 45 thru 70 ??? How can...
0
by: MrNobody | last post by:
hey guys... I'm trying to make my DataGrid have selection behavior similar to WindowsExplorer, where I can hold CTRL to add rows to a multi-row selection. Thanks to someone else on this...
1
by: MrNobody | last post by:
Is it at all possible to override the default behavior of a DataGrid when the mouse is clicked on a row? I am having a problem where I am trying to select multiple rows in a DataGrid by...
6
by: Alpha | last post by:
I have several textboxes that I need to chang the text when the selection row is changed in a datagrid. I have the following code. This textbox displayes the initial selection but when I click on...
3
by: Zachary Hilbun | last post by:
I'm using a DataGrid control in a web form. I can display it using binding but when I click on any of the items there is no feedback that that row has been selected. I changed SelectedItemStyle...
1
by: thegame | last post by:
Filling One DataGrid Based on Selection from Another DataGrid - Both in Separate User Controls Hello, I have an interesting dilemma. I have an ASPX page with two user controls (two ASCXs). ...
5
by: I am Sam | last post by:
I have a rather complicated problem I need to sort out and wonder if anyone can assist me. The ingredients: Two DropDownList Controls One DataGrid Purpose of Page:
13
by: pmcguire | last post by:
I have a DataGrid control for which I have also created several new extended DataGridColumnStyles. They behave pretty nicely, but I can't figure out how to implement Selected Item formatting for...
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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
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...
0
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...

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.