473,387 Members | 1,536 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

OnDrawColumnHeader and LIstView

Hi,

I have some little issue when i want to redraw the columnHeader of my
ListView.
Basically i display a little arrow to show the sortOrder of each column.
For sure only the clicked column is sorted.

here is my code located in OnDrawColumnHeader overriden method:
....
if(e->ColumnIndex == this->m_LastClickedColumn)
{
if (this->Sorting == SortOrder::Ascending)
{
e->Graphics->DrawString("t", ArrowFont,
System::Drawing::SystemBrushes::ControlDarkDark, arrowRect, strForm);
}
else if (this->Sorting == SortOrder::Descending)
{
e->Graphics->DrawString("u", ArrowFont,
System::Drawing::SystemBrushes::ControlDarkDark, arrowRect, strForm);
}
}
else
{
e->Graphics->DrawString(" ", ArrowFont,
System::Drawing::SystemBrushes::ControlDarkDark, arrowRect, strForm);
}
....

unfortunately, the arrow is drawn correctly in the clicked column, but
if arrow was drawn in some other column, it does not disappear after 1
click...

for example :

i click column header 2 (arrow is on column header 2)
i click column header 1 (arrow is on column header 1 and still drawn on
column header 2)
i click again on column header 1 (arrow only appear on column header 1
and nowhere else)...

where could be the problem ?
I have the feeling that component does not redraw all column
headers...but only the ones which are close to the one i clicked..

Alain
Oct 30 '06 #1
3 2239
>I have some little issue when i want to redraw the columnHeader of my
>ListView.
Basically i display a little arrow to show the sortOrder of each column.
For sure only the clicked column is sorted.
Alain,

Is there any reason other than the image that you're drawing things
this way?

The header control supports an image facility (HDF_IMAGE) that will
let you achieve the normal sorted column indicator fairly easily
(without trying to draw it yourself anyway).

Dave
Oct 30 '06 #2
i also place the text of header with Graphics method also.. to adjust it
on right, left or center..
David Lowndes wrote:
>I have some little issue when i want to redraw the columnHeader of my
ListView.
Basically i display a little arrow to show the sortOrder of each column.
For sure only the clicked column is sorted.

Alain,

Is there any reason other than the image that you're drawing things
this way?

The header control supports an image facility (HDF_IMAGE) that will
let you achieve the normal sorted column indicator fairly easily
(without trying to draw it yourself anyway).

Dave
Oct 30 '06 #3
>i also place the text of header with Graphics method also.. to adjust it
>on right, left or center..
You can position the image with HDF_BITMAP_ON_RIGHT (or not).

And there are specific HDF_SORTDOWN & HDF_SORTUP on the XP (v6)
controls.

Anyhow, if you know that won't do what you need, it was just a
suggestion to side-step the problems you're having.

Dave
Oct 30 '06 #4

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

Similar topics

6
by: Anushya | last post by:
Hi I am using Listview and inherited listview control overriding WndProc & PreProcessMessage in ListView. I need this to customize listview to display only the page the user scrolls to. Since i...
0
by: Anushya | last post by:
Hi I am using Listview and inherited listview control overriding WndProc & PreProcessMessage in ListView. I need this to customize listview to display only the page the user scrolls to. Since i...
6
by: VM | last post by:
How can I fill up a listview with text file contents? My listview has two columns and the first column fills up with a while loop: while (myString != null) { myString = sr.Readline();...
0
by: keith | last post by:
In a ListView control (two columns), I added a few ListView items. ListView listview=new ListView(); listview.Parent=this; listview.View=View.Details; listview.Columns.Add...
7
by: Dave Y | last post by:
I am a newbie to C# and am having trouble trying to override a ListView property method. I have created a new class derived from the Forms.Listview and I cannot figure out the syntax to override...
7
by: BobAchgill | last post by:
I am trying to decide which of these controls to use to implement letting my user select a full row from MyList. The MyList has several columns which would be nice to sort by at run time. The...
2
by: Ben H | last post by:
Hello all I'm using a listview in my app but I want to scroll the listview programatically as I hate the look of the standard scrollbar. So, the listview is scrolled programatically using...
2
by: Peter | last post by:
Hi, I have a problem with Listview using checkboxes. If i check items by code BEFORE the form is shown the Listview.Items are confused during the ItemChecked Event !!! After showing the...
4
by: Brian Gaze | last post by:
I have created a ListView control and have bound this to a datasource. Within the ItemTemplate of the ListView I have added another ListViewControl which is databound in the code behind. The idea...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.