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

Home Posts Topics Members FAQ

listview column: clicking via code

I'm trying to fire the ColumnClick event for a Listview control remotely.
Problem is, I'm not sure what parameters to pass.

Here's the sub header for the event:

Private Sub Files_listview_ColumnClick(ByVal sender As Object, ByVal e As
System.Windows.Forms.ColumnClickEventArgs) Handles Files_listview.ColumnClick

I'm *assuming* I can just use the listview control as the sender-- but I
have no idea what to use for e. I've dug through the docs and tried all
sorts of things but I get error messages that are unhelpful.

Now, I could be wrong in what the sender should be (the column itself
perhaps?) but regardless I am clueless on what to send for the
ColumnClickEventArgs and neither leaving the parameter blank nor using the
Nothing keyword are acceptabable.

Any and all help appreciated.

Thanks,

Randall Arnold
Nov 21 '05 #1
2 1581
Use the index of the column you want to click:

Dim yourIndex as Integer = 2

Files_listview_ColumnClick(yourlistview, New
ColumnClickEventArgs(yourIndex))
"Randall Arnold" <Ra***********@discussions.microsoft.com> wrote in message
news:05**********************************@microsof t.com...
I'm trying to fire the ColumnClick event for a Listview control remotely.
Problem is, I'm not sure what parameters to pass.

Here's the sub header for the event:

Private Sub Files_listview_ColumnClick(ByVal sender As Object, ByVal e As
System.Windows.Forms.ColumnClickEventArgs) Handles
Files_listview.ColumnClick

I'm *assuming* I can just use the listview control as the sender-- but I
have no idea what to use for e. I've dug through the docs and tried all
sorts of things but I get error messages that are unhelpful.

Now, I could be wrong in what the sender should be (the column itself
perhaps?) but regardless I am clueless on what to send for the
ColumnClickEventArgs and neither leaving the parameter blank nor using the
Nothing keyword are acceptabable.

Any and all help appreciated.

Thanks,

Randall Arnold

Nov 21 '05 #2
Beautiful! Worked right off the bat. The only thing I hadn't tried was the
"New" keyword. I didn't think about why I had to at first but I get it now.
Thanks!

Randall

"Some Guy" wrote:
Use the index of the column you want to click:

Dim yourIndex as Integer = 2

Files_listview_ColumnClick(yourlistview, New
ColumnClickEventArgs(yourIndex))
"Randall Arnold" <Ra***********@discussions.microsoft.com> wrote in message
news:05**********************************@microsof t.com...
I'm trying to fire the ColumnClick event for a Listview control remotely.
Problem is, I'm not sure what parameters to pass.

Here's the sub header for the event:

Private Sub Files_listview_ColumnClick(ByVal sender As Object, ByVal e As
System.Windows.Forms.ColumnClickEventArgs) Handles
Files_listview.ColumnClick

I'm *assuming* I can just use the listview control as the sender-- but I
have no idea what to use for e. I've dug through the docs and tried all
sorts of things but I get error messages that are unhelpful.

Now, I could be wrong in what the sender should be (the column itself
perhaps?) but regardless I am clueless on what to send for the
ColumnClickEventArgs and neither leaving the parameter blank nor using the
Nothing keyword are acceptabable.

Any and all help appreciated.

Thanks,

Randall Arnold


Nov 21 '05 #3

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

Similar topics

2
by: John Lauwers | last post by:
I know you can edit the first column of the listview control, is there a way to edit the second and/or the other columns? greets John
6
by: Richard | last post by:
Hi. I use a ListView to display data in tabular form. Each ListView row corresponds to a data record. The ListView Item of the record is the record key or code. Each SubItem in that row...
0
by: Steve | last post by:
I'm using a ListView control in conjunction with a TreeView control to display SqlServer database records. Clicking a Node in the TreeView refreshes the ListView with the content of the associated...
3
by: Steve | last post by:
I have windows form with ListView control. The ListView control has few columns which user can sort by clicking the column header. I want the column header have the small triangle indicator of...
9
by: Kevin Westhead | last post by:
Can anyone confirm whether or not there are any limits imposed on the widths of autosized columns in a list-view. I've found that the autosizing appears to have an upper limit, i.e. it will not...
1
by: Alex Levi | last post by:
How it is possible to sort ListView by clicking on the column when I have numeric values (as string) in the column? I tried to add numeric values into the listview, but it addes them as strings. ...
0
by: Terry Brown | last post by:
I have a form which contains a listview item. The form is created to view data that is generated by interaction with a separate form. There are buttons on the form that change the data source...
10
by: Rob | last post by:
VS 2005 How can you tell if a value is contained in a specific column (let's say column 1 named Status) of a ListView ? In a list box you could go... If ListBox1.Items.Contains(strWhatever)...
6
by: Brandon McCombs | last post by:
Hello, I have a form that contains a listview on the left side and a column of buttons on the right side. Only some of the buttons do I want enabled all the time. The other buttons should be...
1
by: =?Utf-8?B?TWFyayBDb2xsYXJk?= | last post by:
Hello I've added a listview to my WinForms C# 2.0 application. The listview is displayed in Details view and has the FullRowSelect property set to true. I'm using the listview control like a...
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...
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...
1
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.