|
I have created some web applications and now I want to create 'something' so that it will run everything automatically. I have no idea how can I do this. Anyone can give some lead? Is it I have to create dll and exe file?
|
|
|
|
|
Hi everyone, I would like to filter comboboxes. If I choose a certain value in one combobox, the following two comboboxes should only display the value of the first combobox or less. So lets say I choose an amount of 100 000.00 the following two comboboxes should only have 0 - 100 000.00 displaying in them. Any ideas on how to do this would be appreciated. Thanks for the help.
modified 19-Jul-12 7:33am.
|
|
|
|
|
Please tell me you aren't planning on having 100K items in a combobox. That would present a totally unusable interface for a user.
|
|
|
|
|
Sorry I should have been more clear. The amounts in the comboboxes are from 0 - 200 00.00 every 10 000.00 so 0, 10 000.00, 20 000.00 etc etc. Thanks
|
|
|
|
|
Ah good. For a moment you had me worried. You'd be surprised how many times we see people wanting insane amounts of data in there. As you haven't said which technology you are using, I am going to assume you want Windows Forms and would look to implement this using LINQ. Basically, you capture the selection changed in the first combobox and use that to change your DataSource on the second one using a query like this (for this example I'm assuming you've prepopulated an array called filterValues with your values from 0 to 200000):
secondComboBox.DataSource = (from p in filterValues
where p <= firstComboValue
select p).ToList();
|
|
|
|
|
How are you populating the comboboxes ? If you are really using integers as you suggest then you just need to handle the Selected Value changed event of the first combo, and then generate a List<int> and bind that to the other 2 combos, something like this
int uBound = firstCombo.SelectedValue;
List<int> intList = Enumerable.Range(0, uBound).ToList();
secondCombo.DataSource = intList;
thirdCombo.DataSource = intList;
This is off the top of my head, and is untested - but you should get the gist.
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
Thanks for the reply. Im populating the boxes from a table in SQL.
|
|
|
|
|
If you hold a List of all the possible values, then you can filter that list using LinQ
decimal selectedValue = firstCombo.SelectedValue;
List<decimal> values = (from value in fullList where value <= selectedValue select value).ToList();
and then bind values to the second and third combos.
This assumes the values are decimals.
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
That works great. Thanks for the help guys and special thanks to Wayne Gaylard.
|
|
|
|
|
How do i close this thread now guys?
|
|
|
|
|
Just modify your subject line by adding SOLVED on the end. The thread will remain for ever more in the annals of history.
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
hi all,
i want a application that can send sms via bluetooth in two different windows mobile devices
like i send some msg or file from 1 mobile device to another mobile device
is it possible?
plz send me the source code if its exixt
thanks all
regards
ali
|
|
|
|
|
syedaliaizazuddin wrote: plz send me the source code if its exixt
Point 2 of "How to get an answer to your question" just above says: Don't ask "can someone send me the code to create an application that does 'X'.
So, do not expect an answer any day soon.
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
oh ok dear i dnt knw what policies are here...
|
|
|
|
|
Good morning,
I have been searching for a long time, until I nailed this behaviour:
public static void Test()
{
string[] strArray = { "", ""};
List<string[]> strArrayList = new List<string[]>();
strArray[0] = "A";
strArrayList.Add(strArray);
strArray[0] = "B";
strArrayList.Add(strArray);
strArray[0] = "C";
strArrayList.Add(strArray);
MessageBox.Show("strArrayList: " + strArrayList[0][0] + strArrayList[1][0] + strArrayList[2][0]);
string str = "";
List<string> strList = new List<string>();
str = "A";
strList.Add(str);
str = "B";
strList.Add(str);
str = "C";
strList.Add(str);
MessageBox.Show("strList: " + strList[0] + strList[1] + strList[2]);
}
When I change a string and then add it to a list, everything is fine. However, when I change a string in a string array and then add this array to a list, all previously stored arrays in the list are updated as well!
Is this normal or am I doing something wrong?
Of course, there is this ridiculous work-around "strArrayList.Add(strArray.ToList().ToArray());" Which works!
Thanks in advance,
Olof
|
|
|
|
|
You have to take into account that strArray is a reference type. It seems that when you add it to strArrayList, a reference is added. Then, strArrayList contains a list of references to string arrays, which are the same array since you have been reusing the variable without reasignating it.
This is similar to what happens in the following case:
public void Test() {
string[] a = new string[] {"", ""};
string[] b = a;
a[0] = "A";
b[0] = "B";
Console.WriteLine("{0} {1}", a[0], b[0]);
}
|
|
|
|
|
|
Sorry for the lame title. But my questions is do programmable rotators exist? by rotator I means like a mechanized circle which I can attach something to it?
I can't really explain my self what it actually is ... imagine those cameras that are able to turn 180% something similar.
If you have any ideas of any brands can you please post a link I would really appreciate
Thanks.
|
|
|
|
|
Member 8505131 wrote: If you have any ideas of any brands
Questions like this are prime candidates for Google, they have little to do with C#.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
namespace cheshmak
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
static int i;
static int x = 0;
string text = "Hello Welcome (^_^) ";
private void timer1_Tick(object sender, EventArgs e)
{
timer1.Interval = 111;
label1.Text = text;
switch (x)
{
case 0:
label1.ForeColor = Color.Red;
break;
case 1:
label1.ForeColor = Color.Yellow;
break;
case 2:
label1.ForeColor = Color.Red;
break;
}
if(++x > 1)
x = 0;
label1.Text = text.Substring(0,i+1);
i++;
if (i == text.Length)
{
timer1.Interval = 3000;
i = 0;
}
}
private void Form1_Load(object sender, EventArgs e)
{
this.CenterToScreen();
label1.FlatStyle = FlatStyle.Popup;
}
}
}
|
|
|
|
|
Was there a question in here or were you just posting code for the hell of it??
|
|
|
|
|
And what's the problem, except not reading this[^] and not posting a question?
|
|
|
|
|
As the others have mentioned, is there a problem?
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
|
Hi all,
I want to implement Nested Datagrid With Dynamic RowdetailsTemplate.The depth of RowDetailsTemplate can go to n levels.
Ex:
initially Datagrid ll contain 2 rows
Item1
Item2
and when Item1 is clicked another Datagrid with its child will appear say
Item1
Item1A
Item1B
Item2
when Item1A is Clicked another grid with its childs will appear
Item1
Item1A
Item1A1
Item1A2
Item1B
Item2
This tunnel can go to n levels.
How to achieve this with rowdetails template or else any other way
Thanks and regards,
karim
|
|
|
|