473,826 Members | 3,650 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.F ields("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 1319
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 "dataadapte r 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.publi c.dotnet.framew ork.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
7939
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 header of the datagrid in the "ItemDataBound" method of the grid. However, once, they are added in the grid, i seem to lose the event handler for the same control. Is there anyone who has tried this before and knows why this is hapenning ??
2
9931
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 (multi-select without modifier keys). I got that working fine, but I also wanted to keep rows selected after a sort, which I do by storing the row's id in an arraylist. The idea was to do the sort and then go back and re-select the rows with that...
6
1728
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 I tell that the user has reselected a different set of rows in a datagrid.
0
1435
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 newsgroup, I found out how to detect if CTRL is pressed while in my MouseUp event, which is when it's supposed add that row to the selection. (Otherwise, if the CTRL key is not pressed I clear any current selection to start over- just like Explorer) ...
1
3387
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 left-clicking them, but each time I click another row to add it to the selection the previously added row loses it's highlighting, so it appears as though only one row is selected at any one time.
6
3340
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 different rows in the datagrid, the textbox content doesn't change to reflect the change. How can I address this? Also, If the user change the text in the textbox then how do I refesh the display in the datagrid to reflect the changes? ...
3
2380
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 but the changes do not appear when a row is clicked. What do I need to do to get it to do selection? =================================================== Zachary Hilbun Software Consultant http://www.vianova.com Via Nova OpenGL,...
1
2128
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). Both ASCXs have DataGrids on them. The first user control's DataGrid is populated from our database on page load. The DataGrid also has a Select LinkButton.
5
344
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
2501
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 them. In a plain vanilla DataGrid, when you click on the RowHeader, the appropriate row changes colors. I ASSUME this should be done in the Paint (or PaintText) override of the DataGridColumnStyle in question. My problem is that I don't know...
0
9771
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
10745
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10464
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...
1
10503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10183
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...
0
9290
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5610
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...
1
4404
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3947
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.