[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.sdk

Unicode Strings in the ListView Control

JP Burford

7/17/2002 3:39:00 PM

I am trying to place a check mark into a list view sub
item. I have checked the value of the SubItem in the
command window and see that its value is correct. The
command window shows the text as being the correct
character. When the character is displayed in the List
View all I see is a "✓". Does the list view not support
Unicode? If it does, what do I need to do to set it up
to display the string propoerly.

Here is the code that I am using to generate the SubItem:

private void FillDefinedDocuments()
{
this.DefinedDocuemnts.Items.Clear
();
foreach( System.Data.DataRow Row
in this.DocumentData.Tables[0].Rows )
{

System.Windows.Forms.ListViewItem NewDocumentItem
=
new
System.Windows.Forms.ListViewItem(Row
["DocDefName"].ToString());

NewDocumentItem.SubItems.Add(GetSubItem(Row
["DocDefRequired"]));

NewDocumentItem.SubItems.Add( Row
["DocDefDesc"].ToString());

this.DefinedDocuemnts.Items.Add(NewDocumentItem);

}
}



private string GetSubItem(object Value )
{
string RetVal = "\u0000";
if( (bool)Value == true )
{
RetVal="\u2713";
}
return RetVal;

Here are the definitions for the ListView Instance

//
// DefinedDocuemnts
//

this.DefinedDocuemnts.AllowColumnReorder = true;

this.DefinedDocuemnts.Columns.AddRange(new
System.Windows.Forms.ColumnHeader[] {



this.columnHeader1,



this.columnHeader3,



this.Inactive,



this.columnHeader2});
this.DefinedDocuemnts.Font = new
System.Drawing.Font("Microsoft Sans Serif", 8.25F,
System.Drawing.FontStyle.Regular,
System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.DefinedDocuemnts.Location =
new System.Drawing.Point(16, 176);
this.DefinedDocuemnts.Name
= "DefinedDocuemnts";
this.DefinedDocuemnts.Size = new
System.Drawing.Size(392, 120);
this.DefinedDocuemnts.TabIndex =
1;
this.DefinedDocuemnts.View =
System.Windows.Forms.View.Details;
//
// columnHeader1
//
this.columnHeader1.Text = "Name";
//
// columnHeader3
//
this.columnHeader3.Text
= "Required";
//
// Inactive
//
this.Inactive.Text = "Inactive";
this.Inactive.Width = 53;
//
// columnHeader2
//
this.columnHeader2.Text
= "Description";
this.columnHeader2.Width = 215;