checked list box item name

C#

    Next

  • 1. What type connection is the fastest in C# to SQL Server
    Can someone give me some insight in what type of connection is the fastest to connect to SQL Server. Thx in Advance
  • 2. What happened to CF_RTFNOOBJS and CF_RTF and CF_RETEXTOBJ
    Before DotNet there were the formats: // Clipboard formats - use as parameter to RegisterClipboardFormat() #define CF_RTF TEXT("Rich Text Format") #define CF_RTFNOOBJS TEXT("Rich Text Format Without Objects") #define CF_RETEXTOBJ TEXT("RichEdit Text and Objects") Are they still used by any MS programs like Word or WordPad? If they are how are they handled by DotNET? Thanks
  • 3. indexOf question
    vs2005 c# string var = string.Empty; why "76090,76091,76092,G0202,G0204,G0206".IndexOf(var) returns 0 ? should be -1 for not found...empty is not part of my string being searched any ideas thanks

checked list box item name

Postby fotis » Tue, 06 Jan 2004 21:21:17 GMT

hi there

can anybody tell me if it's possible and how can i change 
the name of a CheckedListBox item.I have used the Add 
method to insert the item.

thank you

Re: checked list box item name

Postby Nicholas Paldino [.NET/C# MVP] » Tue, 06 Jan 2004 22:39:48 GMT

fotis,

    The CheckedListBox uses the DisplayMember property to determine which
member on the items in the list is used for display purposes.  If you have
not populated this, then the CheckedListBox will call ToString on the items
in the list and then use that for the display.  So, to change what is shown
in the list, you will have to change something on the item that will change
the property exposed by DisplayProperty (if it is set), or you will have to
change the object in some way that will change what ToString outputs.

    Of course, you might just want to remove the item and then add a new one
in its place.

    Hope this helps.


-- 
               - Nicholas Paldino [.NET/C# MVP]
               -  XXXX@XXXXX.COM 








Similar Threads:

1.list box checked names

I got the index of all checked values, but I don't know how to read data of 
that value?

For example.. in list box I have Names of users. First is John(index 1), 
Second is Jack(index 2) and so on...
How to get the names ?

Hrcko 


2.adding a check box list item using js

I tried to add in the innerHTML but it gives unknown runtime error

var parentEl=document.getElementById("cbListClassSug");

var id="cbListClassSug_"+idCnt;
var nam="cbListClassSug$"+idCnt;
parentEl.innerHTML+="<tr><td>";
parentEl.innerHTML+="<input id=\""+id+"\"";
parentEl.innerHTML+=" type=\"checkbox\"";
parentEl.innerHTML+=" name=\""+id+"\"";
parentEl.innerHTML+="
value=\""+tree1.childNodes(1).text+"_"+tree1.childNodes(2).text+"_"+tree1.childNodes(0).text+"\"";
parentEl.innerHTML+="<label for=\""+id+"\"> In Taxonomy
"+tree1.childNodes(0).text+"</label>";
                    parentEl.innerHTML+="</td></tr>";
                    idCnt++;

3.Check Box List Selected Items

I've a multiview with 3 views. on view 2 the user is presented with a check 
box list (items from database) at view 3 the user can review their selections 
and, either post to the database or go back and amend their selections (all 
selected data is held in an extensive profile including several list items).

The problem is going back from view 3 to view 2 the check Box List loses the 
user checked items when using: MultiView.ActiveViewIndex = 1.

Can anyone give a pointer on how maintain the user selections when going 
from view 3 to view 2?

Or how to set the checked box items selected property to true from the data 
held in the profile list?
asp.net 2.0 (vb) VS2005

Any help would be great!

4.Adding an item to a Checked List Box

Hello,

I am trying to add an item to a checked list box, like:

clbList.Items.add("Hello",true)

I get an error back:

Run-time exception thrown: System.ArgumentOutOfRangeException - Specified 
argument was out of the range of valid values. Parameter name: '-1' is not a 
valid value for index.

This doesn't make a lot of sense? Any ideas why this happens?

Regards
Simon Jefferies
Tools Programmer, Headfirst Productions
mailto: XXXX@XXXXX.COM 
- 


5.check list boxes: how to assign information to items

I want a checked list box with lets say 10 items.  Each item should
have login and password information.  I want to be able to check ONLY
one item and press OK.  After pressing OK, it should populate a web
browser proxy window.

Any ideas?

Thanks :)

6. Need the check state of list control item as user checks/unchecks it

7. check box in list box

8. Checked List Box check in program



Return to C#

 

Who is online

Users browsing this forum: No registered users and 32 guest