473,671 Members | 2,183 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

TopItem & ListView [Win C#]

Hi Everyone,

I am trying to ensure displayed items at the top most portion of my ListView
when being added to my ListView, no matter where the items are being added
with in the listview. So that the users can easily find where their added
items are located. Can this be accompished with "TopItem"?? ? My code is as
follows:

foreach(ListVie wItem ListView_Item in this.lvBody.Ite ms)
{
if(listViewItem .Text ==
ListView_Item.L istView.Items[Loop_Counter].SubItems[0].Text)
{
//Ensure that Scroll always has focus for last item
this.lvBody.Ens ureVisible(Conv ert.ToInt32(Loo p_Counter));
//????
ListView_Item.L istView.Top.Sub Items[0].ResetStyle();
}
Loop_Counter += 1;
}

Hopefully there is a solution for this. Any and all hellp is appreciated.

MikeY


Dec 30 '06 #1
1 2662
You might want to use 2 Listview to do it, one with hierarchy and another
one without.

chanmm

"MikeY" <mi*******@yaho .comwrote in message
news:uo******** ******@TK2MSFTN GP03.phx.gbl...
Hi Everyone,

I am trying to ensure displayed items at the top most portion of my
ListView when being added to my ListView, no matter where the items are
being added with in the listview. So that the users can easily find where
their added items are located. Can this be accompished with "TopItem"?? ?
My code is as follows:

foreach(ListVie wItem ListView_Item in this.lvBody.Ite ms)
{
if(listViewItem .Text ==
ListView_Item.L istView.Items[Loop_Counter].SubItems[0].Text)
{
//Ensure that Scroll always has focus for last item
this.lvBody.Ens ureVisible(Conv ert.ToInt32(Loo p_Counter));
//????
ListView_Item.L istView.Top.Sub Items[0].ResetStyle();
}
Loop_Counter += 1;
}

Hopefully there is a solution for this. Any and all hellp is appreciated.

MikeY

Jan 1 '07 #2

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

Similar topics

1
6043
by: Daisy | last post by:
I'm writing a NewsReader (seemed like a decent project to start learning with), and want threading like in OE. I've got a treeview and a listview. On Expand/Contract on the listview, I spin through the nodes checking .IsVisible, and those that are visible, I take the info I need (posted name / date) out of the .Tag (is there a better place to put this?), and add them to the listview. For now, it loops from the top, though it might be...
3
3193
by: Menu Chen | last post by:
我用LISTVIEW控件的时候,想限制用户对控件列大小的调节 但是找遍了LISTVIEW的属性,没有实现该功能的 另外,如果实在不能限制用户对列大小的调节的话,起码不要显示水平滚动 条,因为那会比较难看,可以吗?
10
2270
by: Vinay | last post by:
Hi, Is there a limit on maximum number of columns in listview control ? I am finding: In a listview control (Report Format) I am displaying a record with 400 fields. I am creating its column names dynamically (Field-1, Field-2 ...). What I am finding after Field-362, column names are just blank but in the data row text is being displayed properly till 400th
6
2505
by: a | last post by:
Hello, I am doing some multithreading in an MDI app, and I can't seem to get the cursor to stay as an Hourglass. I call: Cursor.Current = cursors.wait at the beginning of my routing, and set it back to cursors.default when the thread ends (using a callback)
5
2363
by: Martin Horn | last post by:
Hi all, I want to implement a listview with editable subitems and I assume the easiest way is to overlay a textbox over the item to be edited. With this in mind I have come up with: Using fullrowselect=true in the listview Private Sub ListView1_ItemSelectionChanged(ByVal sender As Object, _
3
1308
by: MikeY | last post by:
Is There a way of managing individual Listview columns when it comes to Color, Text size, etc.? If so, does anyhow have any helpful suggestions on how to do this feat? If So, there is a sample of my code below: private void Create_LV_Headers() { //Index Header
2
2442
by: win | last post by:
The SortKey of VB6 is not in .Net. Can I still do sorting using a listview? Thanks
4
1592
by: =?Utf-8?B?RXRoYW4gU3RyYXVzcw==?= | last post by:
Hi, I have just started building an application which is windows form based, rather than web based, and I am having troubles with layout. I can't find any control which gives me just a simple text list! There is ListView, but that gives me very strange spacing, perhaps because it is trying to put in icons? There are Flow and Table layout panels, but those also give me strange spacing. I just want the Windows Form Equivalent of an HTML...
4
7460
by: Brandon | last post by:
HI all, I am working on a WPF listview that get items through the XMLDataProvider and making a listview with two actual columns and in both CellTemplete XAML in a grid bind more than one snippet of the XML data to the cell. Now this works fine no problem... When I try to setup a IsSelected trigger I lose the default listview selection UI and only the new look of the ListViewItem after the trigger takes effect shows what Item is...
0
8474
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
8392
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
8819
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
8669
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
7428
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
6222
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
5692
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();...
2
2049
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1807
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.