Click here to Skip to main content
15,886,004 members
Home / Discussions / C#
   

C#

 
AnswerRe: c# project Pin
Mycroft Holmes16-Sep-17 20:50
professionalMycroft Holmes16-Sep-17 20:50 
QuestionRefresh Partial View Pin
sunsher15-Sep-17 22:57
sunsher15-Sep-17 22:57 
AnswerRe: Refresh Partial View Pin
Richard MacCutchan15-Sep-17 23:45
mveRichard MacCutchan15-Sep-17 23:45 
Questionhow add video support in my application? Pin
Le@rner15-Sep-17 19:19
Le@rner15-Sep-17 19:19 
AnswerRe: how add video support in my application? Pin
Richard MacCutchan15-Sep-17 22:05
mveRichard MacCutchan15-Sep-17 22:05 
AnswerRe: how add video support in my application? Pin
jschell18-Sep-17 12:39
jschell18-Sep-17 12:39 
QuestionC# Dropdown to populate Relationship Tables Pin
Member 1341198315-Sep-17 4:56
Member 1341198315-Sep-17 4:56 
AnswerRe: C# Dropdown to populate Relationship Tables Pin
OriginalGriff15-Sep-17 5:28
mveOriginalGriff15-Sep-17 5:28 
This is going to sound complicated, but it isn't, not really.
Create a Course Class, and give it two properties ID, and Description
C#
public class Course
   {
   public int ID {get; set;}
   public string Description {get; set;}
   }
And fill out a collection (a List<Course> will do nicely, or an array, at a pinch) to hold each separate course as you fetch them from the Courses table.
Now add an override method to your new class:
public class Course
    {
    public int ID { get; set; }
    public string Description { get; set; }
    public override string ToString()
        {
        return Description;
        }
    }
And use the collection as the DataSource property of your Combobox.
Because you override ToString, the comboBox will display the Text Description for the elements, but the SelectedItem property will return an instance of the Course class.
You have to cast it to use it:
C#
Course selected = (Course)cbReversedItems.SelectedItem;
And you then have access to the Description and ID properties in your code.

Give it a try, it's easier than it sounds!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!

Questionhow to encrypting and decryption pixel of image in C# Pin
WI54M13-Sep-17 23:18
WI54M13-Sep-17 23:18 
AnswerRe: how to encrypting and decryption pixel of image in C# Pin
OriginalGriff13-Sep-17 23:23
mveOriginalGriff13-Sep-17 23:23 
GeneralRe: how to encrypting and decryption pixel of image in C# Pin
WI54M13-Sep-17 23:47
WI54M13-Sep-17 23:47 
GeneralRe: how to encrypting and decryption pixel of image in C# Pin
OriginalGriff14-Sep-17 0:13
mveOriginalGriff14-Sep-17 0:13 
GeneralRe: how to encrypting and decryption pixel of image in C# Pin
WI54M14-Sep-17 0:42
WI54M14-Sep-17 0:42 
GeneralRe: how to encrypting and decryption pixel of image in C# Pin
OriginalGriff14-Sep-17 0:54
mveOriginalGriff14-Sep-17 0:54 
GeneralRe: how to encrypting and decryption pixel of image in C# Pin
WI54M14-Sep-17 1:02
WI54M14-Sep-17 1:02 
GeneralRe: how to encrypting and decryption pixel of image in C# Pin
OriginalGriff14-Sep-17 1:21
mveOriginalGriff14-Sep-17 1:21 
GeneralRe: how to encrypting and decryption pixel of image in C# Pin
WI54M14-Sep-17 1:57
WI54M14-Sep-17 1:57 
GeneralRe: how to encrypting and decryption pixel of image in C# Pin
OriginalGriff14-Sep-17 2:26
mveOriginalGriff14-Sep-17 2:26 
GeneralRe: how to encrypting and decryption pixel of image in C# Pin
WI54M14-Sep-17 3:35
WI54M14-Sep-17 3:35 
GeneralRe: how to encrypting and decryption pixel of image in C# Pin
OriginalGriff14-Sep-17 3:41
mveOriginalGriff14-Sep-17 3:41 
GeneralRe: how to encrypting and decryption pixel of image in C# Pin
WI54M14-Sep-17 3:58
WI54M14-Sep-17 3:58 
GeneralRe: how to encrypting and decryption pixel of image in C# Pin
OriginalGriff14-Sep-17 4:11
mveOriginalGriff14-Sep-17 4:11 
GeneralRe: how to encrypting and decryption pixel of image in C# Pin
WI54M14-Sep-17 4:23
WI54M14-Sep-17 4:23 
AnswerRe: how to encrypting and decryption pixel of image in C# Pin
Eddy Vluggen13-Sep-17 23:44
professionalEddy Vluggen13-Sep-17 23:44 
GeneralRe: how to encrypting and decryption pixel of image in C# Pin
WI54M13-Sep-17 23:49
WI54M13-Sep-17 23:49 

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.