|
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
|
|
|
|
|
|
I'm trying to build my C# project, I get the error:
The modifier 'abstract' is not valid for this item
Is the item: FieldChanged;
In the following Interface:
namespace program.Drawing.Fields
{
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
public interface IFieldHolder
{
abstract event FieldChangedEventHandler FieldChanged;
void AddField(Field field);
Field GetField(FieldType fieldType);
List<Field> GetFields();
bool HasField(FieldType fieldType);
void RemoveField(Field field);
void SetFieldValue(FieldType fieldType, object value);
}
}
|
|
|
|
|
|
Can you gave me a fix in my code
|
|
|
|
|
You just need to remove the abstract declaration for the event.
namespace program.Drawing.Fields
{
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
public interface IFieldHolder
{
event FieldChangedEventHandler FieldChanged;
void AddField(Field field);
Field GetField(FieldType fieldType);
List<Field> GetFields();
bool HasField(FieldType fieldType);
void RemoveField(Field field);
void SetFieldValue(FieldType fieldType, object value);
}
}
|
|
|
|
|
Just to expand slightly on the (correct) fix already posted: You can't put 'public' or 'abstract' on interface members, because by definition they are already public and abstract, so to prevent confusion* no access modifiers are permitted.
*: or that's what the rationale is, anyway. I think it's silly, it prevents future expansion and the fact that the default scope (public abstract) in an interface is different from that (private) in a class is more confusing than making you write 'public abstract' on things in interfaces.
|
|
|
|