Click here to Skip to main content
16,004,991 members
Home / Discussions / C#
   

C#

 
Questionoptional attribute in xml Pin
pashitech22-May-07 0:47
pashitech22-May-07 0:47 
AnswerRe: optional attribute in xml Pin
Christian Graus22-May-07 1:16
protectorChristian Graus22-May-07 1:16 
GeneralRe: optional attribute in xml Pin
pashitech22-May-07 1:45
pashitech22-May-07 1:45 
AnswerRe: optional attribute in xml Pin
andre_swnpl22-May-07 1:19
andre_swnpl22-May-07 1:19 
Questionwhat means Error: "No mapping exists from object type System.Windows.Forms.TextBox to a known managed provider native type." Pin
shinelo200222-May-07 0:43
shinelo200222-May-07 0:43 
AnswerRe: what means Error: "No mapping exists from object type System.Windows.Forms.TextBox to a known managed provider native type." Pin
Guffa22-May-07 0:46
Guffa22-May-07 0:46 
GeneralRe: what means Error: "No mapping exists from object type System.Windows.Forms.TextBox to a known managed provider native type." Pin
Member 814227811-Feb-12 4:52
Member 814227811-Feb-12 4:52 
QuestionSortable CollectionBase ? Pin
Gavin Roberts22-May-07 0:36
Gavin Roberts22-May-07 0:36 
Hi all,

I'm working on an application, and being new to 2.0 I need some help.

I have a Custom Collection which inherits CollectionBase and i'm using this as a DataGridView datasource. All is fine, apart from the Sorting does not work anymore (I used to manually add each row.) When I tried to use Sort, it complained that my CollectionBase does not inherit the IBindingList class.

I've tried but I never really got far.

Does anyone have any examples which will help me?

<br />
using System;<br />
using System.Collections;<br />
using System.Windows.Forms;<br />
using System.Text;<br />
using System.ComponentModel;<br />
<br />
namespace HelpDesk<br />
{<br />
    class RequestCollection : CollectionBase<br />
    {<br />
        public void Add(Request r)<br />
        {<br />
            r.Parent = this;<br />
            List.Add(r);<br />
        }<br />
        public Request this[int index]<br />
        {<br />
            get { return (Request)List[index]; }<br />
            set { List[index] = value; }<br />
        }<br />
        private ImageList _Images;<br />
        public ImageList Images<br />
        {<br />
            get { return _Images; }<br />
            set { _Images = value; }<br />
        }<br />
<br />
        public int OpenCount<br />
        {<br />
            get<br />
            {<br />
                int ReturnValue = 0;<br />
                foreach (Request r in List)<br />
                {<br />
                    if (r.Status == RequestStatus.Open)<br />
                        ReturnValue++;<br />
                }<br />
                return ReturnValue;<br />
            }<br />
        }<br />
        public int PendingCount<br />
        {<br />
            get<br />
            {<br />
                int ReturnValue = 0;<br />
                foreach (Request r in List)<br />
                {<br />
                    if (r.Status == RequestStatus.Pending)<br />
                        ReturnValue++;<br />
                }<br />
                return ReturnValue;<br />
            }<br />
        }<br />
        public int ImmediateCount<br />
        {<br />
            get<br />
            {<br />
                int ReturnValue = 0;<br />
                foreach (Request r in List)<br />
                {<br />
                    if (r.Priority == RequestPriority.Immediate)<br />
                        ReturnValue++;<br />
                }<br />
                return ReturnValue;<br />
            }<br />
        }<br />
        public int HighCount<br />
        {<br />
            get<br />
            {<br />
                int ReturnValue = 0;<br />
                foreach (Request r in List)<br />
                {<br />
                    if (r.Priority == RequestPriority.High)<br />
                        ReturnValue++;<br />
                }<br />
                return ReturnValue;<br />
            }<br />
        }<br />
    }<br />
}<br />


Thanks
AnswerRe: Sortable CollectionBase ? Pin
Pete O'Hanlon22-May-07 1:02
mvePete O'Hanlon22-May-07 1:02 
GeneralRe: Sortable CollectionBase ? Pin
Gavin Roberts22-May-07 1:59
Gavin Roberts22-May-07 1:59 
GeneralRe: Sortable CollectionBase ? Pin
Pete O'Hanlon22-May-07 4:01
mvePete O'Hanlon22-May-07 4:01 
GeneralRe: Sortable CollectionBase ? [modified] Pin
Gavin Roberts22-May-07 22:33
Gavin Roberts22-May-07 22:33 
GeneralRe: Sortable CollectionBase ? Pin
Pete O'Hanlon23-May-07 8:47
mvePete O'Hanlon23-May-07 8:47 
AnswerRe: Sortable CollectionBase ? Pin
Martin#22-May-07 1:29
Martin#22-May-07 1:29 
QuestionI want some source code for converting a 3GPP file to JPEG or GIF file Pin
Luna-Bangalore22-May-07 0:09
Luna-Bangalore22-May-07 0:09 
QuestionChanging print page settings Pin
Gareth H21-May-07 23:55
Gareth H21-May-07 23:55 
AnswerRe: Changing print page settings Pin
Gareth H22-May-07 21:28
Gareth H22-May-07 21:28 
QuestionNew line character in XML? Pin
chand1021-May-07 23:39
chand1021-May-07 23:39 
AnswerRe: New line character in XML? Pin
andre_swnpl22-May-07 1:13
andre_swnpl22-May-07 1:13 
QuestionAvi video Pin
Henrix5521-May-07 23:26
Henrix5521-May-07 23:26 
AnswerRe: Avi video Pin
Christian Graus22-May-07 0:32
protectorChristian Graus22-May-07 0:32 
GeneralRe: Avi video Pin
Henrix5522-May-07 0:49
Henrix5522-May-07 0:49 
QuestionOracle client installed? Pin
User 269896721-May-07 23:03
User 269896721-May-07 23:03 
AnswerRe: Oracle client installed? Pin
Gareth H21-May-07 23:24
Gareth H21-May-07 23:24 
GeneralRe: Oracle client installed? Pin
User 269896722-May-07 0:46
User 269896722-May-07 0:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.