HI,
I want to bind data with textbox in silverlight. what will be the code. plz, help me
Thanks, in advance
Data binding with textbox
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Priya LingeRank #785 · 2.9K reputationPosted Sep 12, 2011, 9:18 PM EDT
Text="{Binding}" x:Name="textBox1"/>
public class Recording
{
public Recording() { }
public Recording(string artistName, string cdName, DateTime release)
{
Artist = artistName;
Name = cdName;
ReleaseDate = release;
}
public string Artist { get; set; }
public string Name { get; set; }
public DateTime ReleaseDate { get; set; }
// Override the ToString method.
public override string ToString()
{
return Name + " by " + Artist + ", Released: " + ReleaseDate.ToShortDateString();
}
}
...
// Set the data context to a new Recording.
textBox1.DataContext = new Recording("Chris Sells", "Chris Sells Live",
new DateTime(2008, 2, 5));
Hope this will help you.
Thanks.
Jiteendra SampathiraoRank #585 · 4.1K reputationPosted Sep 12, 2011, 9:26 PM EDT
Good Link
Prabhu RajaRank #861 · 2.6K reputationPosted Sep 13, 2011, 2:42 AM EDT
You may try this
---------------------------------------