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

How can I access the selected row value in datagrid in .vb.net

77
Hi,
How can I access the selected row value in datagrid in vb.net?
Aug 12 '08 #1
6 3302
Plater
7,872 Expert 4TB
Well first, lets establish which object you are using.
DataGrid(should be avoided)
DataGridView(prefered)
GridView(Web only)
Aug 12 '08 #2
Sep410
77
I am using datagrid because I need to have child and parent grid.
Aug 12 '08 #3
Plater
7,872 Expert 4TB
I wasn't aware the others didn't do it. But whatever.
DataGrid's have a .CurrentCell that will give you the selected cell, which contains the row number and the column number. You can use the row number to access everything in the selected row from your datasource.
Aug 12 '08 #4
Sep410
77
Can you explain more because I don't think I can have access to selected row value. I don't know where to use this selected row index.

datagrid does not know this:

MyDataGrid.Row(MyDataGrid.currentRowIndex).cell(). ..
Aug 12 '08 #5
Plater
7,872 Expert 4TB
If you have the RowIndex, just go to that row in your datasource and examine the row's contents.
Should not be hard.
Aug 12 '08 #6
Sep410
77
Thanks.
I used datagrid datasource and it is working.
Aug 12 '08 #7

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

Similar topics

4
by: Steve | last post by:
Visual Studio 2003 .Net / C# I have a datagrid, which is bound to a dataset at runtime when my page loads. When the user double clicks a row, I need to find out which row they have selected so...
1
by: Empire City | last post by:
I have an ASP.NET form with a DataGrid and Button. I want to put a RadioButtonList in a DataGrid cell. I bind it to an ArrayList which has a ListItem in the cell. The display part works fine. I...
6
by: Jenna Alten | last post by:
I have a datagrid with a template column that contains a dropdown list. I currently fill and display the dropdown list on the page load. This is working correctly. I am NOT using an Edit Column. I...
4
by: awalker1 | last post by:
Hi all, I have a datagrid and a drop down list on my page. The DataGrid is created dynamically at runtime to contain columns based on the item that the user has selected from the drop down...
3
by: DC | last post by:
Hi all (once again), I've populated a datagrid with an arraylist of objects of this class i've created. How can I get the select object in the datagrid? TIA, DC
0
by: John Smith | last post by:
This is what I am trying to do: <asp:datagrid id="DataGrid1" runat="server" AutoGenerateColumns="False"> <Columns> <asp:BoundColumn Visible="False" DataField="id" ReadOnly="True"...
0
by: John Smith | last post by:
This is what I am trying to do: <asp:datagrid id="DataGrid1" runat="server" AutoGenerateColumns="False"> <Columns> <asp:BoundColumn Visible="False" DataField="id" ReadOnly="True"...
9
by: Wayne Smith | last post by:
I've come up against a major headache that I can't seem to find a solution for but I'm sure there must be a workaround and I would really be grateful of any help. I'm currently building a web...
6
by: yasodhai | last post by:
Hi, I used a dropdown control which is binded to a datagrid control. I passed the values to the dropdownlist from the database using a function as follows in the aspx itself. <asp:DropDownList...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
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
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,...
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...
0
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...

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.