|
You could probably return this._sheets.Values.GetEnumerator() .
|
|
|
|
|
The problem I was having was that I did not know what interface to implement if I am storing items internally as a dictionary.
I simply implemented IEnumerable<keyValuePair<string, Employee>> and that did it.
CodingYoshi
Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07
|
|
|
|
|
Hey all,
Got an interesting problem where I'm using a cascaded combobox type setup, with the second combobox's IntegralHeight property set to true so that it should resize itself relative to the contents of the items list.
However, it's not doing this and I'm stumped. I don't think I should have to go ownerdraw in order for this to work, so can anyone suggest a reason why it might not be working?
FYI I am rebinding the combobox datasource to a datatable each time the "master" combobox value changes.
|
|
|
|
|
If you set the DropDownHeight property, this resets the IntegralHeight to false. Make sure you have not done so.
CodingYoshi
Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07
|
|
|
|
|
Yep, double-checked that I haven't.
Any other ideas?
|
|
|
|
|
What about if you set the DropDownHeight after it is bound?
CodingYoshi
Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07
|
|
|
|
|
I've checked the code for any instances where the DropDownHeight is being set, and there aren't any - neither in the *.designer.cs or the main class *.cs file... which according to MSDN means that the width should resize if IntegralHeight is set to true (which is apparently the default but I'm setting it manually just in case).
Is there nothing like a Refresh() or Invalidate() that I can call to force it to re-evaluate it's contained items automatically? I really don't want to have to resort to OwnerDrawn to sort this out...
|
|
|
|
|
I have classes as these below,
and I have myList List<cost>,
myList.Add(new Materials),
myList.Add(new PlannedOperation)
I have to implement searching in List<cost>, but I do not know exactly how.
For example I want to find: Cost where type of cost is Materials and orderNumber = "000001"
or Cost where type of cost is PlannedOperation and value > 50000
I should have in the result List<cost>, or maybe List<materials>, List<plannedoperation> ...?:/
Thanks for Your help.
public abstract class Cost
{
private Int32 id;
public Cost()
{
}
public abstract override string ToString();
public Task Task
{
get
{
return this.m_task;
}
set
{
this.m_task = value;
}
}
public Int32 Id
{
get
{
return this.id;
}
set
{
this.id = value;
}
}
public abstract double Value
{
get;
set;
}
}
public class Materials : Cost
{
private string name;
private string description;
private double value;
private DateTime orderDate;
private DateTime realizationDate;
private string orderNumber;
public Materials()
: base()
{
}
public override double Value
{
get
{
return this.value;
}
set
{
this.value = value;
}
}
public string OrderNumber
{
get
{
return this.orderNumber;
}
set
{
this.orderNumber = value;
}
}
}
public class PlannedOperation : Cost
{
private double hours;
public PlannedOperation()
{
}
public double Hours
{
get
{
return this.hours;
}
set
{
this.hours = value;
}
}
public override double Value
{
get
{
return this.hours * this.m_OperationMachine.Operation.CC.SearchRate
(this.Task.AddDate.Year.ToString()).Value;
}
set
{
}
}
}
|
|
|
|
|
Have a look at List.FindAll[^], I think that'll satisfy your requirements.
|
|
|
|
|
This is the most probably comfortable. Thanks.
|
|
|
|
|
You're welcome.
|
|
|
|
|
How about loop[^] this list, switch[^] the type, cast[^] the object, then compare[^] the values.
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
I was thinking about this, but loop by 100000 elements? Is this the good idea? I'm looking for something more effective.
modified on Friday, May 22, 2009 9:45 AM
|
|
|
|
|
arturw82 wrote: Loop by 100000 elements? I look for something more effective
What do you mean more effective? you mean one line of code that does all the work for you, well that's not possible. you are passing different types into the list and you want to compare different values based on the type that is in the list.
How do you expect to search a list without check all the items
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Something quicker in the working.
I am novice, that is why I ask. There are solutions or practice maybe about which I do not know.
|
|
|
|
|
What's more basic than a for loop, a switch statement, and an if statement??? If you can't cope with them then you need to go back a step - not look for another alternative.
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
|
|
I invented something like this. But I will check Your solution if will be some difference in efficiency...
List<Cost> aa = l1.FindAll(c => (c is Materials && ((Materials)c).OrderNumber == "9999999"));
|
|
|
|
|
|
you can't. WebBrowser is a WebBrowser, Internet Explorer is an application
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Hi All,
In my application i want to read the row content of an excel file as html text (for getting the font and style). If anybody knows please help me....
Regards,
Prajilal
|
|
|
|
|
Save your excel file as an HTML document, excel has had the ability to export as HTML for a while.
|
|
|
|
|
Hello Friends..
I am using a datagridview which have a checkbox column.there is a delete button on the form.i want that when i click the delete button and none of the check box is checked(true). it will simply display a message that "Firrst select a row".
|
|
|
|
|
Loop through each row in the datagridview and check for the ones where the value of the cell with the checkbox == true. If there are none then be rude to the user and ask him/her to check 1 or more item.
Never underestimate the power of human stupidity
RAH
|
|
|
|