473,757 Members | 9,145 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

set selected index of a ComboBox

Hi group,
I have a problem that I already have posted to the german C# newsgroup.
Since nobody could help me there, I'd like to try it here again:

I set the selected item of a combobox like this:

myCombo.Selecte dItem = 3;

But after that the ComboBox displays only the first entry of the list.
When I add the line

myCombo.Dropped Down = true;

before, and then step trough the code, I can see the list of the combo
dropping down, then the index (in this case 3) gets selected. After that,
the method is finished, no other code is processed. And then, when the form
comes up, there is the first item selected!

Funny, that the same code works some weeks ago - at this place nothing
changed. Does anybody have an idea what there happens? Or could it be, that
there is a problem with a MS patch or something like that?

Greetings,
Steffen.
Nov 16 '05 #1
9 56528
Hi Steffen,
You should use SelectedIndex property!

Example
[Visual Basic, C#, C++] The following example illustrates the usage of the FindString method and SelectedIndex property. The example is part of a runnable code sample in the ComboBox class overview.

[Visual Basic]
Private Sub findButton_Clic k(ByVal sender As Object, ByVal e As System.EventArg s)
Dim index As Integer
index = comboBox1.FindS tring(textBox2. Text)
comboBox1.Selec tedIndex = index
End Sub
[C#]
private void findButton_Clic k(object sender, System.EventArg s e) {
int index = comboBox1.FindS tring(textBox2. Text);
comboBox1.Selec tedIndex = index;
}"Steffen Laser" <sg*****@interm et.de> wrote in message news:OD******** ******@TK2MSFTN GP09.phx.gbl...
Hi group,
I have a problem that I already have posted to the german C# newsgroup.
Since nobody could help me there, I'd like to try it here again:

I set the selected item of a combobox like this:

myCombo.Selecte dItem = 3;

But after that the ComboBox displays only the first entry of the list.
When I add the line

myCombo.Dropped Down = true;

before, and then step trough the code, I can see the list of the combo
dropping down, then the index (in this case 3) gets selected. After that,
the method is finished, no other code is processed. And then, when the form
comes up, there is the first item selected!

Funny, that the same code works some weeks ago - at this place nothing
changed. Does anybody have an idea what there happens? Or could it be, that
there is a problem with a MS patch or something like that?

Greetings,
Steffen.

Nov 16 '05 #2
Hi Juan,
thank you very much, but I tried all of the following:

SelectedIdex = 3;

SelectedItem = object; // since the datasource contains an ArrayList of
objects with overridden ToString()-Method. I also tried an ArrayList with
Strings as DataSource - without success, also with SelectedIndex and the
followwing

FindStringExact ("searchstring" );

Thanks,
Steffen.

"Vince Yuan" <sh*******@citi z.net> schrieb im Newsbeitrag
news:OF******** ******@tk2msftn gp13.phx.gbl...
Hi Steffen,
You should use SelectedIndex property!

Example
[Visual Basic, C#, C++] The following example illustrates the usage of the
FindString method and SelectedIndex property. The example is part of a
runnable code sample in the ComboBox class overview.
[Visual Basic]
Private Sub findButton_Clic k(ByVal sender As Object, ByVal e As
System.EventArg s)
Dim index As Integer
index = comboBox1.FindS tring(textBox2. Text)
comboBox1.Selec tedIndex = index
End Sub
[C#]
private void findButton_Clic k(object sender, System.EventArg s e) {
int index = comboBox1.FindS tring(textBox2. Text);
comboBox1.Selec tedIndex = index;
}

"Steffen Laser" <sg*****@interm et.de> wrote in message
news:OD******** ******@TK2MSFTN GP09.phx.gbl...
Hi group,
I have a problem that I already have posted to the german C# newsgroup.
Since nobody could help me there, I'd like to try it here again:

I set the selected item of a combobox like this:

myCombo.Selecte dItem = 3;

But after that the ComboBox displays only the first entry of the list.
When I add the line

myCombo.Dropped Down = true;

before, and then step trough the code, I can see the list of the combo
dropping down, then the index (in this case 3) gets selected. After that,
the method is finished, no other code is processed. And then, when the form comes up, there is the first item selected!

Funny, that the same code works some weeks ago - at this place nothing
changed. Does anybody have an idea what there happens? Or could it be, that there is a problem with a MS patch or something like that?

Greetings,
Steffen.

Nov 16 '05 #3
Hi Juan,
thank you very much, but I tried all of the following:

(1) SelectedIndex = 3;

(2) SelectedItem = object;
// since the datasource contains an ArrayList of
//objects with overridden ToString()-Method.
//I also tried an ArrayList with Strings as DataSource
// with all here mentioned methods/Properties - with the same result
// as reported in my first mail.

(3) FindStringExact ("searchstring" );

Thanks,
Steffen.

"Vince Yuan" <sh*******@citi z.net> schrieb im Newsbeitrag
news:OF******** ******@tk2msftn gp13.phx.gbl...
Hi Steffen,
You should use SelectedIndex property!

Example
[Visual Basic, C#, C++] The following example illustrates the usage of the
FindString method and SelectedIndex property. The example is part of a
runnable code sample in the ComboBox class overview.
[Visual Basic]
Private Sub findButton_Clic k(ByVal sender As Object, ByVal e As
System.EventArg s)
Dim index As Integer
index = comboBox1.FindS tring(textBox2. Text)
comboBox1.Selec tedIndex = index
End Sub
[C#]
private void findButton_Clic k(object sender, System.EventArg s e) {
int index = comboBox1.FindS tring(textBox2. Text);
comboBox1.Selec tedIndex = index;
}

"Steffen Laser" <sg*****@interm et.de> wrote in message
news:OD******** ******@TK2MSFTN GP09.phx.gbl...
Hi group,
I have a problem that I already have posted to the german C# newsgroup.
Since nobody could help me there, I'd like to try it here again:

I set the selected item of a combobox like this:

myCombo.Selecte dItem = 3;

But after that the ComboBox displays only the first entry of the list.
When I add the line

myCombo.Dropped Down = true;

before, and then step trough the code, I can see the list of the combo
dropping down, then the index (in this case 3) gets selected. After that,
the method is finished, no other code is processed. And then, when the form comes up, there is the first item selected!

Funny, that the same code works some weeks ago - at this place nothing
changed. Does anybody have an idea what there happens? Or could it be, that there is a problem with a MS patch or something like that?

Greetings,
Steffen.

Nov 16 '05 #4
You mussn't change the data source after the DataSource assignment (At least
i think)
Try to add the DataSourceChang ed event and add a breakpoint inside it.
"Steffen Laser" <sg*****@interm et.de> schrieb im Newsbeitrag
news:Oq******** ******@tk2msftn gp13.phx.gbl...
Hi Juan,
thank you very much, but I tried all of the following:

SelectedIdex = 3;

SelectedItem = object; // since the datasource contains an ArrayList of
objects with overridden ToString()-Method. I also tried an ArrayList with
Strings as DataSource - without success, also with SelectedIndex and the
followwing

FindStringExact ("searchstring" );

Thanks,
Steffen.

"Vince Yuan" <sh*******@citi z.net> schrieb im Newsbeitrag
news:OF******** ******@tk2msftn gp13.phx.gbl...
Hi Steffen,
You should use SelectedIndex property!

Example
[Visual Basic, C#, C++] The following example illustrates the usage of the
FindString method and SelectedIndex property. The example is part of a
runnable code sample in the ComboBox class overview.
[Visual Basic]
Private Sub findButton_Clic k(ByVal sender As Object, ByVal e As
System.EventArg s)
Dim index As Integer
index = comboBox1.FindS tring(textBox2. Text)
comboBox1.Selec tedIndex = index
End Sub
[C#]
private void findButton_Clic k(object sender, System.EventArg s e) {
int index = comboBox1.FindS tring(textBox2. Text);
comboBox1.Selec tedIndex = index;
}

"Steffen Laser" <sg*****@interm et.de> wrote in message
news:OD******** ******@TK2MSFTN GP09.phx.gbl...
Hi group,
I have a problem that I already have posted to the german C# newsgroup.
Since nobody could help me there, I'd like to try it here again:

I set the selected item of a combobox like this:

myCombo.Selecte dItem = 3;

But after that the ComboBox displays only the first entry of the list.
When I add the line

myCombo.Dropped Down = true;

before, and then step trough the code, I can see the list of the combo
dropping down, then the index (in this case 3) gets selected. After that, the method is finished, no other code is processed. And then, when the

form
comes up, there is the first item selected!

Funny, that the same code works some weeks ago - at this place nothing
changed. Does anybody have an idea what there happens? Or could it be,

that
there is a problem with a MS patch or something like that?

Greetings,
Steffen.


Nov 16 '05 #5
Works for me using SelectedIndex, can you post some code that reproduces
this behaviour.

Sijin Joseph
http://www.indiangeek.net
http://weblogs.asp.net/sjoseph

Steffen Laser wrote:
Hi group,
I have a problem that I already have posted to the german C# newsgroup.
Since nobody could help me there, I'd like to try it here again:

I set the selected item of a combobox like this:

myCombo.Selecte dItem = 3;

But after that the ComboBox displays only the first entry of the list.
When I add the line

myCombo.Dropped Down = true;

before, and then step trough the code, I can see the list of the combo
dropping down, then the index (in this case 3) gets selected. After that,
the method is finished, no other code is processed. And then, when the form
comes up, there is the first item selected!

Funny, that the same code works some weeks ago - at this place nothing
changed. Does anybody have an idea what there happens? Or could it be, that
there is a problem with a MS patch or something like that?

Greetings,
Steffen.

Nov 16 '05 #6
Hello/Grüezi Zürcher See,

very good point - not the DataSourceChang ed-event but the events

SelectedValueCh anged
SelectedindexCh anged
and SelectionChange Committed

were fired. Do you have an idea how this could be? It happens after all code
I wrote is executed after leaving the last method of my code that was
called. The caller list shows only a method, that started the whole process.
Must be some code inside the .net classes. How can I track this code? Do I
have to derive the gui classes and override their methods to trace, which
methods are called, or is their a smarter method? Where can I find a
detailled description of gui processing in .net?

Thanx,
Steffen.

"Zürcher See" <aq****@cannabi smail.com> schrieb im Newsbeitrag
news:Ob******** *****@TK2MSFTNG P11.phx.gbl...
You mussn't change the data source after the DataSource assignment (At least i think)
Try to add the DataSourceChang ed event and add a breakpoint inside it.
"Steffen Laser" <sg*****@interm et.de> schrieb im Newsbeitrag
news:Oq******** ******@tk2msftn gp13.phx.gbl...
Hi Juan,
thank you very much, but I tried all of the following:

SelectedIdex = 3;

SelectedItem = object; // since the datasource contains an ArrayList of
objects with overridden ToString()-Method. I also tried an ArrayList with
Strings as DataSource - without success, also with SelectedIndex and the
followwing

FindStringExact ("searchstring" );

Thanks,
Steffen.

"Vince Yuan" <sh*******@citi z.net> schrieb im Newsbeitrag
news:OF******** ******@tk2msftn gp13.phx.gbl...
Hi Steffen,
You should use SelectedIndex property!

Example
[Visual Basic, C#, C++] The following example illustrates the usage of the FindString method and SelectedIndex property. The example is part of a
runnable code sample in the ComboBox class overview.
[Visual Basic]
Private Sub findButton_Clic k(ByVal sender As Object, ByVal e As
System.EventArg s)
Dim index As Integer
index = comboBox1.FindS tring(textBox2. Text)
comboBox1.Selec tedIndex = index
End Sub
[C#]
private void findButton_Clic k(object sender, System.EventArg s e) {
int index = comboBox1.FindS tring(textBox2. Text);
comboBox1.Selec tedIndex = index;
}

"Steffen Laser" <sg*****@interm et.de> wrote in message
news:OD******** ******@TK2MSFTN GP09.phx.gbl...
Hi group,
I have a problem that I already have posted to the german C# newsgroup. Since nobody could help me there, I'd like to try it here again:

I set the selected item of a combobox like this:

myCombo.Selecte dItem = 3;

But after that the ComboBox displays only the first entry of the list.
When I add the line

myCombo.Dropped Down = true;

before, and then step trough the code, I can see the list of the combo
dropping down, then the index (in this case 3) gets selected. After

that, the method is finished, no other code is processed. And then, when the

form
comes up, there is the first item selected!

Funny, that the same code works some weeks ago - at this place nothing
changed. Does anybody have an idea what there happens? Or could it be,

that
there is a problem with a MS patch or something like that?

Greetings,
Steffen.



Nov 16 '05 #7
To track the code is very simple ... just add an bug :)
try{int a=1/0;}
catch(System.Ex ception e){e.StackTrace ;}

but without the code is difficult to say what is wrong :(
"Steffen Laser" <sg*****@interm et.de> schrieb im Newsbeitrag
news:e3******** ******@TK2MSFTN GP09.phx.gbl...
Hello/Grüezi Zürcher See,

very good point - not the DataSourceChang ed-event but the events

SelectedValueCh anged
SelectedindexCh anged
and SelectionChange Committed

were fired. Do you have an idea how this could be? It happens after all code I wrote is executed after leaving the last method of my code that was
called. The caller list shows only a method, that started the whole process. Must be some code inside the .net classes. How can I track this code? Do I
have to derive the gui classes and override their methods to trace, which
methods are called, or is their a smarter method? Where can I find a
detailled description of gui processing in .net?

Thanx,
Steffen.

"Zürcher See" <aq****@cannabi smail.com> schrieb im Newsbeitrag
news:Ob******** *****@TK2MSFTNG P11.phx.gbl...
You mussn't change the data source after the DataSource assignment (At

least
i think)
Try to add the DataSourceChang ed event and add a breakpoint inside it.
"Steffen Laser" <sg*****@interm et.de> schrieb im Newsbeitrag
news:Oq******** ******@tk2msftn gp13.phx.gbl...
Hi Juan,
thank you very much, but I tried all of the following:

SelectedIdex = 3;

SelectedItem = object; // since the datasource contains an ArrayList of objects with overridden ToString()-Method. I also tried an ArrayList with Strings as DataSource - without success, also with SelectedIndex and the followwing

FindStringExact ("searchstring" );

Thanks,
Steffen.

"Vince Yuan" <sh*******@citi z.net> schrieb im Newsbeitrag
news:OF******** ******@tk2msftn gp13.phx.gbl...
Hi Steffen,
You should use SelectedIndex property!

Example
[Visual Basic, C#, C++] The following example illustrates the usage of the FindString method and SelectedIndex property. The example is part of a
runnable code sample in the ComboBox class overview.
[Visual Basic]
Private Sub findButton_Clic k(ByVal sender As Object, ByVal e As
System.EventArg s)
Dim index As Integer
index = comboBox1.FindS tring(textBox2. Text)
comboBox1.Selec tedIndex = index
End Sub
[C#]
private void findButton_Clic k(object sender, System.EventArg s e) {
int index = comboBox1.FindS tring(textBox2. Text);
comboBox1.Selec tedIndex = index;
}

"Steffen Laser" <sg*****@interm et.de> wrote in message
news:OD******** ******@TK2MSFTN GP09.phx.gbl...
> Hi group,
> I have a problem that I already have posted to the german C# newsgroup. > Since nobody could help me there, I'd like to try it here again:
>
> I set the selected item of a combobox like this:
>
> myCombo.Selecte dItem = 3;
>
> But after that the ComboBox displays only the first entry of the list. > When I add the line
>
> myCombo.Dropped Down = true;
>
> before, and then step trough the code, I can see the list of the combo > dropping down, then the index (in this case 3) gets selected. After

that,
> the method is finished, no other code is processed. And then, when the form
> comes up, there is the first item selected!
>
> Funny, that the same code works some weeks ago - at this place nothing > changed. Does anybody have an idea what there happens? Or could it be, that
> there is a problem with a MS patch or something like that?
>
> Greetings,
> Steffen.
>
>



Nov 16 '05 #8
Hello Zürcher See,
thank you, your hint lead me to the right solution. I could solve the
problem, that was generated by the specific imlementation of the
application - concerning to this, the method that queries the data can not
be located in the constructor of the form. In fact, I do not know exactly,
why this behaviour originates - but I redesigned the order of code calls and
now it is working properly! So thanks again for your help and assistance!

Steffen.

"Zürcher See" <aq****@cannabi smail.com> schrieb im Newsbeitrag
news:%2******** *******@TK2MSFT NGP09.phx.gbl.. .
To track the code is very simple ... just add an bug :)
try{int a=1/0;}
catch(System.Ex ception e){e.StackTrace ;}

but without the code is difficult to say what is wrong :(
"Steffen Laser" <sg*****@interm et.de> schrieb im Newsbeitrag
news:e3******** ******@TK2MSFTN GP09.phx.gbl...
Hello/Grüezi Zürcher See,

very good point - not the DataSourceChang ed-event but the events

SelectedValueCh anged
SelectedindexCh anged
and SelectionChange Committed

were fired. Do you have an idea how this could be? It happens after all

code
I wrote is executed after leaving the last method of my code that was
called. The caller list shows only a method, that started the whole

process.
Must be some code inside the .net classes. How can I track this code? Do I
have to derive the gui classes and override their methods to trace, which methods are called, or is their a smarter method? Where can I find a
detailled description of gui processing in .net?

Thanx,
Steffen.

"Zürcher See" <aq****@cannabi smail.com> schrieb im Newsbeitrag
news:Ob******** *****@TK2MSFTNG P11.phx.gbl...
You mussn't change the data source after the DataSource assignment (At

least
i think)
Try to add the DataSourceChang ed event and add a breakpoint inside it.
"Steffen Laser" <sg*****@interm et.de> schrieb im Newsbeitrag
news:Oq******** ******@tk2msftn gp13.phx.gbl...
> Hi Juan,
> thank you very much, but I tried all of the following:
>
> SelectedIdex = 3;
>
> SelectedItem = object; // since the datasource contains an ArrayList of > objects with overridden ToString()-Method. I also tried an ArrayList

with
> Strings as DataSource - without success, also with SelectedIndex and the > followwing
>
> FindStringExact ("searchstring" );
>
> Thanks,
> Steffen.
>
>
>
> "Vince Yuan" <sh*******@citi z.net> schrieb im Newsbeitrag
> news:OF******** ******@tk2msftn gp13.phx.gbl...
> Hi Steffen,
> You should use SelectedIndex property!
>
> Example
> [Visual Basic, C#, C++] The following example illustrates the usage of the
> FindString method and SelectedIndex property. The example is part of
a > runnable code sample in the ComboBox class overview.
> [Visual Basic]
> Private Sub findButton_Clic k(ByVal sender As Object, ByVal e As
> System.EventArg s)
> Dim index As Integer
> index = comboBox1.FindS tring(textBox2. Text)
> comboBox1.Selec tedIndex = index
> End Sub
> [C#]
> private void findButton_Clic k(object sender, System.EventArg s e) {
> int index = comboBox1.FindS tring(textBox2. Text);
> comboBox1.Selec tedIndex = index;
> }
>
> "Steffen Laser" <sg*****@interm et.de> wrote in message
> news:OD******** ******@TK2MSFTN GP09.phx.gbl...
> > Hi group,
> > I have a problem that I already have posted to the german C#

newsgroup.
> > Since nobody could help me there, I'd like to try it here again:
> >
> > I set the selected item of a combobox like this:
> >
> > myCombo.Selecte dItem = 3;
> >
> > But after that the ComboBox displays only the first entry of the

list. > > When I add the line
> >
> > myCombo.Dropped Down = true;
> >
> > before, and then step trough the code, I can see the list of the combo > > dropping down, then the index (in this case 3) gets selected. After that,
> > the method is finished, no other code is processed. And then, when the > form
> > comes up, there is the first item selected!
> >
> > Funny, that the same code works some weeks ago - at this place nothing > > changed. Does anybody have an idea what there happens? Or could it be, > that
> > there is a problem with a MS patch or something like that?
> >
> > Greetings,
> > Steffen.
> >
> >
>
>



Nov 16 '05 #9
Nothing :) tschüss

"Steffen Laser" <sg*****@interm et.de> schrieb im Newsbeitrag
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
Hello Zürcher See,
thank you, your hint lead me to the right solution. I could solve the
problem, that was generated by the specific imlementation of the
application - concerning to this, the method that queries the data can not
be located in the constructor of the form. In fact, I do not know exactly,
why this behaviour originates - but I redesigned the order of code calls and now it is working properly! So thanks again for your help and assistance!

Steffen.

"Zürcher See" <aq****@cannabi smail.com> schrieb im Newsbeitrag
news:%2******** *******@TK2MSFT NGP09.phx.gbl.. .
To track the code is very simple ... just add an bug :)
try{int a=1/0;}
catch(System.Ex ception e){e.StackTrace ;}

but without the code is difficult to say what is wrong :(
"Steffen Laser" <sg*****@interm et.de> schrieb im Newsbeitrag
news:e3******** ******@TK2MSFTN GP09.phx.gbl...
Hello/Grüezi Zürcher See,

very good point - not the DataSourceChang ed-event but the events

SelectedValueCh anged
SelectedindexCh anged
and SelectionChange Committed

were fired. Do you have an idea how this could be? It happens after all
code
I wrote is executed after leaving the last method of my code that was
called. The caller list shows only a method, that started the whole process.
Must be some code inside the .net classes. How can I track this code?
Do I have to derive the gui classes and override their methods to trace, which methods are called, or is their a smarter method? Where can I find a
detailled description of gui processing in .net?

Thanx,
Steffen.

"Zürcher See" <aq****@cannabi smail.com> schrieb im Newsbeitrag
news:Ob******** *****@TK2MSFTNG P11.phx.gbl...
> You mussn't change the data source after the DataSource assignment
(At least
> i think)
> Try to add the DataSourceChang ed event and add a breakpoint inside it. >
>
> "Steffen Laser" <sg*****@interm et.de> schrieb im Newsbeitrag
> news:Oq******** ******@tk2msftn gp13.phx.gbl...
> > Hi Juan,
> > thank you very much, but I tried all of the following:
> >
> > SelectedIdex = 3;
> >
> > SelectedItem = object; // since the datasource contains an ArrayList
of
> > objects with overridden ToString()-Method. I also tried an
ArrayList with
> > Strings as DataSource - without success, also with SelectedIndex
and the
> > followwing
> >
> > FindStringExact ("searchstring" );
> >
> > Thanks,
> > Steffen.
> >
> >
> >
> > "Vince Yuan" <sh*******@citi z.net> schrieb im Newsbeitrag
> > news:OF******** ******@tk2msftn gp13.phx.gbl...
> > Hi Steffen,
> > You should use SelectedIndex property!
> >
> > Example
> > [Visual Basic, C#, C++] The following example illustrates the
usage of the
> > FindString method and SelectedIndex property. The example is part
of
a > > runnable code sample in the ComboBox class overview.
> > [Visual Basic]
> > Private Sub findButton_Clic k(ByVal sender As Object, ByVal e As
> > System.EventArg s)
> > Dim index As Integer
> > index = comboBox1.FindS tring(textBox2. Text)
> > comboBox1.Selec tedIndex = index
> > End Sub
> > [C#]
> > private void findButton_Clic k(object sender, System.EventArg s e) {
> > int index = comboBox1.FindS tring(textBox2. Text);
> > comboBox1.Selec tedIndex = index;
> > }
> >
> > "Steffen Laser" <sg*****@interm et.de> wrote in message
> > news:OD******** ******@TK2MSFTN GP09.phx.gbl...
> > > Hi group,
> > > I have a problem that I already have posted to the german C#
newsgroup.
> > > Since nobody could help me there, I'd like to try it here again:
> > >
> > > I set the selected item of a combobox like this:
> > >
> > > myCombo.Selecte dItem = 3;
> > >
> > > But after that the ComboBox displays only the first entry of the

list.
> > > When I add the line
> > >
> > > myCombo.Dropped Down = true;
> > >
> > > before, and then step trough the code, I can see the list of the

combo
> > > dropping down, then the index (in this case 3) gets selected. After > that,
> > > the method is finished, no other code is processed. And then,

when the
> > form
> > > comes up, there is the first item selected!
> > >
> > > Funny, that the same code works some weeks ago - at this place

nothing
> > > changed. Does anybody have an idea what there happens? Or could
it be,
> > that
> > > there is a problem with a MS patch or something like that?
> > >
> > > Greetings,
> > > Steffen.
> > >
> > >
> >
> >
>
>



Nov 16 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
4808
by: faisalsns | last post by:
Hi, I am facing a peculiar problem in setting the selected index 9 of a customised combo programitically. For rest of the index it gets set but for the index 9 i.e element no 10 in the datatable it doesnt. ie if i set it combo.SelectedIndex = 4, the selectedindex gets selected to 4 but if i say combo.SelectedIndex = 9, the selectedindex is still 4(reverts back to the previous entry). I have tried by adding data row by row instead of the...
2
4281
by: martin | last post by:
Hi, I have a dropdown control tha is rendered with the follwoing HTML <select name="FirstStep:CmbTargetGroup" id="FirstStep_CmbTargetGroup" style="width:152px;"> <option value="1">Martin</option> <option value="2">Chris</option> <option value="5">adrian</option> <option value="7">Tony</option>
12
3991
by: moondaddy | last post by:
I have a dropdown combo box on a form and I have its AutoPostBack property set to true. When I select something from the list it does a postback and then the Page_Load event fires followed by it's SelectedIndexChanged event. However, when I go back to this control again and select the first item in the list, it does a postback and the Page_Load event fires, but the SelectedIndexChanged doesn't fire. Why does the SelectedIndexChanged get...
3
1710
by: Chris Thunell | last post by:
I have a Listbox on an vb aspx web page. When i select something in the listbox i do not get a selected value or selected index. The selected index is always -1. Any thoughts would be greatly appreciated! Chris Thunell cthunell@pierceassociates.com Here is my code: loading:
0
1557
by: jw56578 | last post by:
I have a dropdownlist in a panel on the page. autopostback is set to true. when i choose the second option in the the list, the selected index event is triggered fine. when i go back and choose the first default value the page posts, but the selected index change event is not triggered. why might this be. thanks
4
2104
by: wolfgang wagner | last post by:
hi all! after successfully integrating a dropdownlist in my datagrid i have another problem: i cannot set the selected index of the dropdownlistbox. here is my code: hardware.aspx -------------
5
13851
by: Steve Jones | last post by:
Hi there, I am working with web forms, and am finding that the standard list of combo box events is dramatically reduced when using the dropdownlist. For example, the only event that I can see that will trigger when a user selects a different menu item is 'selected index changed'. I can confirm with a separate button that the index has in fact changed after a pulldown selection takes place, yet the internal 'selected index changed'...
10
2744
by: Phuff | last post by:
Thanks in advance! I'm trying to maintain a dl list's selected index on postback. What I'm doing is when a person selects an item from the drop down list I select a date in a calendar control and populate a text box with the date. To do this I set auto postback to the drop down list. But it always resets the selected index on post back. I control for this in the onLoad method... If Not Page.IsPostBack Then If page is posted back...
11
5815
by: Santosh | last post by:
Dear all , i am writting following code. if(Page.IsPostBack==false) { try { BindSectionDropDownlist();
1
1665
by: julianomartins | last post by:
Hi friends, how I make to recoup the value of database and to keep selected in combobox to edit my form? in script below it is selected field of the table that possesss id of the first item of database. I am catching id of a URL: <?php echo "<a href='alterar_cliente.php?id=$id'>Alterar</a>"; ?>
0
9906
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9885
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8737
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7286
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6562
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5172
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3829
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3399
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.