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

Home Posts Topics Members FAQ

Select/Highlight a DataGrid Row after Sorting

26 New Member
I'm working in VS 2003.

I have a datagrid and its AllowSort property is set to true.

The columns of my grid are Inv No, Inv Desc and Apply To.

I added a function that will Search for an Apply To..Say I input "2123" in the textbox, then it will highlight the row from the datagrid with Apply To that is 2123.

The problem happens when I click the column headers so that it will be sorted.

Let's say on the first highlighting, it highlights the value 2123 that is in the 2nd row..Then after I sorted the columns, it still highlights the second row eventhough Apply To is not 2123.


Thanks guys..
Jan 7 '09 #1
3 1791
Plater
7,872 Recognized Expert Expert
I have that same problem.
The only thing I can think of is that you would have to run the "last search" again automatically
Jan 7 '09 #2
kurtzky
26 New Member
yup, but it takes a long time to execute it, and the system is hanging. actually the main problem is that the datagrid.Select () method has an integer overload and that is the row number. I don't know how to change the datasource of the grid (a faster one) once I click the column headers. 'Coz it still selects the previous row number/s even though the values are not the one that I'm looking for.
Jan 7 '09 #3
kurtzky
26 New Member
ok..this problem has already been solved.
Jan 8 '09 #4

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

Similar topics

1
5015
by: Gerg | last post by:
The datagrid has a tablestyle applied to it, and there are DataGridTextBoxColumn and each DataGridTextBoxColumn has an array of DataGridTextBox objects. Private Sub highlight(ByVal str As String) Dim myTextBoxcolumn As DataGridTextBoxColumn Dim myTextBox As DataGridTextBox 'loop through the cells of the datagrid, searching for the string
2
945
by: DelphiBlue | last post by:
I have a Nested Datagrid that is using a data relations to tie the parent child datagrids together. All is working well with the display but I am having some issues trying to sort the child datagrid. HTML Datagrid1 TemplateColumn Table Header information Detail Information
4
2447
by: Bruce Pullum | last post by:
I have a datagrid that I am using a DataView with. All works great for the sorting of the columns. However, after I sort the column, and then try and select a data row to edit, the row selected represents the indes of the actual DataGrid and not the DataView. For example.. Lets say I have 4 rows of data.. In the 4 rows I have an Appt Num of 1,2,3,4... Each representing a data row... I sort DESC so the rows display 4,3,2,1... If I...
2
5469
by: Bajgon | last post by:
Hello, I have got a DataGrid and a DataTable, which is its DataSource. I can use DataTable.Rows.Find(key_value) method to locate any row in the DataTable, using values of key column. The result is a DataRow object. How to find and select the current position of this DataRow in the DataGrid control?
2
2441
by: Bob Hollness | last post by:
Hi group. I am a newbie to ASP.NET as you will see from some of the questions I may ask! I have a datagrid which I have populated from a database. It works great! I have added a column, via the Columns dialog box from the properties of the datagrid, on the left that contains a select button. So now, when you press the button the whole row is highlighted. Now, what I want to do is have the user highlight as many rows as they wish...
0
1081
by: Sinan | last post by:
Hi I am using a datagrid with a Select Column and the SelectedIndexChanged event captures the values of the cells in the selected row. It works fine before sorting any column. The problem starts when I sort a column and then select a row, it gives me the data of another row! Not the row I have selected Any idea what is going wrong? Your help is highly appreciated Here is the sort procedure I am using
6
3443
by: LU | last post by:
A)I build a datagrid based on a calendar date selection. B)When user clicks a button column on the datagrid I want to highlight this row. I use the code below to highlight the row. ***** CODE TO HIGHLIGHT ROW Sub Datagrid_ItemCommand(ByVal s As Object, ByVal e As DataGridCommandEventArgs) If e.CommandName = "ViewUnitRequest" Then e.Item.BackColor = System.Drawing.Color.LightGray
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...
2
6794
by: Andy Baker | last post by:
I have a VB.NET 2003 application that uses several datagrids. The behaviour I want from the datagrid is to select (highlight) the entire row when I click on any cell in a row. I have done this using code from syncfuson.com to create a class that inherits from DataGridTextBoxColumn and overrides the its Edit method. i.e. Public Class DataGridNoActiveCellColumn Inherits DataGridTexBoxColumn Private SelectedRow as Integer
0
9684
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
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,...
0
10236
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...
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...
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();...
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
2
3734
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
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.