Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / June 2007

Tip: Looking for answers? Try searching our database.

Tab control problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rotsey - 28 Jun 2007 04:08 GMT
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);

}
Rotsey - 28 Jun 2007 07:23 GMT
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

> Hi,
>
[quoted text clipped - 76 lines]
>
> }
Peter Duniho - 28 Jun 2007 07:52 GMT
> 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
Rotsey - 28 Jun 2007 12:02 GMT
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

>> Well I could not find an answer must be a bug.
>>
[quoted text clipped - 19 lines]
>
> Pete
Peter Duniho - 28 Jun 2007 18:04 GMT
> 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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.