Click here to Skip to main content
15,913,570 members
Home / Discussions / C#
   

C#

 
QuestionDictionary. Can anyone spot whats going on here? Pin
MarkB77722-May-08 22:41
MarkB77722-May-08 22:41 
AnswerRe: Dictionary. Can anyone spot whats going on here? Pin
Giorgi Dalakishvili22-May-08 22:47
mentorGiorgi Dalakishvili22-May-08 22:47 
GeneralRe: Dictionary. Can anyone spot whats going on here? Pin
MarkB77723-May-08 0:00
MarkB77723-May-08 0:00 
GeneralRe: Dictionary. Can anyone spot whats going on here? Pin
Giorgi Dalakishvili23-May-08 7:02
mentorGiorgi Dalakishvili23-May-08 7:02 
AnswerRe: Dictionary. Can anyone spot whats going on here? Pin
Peter Josefsson Sweden23-May-08 15:26
Peter Josefsson Sweden23-May-08 15:26 
GeneralRe: Dictionary. Can anyone spot whats going on here? Pin
MarkB77723-May-08 16:17
MarkB77723-May-08 16:17 
GeneralRe: Dictionary. Can anyone spot whats going on here? Pin
Peter Josefsson Sweden23-May-08 16:29
Peter Josefsson Sweden23-May-08 16:29 
QuestionHow to bind property to control (through this[string]) Pin
El'Cachubrey22-May-08 22:33
El'Cachubrey22-May-08 22:33 
Hi all

Is exists a way to bind property to control through (this[string])

Ex:

<br />
<br />
        protected override void OnLoad(EventArgs e)<br />
        {<br />
            base.OnLoad(e);<br />
<br />
            DataSrc ds = new DataSrc();<br />
<br />
            this.DataBindings.Add("Text", ds, "Prop1");//no problem<br />
<br />
        }<br />
<br />
...<br />
...<br />
...<br />
<br />
        public class DataSrc <br />
        {<br />
            public object Prop1 { get { return "Prop1"; } }<br />
        }<br />
<br />


But i realy need to bind control not throug explicit defined property (in case above Prop1) but through this[string PropName] property

Ex:
<br />
<br />
        protected override void OnLoad(EventArgs e)<br />
        {<br />
            base.OnLoad(e);<br />
<br />
            DataSrc ds = new DataSrc();<br />
<br />
            this.DataBindings.Add("Text", ds, "Prop1");//can't bind!!!!<br />
<br />
        }<br />
<br />
...<br />
...<br />
...<br />
<br />
        public class DataSrc <br />
        {<br />
            public object this[string PropName] <br />
             {<br />
                 get <br />
                 { <br />
                   switch(PropName)<br />
                   {<br />
                    ...<br />
                    case "Prop1":<br />
                    return "Prop1"; <br />
                    }<br />
                 } <br />
              }<br />
        }<br />
<br />


Is exists way to do such way????

THANK
AnswerRe: How to bind property to control (through this[string]) Pin
darkelv22-May-08 23:00
darkelv22-May-08 23:00 
GeneralRe: How to bind property to control (through this[string]) Pin
El'Cachubrey22-May-08 23:05
El'Cachubrey22-May-08 23:05 
GeneralRe: How to bind property to control (through this[string]) Pin
darkelv23-May-08 0:00
darkelv23-May-08 0:00 
GeneralRe: How to bind property to control (through this[string]) Pin
El'Cachubrey23-May-08 1:21
El'Cachubrey23-May-08 1:21 
GeneralRe: How to bind property to control (through this[string]) [modified] Pin
darkelv23-May-08 1:31
darkelv23-May-08 1:31 
GeneralRe: How to bind property to control (through this[string]) Pin
El'Cachubrey23-May-08 1:49
El'Cachubrey23-May-08 1:49 
GeneralRe: How to bind property to control (through this[string]) Pin
darkelv23-May-08 1:56
darkelv23-May-08 1:56 
QuestionMerging of multiple word documents using automation causes a change of font ! Pin
ryan-uk22-May-08 22:17
ryan-uk22-May-08 22:17 
QuestionConnecting to Running Instances mozilla browser Pin
mihir raut22-May-08 22:12
mihir raut22-May-08 22:12 
AnswerRe: Connecting to Running Instances mozilla browser Pin
Jimmanuel23-May-08 10:30
Jimmanuel23-May-08 10:30 
QuestionOpening and reading excel document programatically from C# Pin
kindzal22-May-08 22:06
kindzal22-May-08 22:06 
AnswerRe: Opening and reading excel document programatically from C# Pin
Giorgi Dalakishvili22-May-08 22:09
mentorGiorgi Dalakishvili22-May-08 22:09 
AnswerRe: Opening and reading excel document programatically from C# Pin
DaveyM6922-May-08 23:12
professionalDaveyM6922-May-08 23:12 
QuestionForm Opacity Pin
D i x y22-May-08 21:59
D i x y22-May-08 21:59 
AnswerRe: Form Opacity Pin
Giorgi Dalakishvili22-May-08 22:08
mentorGiorgi Dalakishvili22-May-08 22:08 
Questionpocket pc application layout Pin
max8022-May-08 21:49
max8022-May-08 21:49 
QuestionRunning Console Application in System Tray Pin
ptr2void22-May-08 21:42
ptr2void22-May-08 21:42 

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.