Tab control problem

R

Rotsey

Hi,

I have a combobox on a tab control the 2nd tab that does
not behave properly.

When I try to set the selectedindex by iterating
the items collection I get cmb.Items.Count = 0.
This is a custom funciotn to set the index
from a value code is below.


But if i put the same combobox directly on the form
it works fine.

Any ideas????

rotsey

public void FindByValue(string value, string columnname)

{

int aIndex;

DataRowView drv;

if (this.Name == "PayFrequency")

Console.WriteLine("");

ComboDebug.Instance.list.Add(this.Name + " ---- NumItems: " +
this.Items.Count);

for (aIndex = 0; aIndex < this.Items.Count; aIndex += 1)

{

try

{

drv = (DataRowView)this.Items[aIndex];

if (drv.Row[columnname].ToString() == value)

{

this.SelectedIndex = aIndex;

return;

}

}

catch (Exception)

{

if(this.Items[aIndex].ToString() == value)

{

this.SelectedIndex = aIndex;

return;

}

}

}

this.SelectedIndex = -1;

return;

//throw new Exception("Could not find value '" + value + "' in combobox " +
this.Name);

}
 
R

Rotsey

Well I could not find an answer must be a bug.

so instead I had to implement my own tab control using
panels and buttons and it works great.

That damn m_______t
 
P

Peter Duniho

Well I could not find an answer must be a bug.

so instead I had to implement my own tab control using
panels and buttons and it works great.

That damn m_______t

IMHO, that's the wrong attitude. For one, you waited only three hours
before deciding an answer could not be found. For another, just because
no one else can explain the behavior to you, that doesn't mean you don't
have a bug in your own code.

It's possible that if you posted a concise-but-complete sample of code
that reliably reproduces the problem, someone might be able to help you
find that bug in your own code. The code you posted isn't useful to
anyone trying to help you with the question.

It is almost never the case that a problem one comes across while using
..NET (or any other OS-level API for that matter, in any operating system)
is a bug. Very rarely it is, and one should definitely spend more than
three hours on an issue before accusing .NET of having a bug.

Pete
 
R

Rotsey

Pete,

I have spent part of this week on the problem and posted 3 times
on the problem.

To post the code to reproduce the problem
would mean posting 5 projects of source code as the
code abstracts creating a data form from xml etc etc.

Also posting the SQL DB that the data comes from.

And frankly know one on here with asking could be bothered
going through that code as they have there own issue to deal
with.

And in my frustration hit out at microsoft.

rotsey
 
P

Peter Duniho

Pete,

I have spent part of this week on the problem and posted 3 times
on the problem.

Sorry...first time I saw your post.
To post the code to reproduce the problem
would mean posting 5 projects of source code as the
code abstracts creating a data form from xml etc etc.

Well, to post the code would mean reducing your 5 projects of source code
down to the bare minimum required to reproduce the problem, so that you
don't have to post 5 projects of source code.

Oddly enough, that's the same process you should be using to debug the
problem. If you are unable to reproduce the issue without all that other
stuff, that strongly suggests that something in all that other stuff is
causing the problem, rather than a .NET bug.
Also posting the SQL DB that the data comes from.

If the SQL database involved is required in order to reproduce the
problem, then you _definitely_ have a bug in your own code.
And frankly know one on here with asking could be bothered
going through that code as they have there own issue to deal
with.

That is clearly false, assuming you do the work to post your problem
correctly. That is, reduce the code posted to the bare minimum required
to reproduce the problem.
And in my frustration hit out at microsoft.

For no good reason, as I pointed out. The bug is most likely in your own
code.

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top