Combo boxOPom prakash13yAsked Sep 26, 2013, 8:29 PM EDT8 answersShareLinkedInXCopy linkSavehow can i get a default value to display in combo box before selecting the belowvalue.1.aa2.bb3.ccbefore i selecting any value of above three (aa) must be displayed in combo box..
Combo boxOPom prakash13yAsked Sep 26, 2013, 8:29 PM EDT8 answersShareLinkedInXCopy linkSavehow can i get a default value to display in combo box before selecting the belowvalue.1.aa2.bb3.ccbefore i selecting any value of above three (aa) must be displayed in combo box..
Jignesh TrivediRank #16 · 50.3K reputation13y agoPosted Sep 26, 2013, 8:43 PM EDT0hi,Are you using winform application. web base application or MVC?in all application has differnent way to acheive...0
Jeetendra GundRank #97 · 22.1K reputation13y agoPosted Sep 26, 2013, 9:01 PM EDT0Hi,which technology u r using?0
OPom prakashRank #5,816 · 285 reputation13y agoPosted Sep 26, 2013, 9:24 PM EDT0using silverlight 5 technology0
Sanjeeb LenkaRank #301 · 8.3K reputation13y agoPosted Sep 26, 2013, 9:36 PM EDT0Hi,try like this public partial class MainPage : UserControl { public MainPage() { InitializeComponent(); combobind(); comboBox1.SelectedIndex = 0; } public void combobind() { comboBox1.Items.Add("aa"); comboBox1.Items.Add("bb"); comboBox1.Items.Add("cc"); } }}0
OPom prakashRank #5,816 · 285 reputation13y agoPosted Sep 27, 2013, 12:40 AM EDT0My cs Code: HourTypes = new EnumToDropdownMapper().Map().OrderBy(x => x.Description).ToList(); string ss = HourTypes.ToList()[0].Description;Enum code:public enum HourType{[EnumDisplayName("Normal Time")]NormalTime,[EnumDisplayName("Over Time")]OverTime,[EnumDisplayName("Double Time")]DoubleTime }Xaml Code: DisplayMemberPath="Description" SelectedValuePath="Value" SelectedValue="{Binding SelectedHourType}" Grid.Row="6" Grid.Column="1" />i want to bind normal in combo box defautly when the page is loaded can u help me..0Jignesh TrivediRank #16 · 50.3K reputation13y agoPosted Sep 27, 2013, 2:47 AM EDT0hi,Please referhttp://www.codeproject.com/Articles/157282/Binding-to-a-ComboBox-in-Silverlight-A-Gotchahttp://tonychampion.net/blog/index.php/2011/02/binding-to-a-combobox-in-silverlight-a-gotcha/hope this will help you.0OPom prakashRank #5,816 · 285 reputation13y agoPosted Sep 27, 2013, 2:51 AM EDT0no i want the value to be shown defaultly before i am selecting or clicking the combo box kindly reply0OPom prakashRank #5,816 · 285 reputation13y agoPosted Sep 29, 2013, 9:11 PM EDT0no i want the value to be shown defaultly before i am selecting or clicking the combo box kindly reply0Join to answer this questionEvery answer you publish earns 20 SHARP.Create free accountSign inKnow the answer?Answer a question in the forums and earn +20 SHARP for every answer.See unanswered questionsForumsTop experts01Arun PottiAnswers in the forums20answers02Tahir AnsariAnswers in the forums5answers03Kamlesh KumarAnswers in the forums5answers04Sam HobbsAnswers in the forums4answers05Željko PerićAnswers in the forums3answers?YouYour name goes here.Every answer: 20 SHARP.JoinFull leaderboard →2026DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jignesh TrivediRank #16 · 50.3K reputation13y agoPosted Sep 27, 2013, 2:47 AM EDT0hi,Please referhttp://www.codeproject.com/Articles/157282/Binding-to-a-ComboBox-in-Silverlight-A-Gotchahttp://tonychampion.net/blog/index.php/2011/02/binding-to-a-combobox-in-silverlight-a-gotcha/hope this will help you.0
OPom prakashRank #5,816 · 285 reputation13y agoPosted Sep 27, 2013, 2:51 AM EDT0no i want the value to be shown defaultly before i am selecting or clicking the combo box kindly reply0
OPom prakashRank #5,816 · 285 reputation13y agoPosted Sep 29, 2013, 9:11 PM EDT0no i want the value to be shown defaultly before i am selecting or clicking the combo box kindly reply0
Jignesh TrivediRank #16 · 50.3K reputationPosted Sep 26, 2013, 8:43 PM EDT
Are you using winform application. web base application or MVC?
in all application has differnent way to acheive...
Jeetendra GundRank #97 · 22.1K reputationPosted Sep 26, 2013, 9:01 PM EDT
which technology u r using?
om prakashRank #5,816 · 285 reputationPosted Sep 26, 2013, 9:24 PM EDT
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Sep 26, 2013, 9:36 PM EDT
try like this
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();
combobind();
comboBox1.SelectedIndex = 0;
}
public void combobind()
{
comboBox1.Items.Add("aa");
comboBox1.Items.Add("bb");
comboBox1.Items.Add("cc");
}
}
}
om prakashRank #5,816 · 285 reputationPosted Sep 27, 2013, 12:40 AM EDT
Enum code:
Xaml Code:
i want to bind normal in combo box defautly when the page is loaded can u help me..
Jignesh TrivediRank #16 · 50.3K reputationPosted Sep 27, 2013, 2:47 AM EDT
hi,
Please refer
http://www.codeproject.com/Articles/157282/Binding-to-a-ComboBox-in-Silverlight-A-Gotcha
http://tonychampion.net/blog/index.php/2011/02/binding-to-a-combobox-in-silverlight-a-gotcha/
hope this will help you.
om prakashRank #5,816 · 285 reputationPosted Sep 27, 2013, 2:51 AM EDT
om prakashRank #5,816 · 285 reputationPosted Sep 29, 2013, 9:11 PM EDT
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts