473,796 Members | 2,648 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can I select a row in a DataGrid and show that row?

Hi,

I use a DataGrid and I have a search on a specific value in a dataset. Once
I find the row that contains the value, I would like that row to be visible
in the datagrid window, in other words, to scroll up to that particular row
to be the first or last in the visible part of the grid.

Any suggestions please?
Thanks,
Doru
Mar 13 '06 #1
2 5280
You can set the CurrentRowIndex property to ensure that the row is visible
and you can use the Select method to select (highlight) the row.

--
Tim Wilson
..NET Compact Framework MVP

"Doru Roman" <do*******@roge rs.com> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
Hi,

I use a DataGrid and I have a search on a specific value in a dataset. Once I find the row that contains the value, I would like that row to be visible in the datagrid window, in other words, to scroll up to that particular row to be the first or last in the visible part of the grid.

Any suggestions please?
Thanks,
Doru

Mar 13 '06 #2
Thanks Tom,
I used CurrentRowIndex too but because of some other bad code it did not
work. Now it does.
Mar 14 '06 #3

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

Similar topics

2
9927
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...
0
1804
by: Raj Chudasama | last post by:
how can i select all rows in a datagrid also how can add checkbox to each of my rows in datagrid. I tried to use DataGridColumnStyle but failed try {
1
1939
by: Joey | last post by:
I am using a datagrid with a SELECT button to determine which record to delete. The code behind pulls the selected item's record number (via a hidden column) in the grid with SelectedItem.Cells.Text, and then uses a stored procedure to delete the record. I need to wire up a javascript confirmation dialog (Are you sure you want to delete this record? Yes/No) to it. Any suggestions on how to do this?
1
1959
by: chreo | last post by:
Hello. Does anybody had problem with VB application with MS SQL Database? I have DATAGRID which shows TABLE from DATABASE. Next I add new ROW to TABLE with SQLcommand (stored procedure) Command works everytime - I see in database that new rows are added.
1
7117
by: Mrozu | last post by:
Hi I need execute SELECT SQL query in DataSet. No in SQL server(da.selectcommand) and fill dataset, only show in datagrid filtered by select-where query records from dataset:) For example I fill dataset(ds) da.selectcommand.commandtext="select * from xxx" da.fill(ds.tables(0)) and when i write
4
2886
by: Geoff | last post by:
Hi Can anybody tell me how to prevent multiple selections of rows in a datagrid? Also, can anybody tell me if the following are available in the latest version of the DataGrid i.e. in visual studio 2005? Auto column width i.e. the width of the column is set according to the data in each column.
0
1045
by: savvy | last post by:
savvy Feb 1, 4:23 pm show options Newsgroups: microsoft.public.dotnet.framework.aspnet From: "savvy" <johng...@gmail.com> - Find messages by this author Date: 1 Feb 2006 08:23:19 -0800 Local: Wed, Feb 1 2006 4:23 pm Subject: How to Pre-Select a DataGrid Row Radiobutton ? Reply | Reply to Author | Forward | Print | Individual Message | Show original | Remove | Report Abuse
3
2299
by: Ryan Liu | last post by:
Can someone give a sample to prevent a row from being deleted in a datatable? I tried e.Row.RejectChanges(); in dt_RowDeleting() but seems does not work. I need verify if there other data using data in this row before actually remove it from datagrid. I can certainly control with Delete button. But if I want to allow the user to use Del key on the keyboard, I lost this kind control.
1
1166
by: Wan | last post by:
Hi, I have a test project which contains two simple forms - 1st form contains datagrid and couple of buttons. First button to populate the grid with Northwind.Customers records and show 3 columns - CustomerID |CompanyName| ContactName - works fine. 2nd button to bring up the second form contains a datagrid with customer records with no sorting or order by. The problem is that when I select one of the customer records and try to show...
3
4972
by: =?Utf-8?B?TWlrZSBD?= | last post by:
I have a SQL 2000 table named IMSRejects with the fields: IMSRejects.ProductDescription IMSRejects.VendorName IMSRejects.CatalogNumber IMSRejects.ProductIMS2Desc IMSRejects.CMA8Desc Many of the ProductIMS2Desc and CMA8Desc values are Null. I have an ASP.NET 2.0 web page which populates a datagrid with this data. I also have text boxes on my web page so users can filter the datagrid based on keywords. The problem I'm having is that the...
0
9530
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10182
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
10017
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
9055
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...
1
7552
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6793
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5445
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
4120
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
3
2928
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.