473,473 Members | 2,120 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

selected row visible

Hi

The following code is in the load event of a form.
When the user rightclicks on a row in a datagridview, the selected
information is passed on to this form.

Dim tbl As New Data.DataTable

tbl = Me.grd.DataSource

Dim strSelect As String
Dim ab As Integer

strSelect = ""
For ab = 0 To tbl.Columns.Count - 1
strSelect += tbl.Columns(ab).ColumnName + " LIKE '" + myRowData(ab)
+ "'"
If ab < tbl.Columns.Count - 1 Then strSelect += " AND "
Next

Dim foundRows() As Data.DataRow
foundRows = tbl.Select(strSelect)

SelRow = foundRows(0).Table.Rows.IndexOf(foundRows(0))

Me.grd.Rows(SelRow).Selected = True

' now move the current cell to the top
Me.grd.CurrentCell = Me.grd.Rows(SelRow).Cells(0)
Me.grd.FirstDisplayedScrollingRowIndex = SelRow
In the datagridview of the second form, I want the selected row to show up
at the top of the datagridview.
But it is not happening.

Nothing seems to happen with the last line, which should do the job.

Who can help me with this?

rg,
Eric


Aug 27 '08 #1
0 943

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

Similar topics

1
by: DC Gringo | last post by:
I'm having such a problem with this DropDownList in a user control that is posting back and throwing an error: System.Web.HttpException: A DropDownList cannot have multiple items selected ...
8
by: Zlatko Matić | last post by:
There is a form (single form) and a combobox. I want that current record of the form is adjusted according to selected value in the combobox. Cuurrent record should be the same as the value in the...
3
by: Randy Rubin | last post by:
Does anyone know how to Make an Item selected in a DropDownListBox when Binding it to data. When it changes it populates another TextBox but the DDLB does not retain it's selected value. Thanks...
5
by: Patrick.O.Ige | last post by:
I'm binding a CheckBoxlist below in the ItemDataBound(the CheckBoxList is in a Datalist) By doing "li.Selected = True" i can see all the checkBoxes are selected. But what i want is to be able...
3
by: xianxian | last post by:
Hi guys, I'm having trouble getting my Datagrid to display according to Checkboxes checked values. On my Checkboxes, I have 5 values :- 1) Apartment/Condo 2) Executive Condo 3) Detached 4)...
3
by: Karl Rhodes | last post by:
I have a datagridview which is populated via a datatable. What I would like to dynamically set a selected row and have that row show up in the datagridview and not have to manually scroll to find...
3
by: rukkie | last post by:
I've made a webform in which some selection boxes are incorporated. Once the form is submitted the user can display the form again and all the options selected are highlighted (via the "selected"...
6
by: probashi | last post by:
Hi, Issue: After post back selected item of a list box is getting out of focus (when it contains more items than it's size). I have a List Box in an ASPX page. I select an item from the...
2
by: ngchaitra | last post by:
Hi, I have to display tables based on the selected listitem. Suppose if the selected item of the listbox is "Pulse pressure" then table "Tbpulse" has to be visible else table "Tboth" has to be...
3
by: ladycyradis | last post by:
Hi, I'm new here and have a bit of a problem. I'm building a form in Access 2003 and have a piece of code I'm using to ensure that the correct values are saved in the table when each option is...
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...
1
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...
0
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...
0
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,...
1
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...
0
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...
0
muto222
php
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.