Slem P
Slem P
CC#
Created by Slem P on 2/3/2023 in #help
C# wpf mvvm Datagrid filter using LINQ
So here I have a MVVM form. the Form contains a Datagrid which is connected to the Databank. I also have a ComboBox which I want to use as a filter option. The Filter option shoud filter by the "AnlV nr" so when the user selects "01" from the ComboBox the datagrid should refresh and show only that "AnlV nr" that have "01" Below I will share you the code and you can see that i've gotten as far as showing the "AnlV" values in the ComboBox but I now do not know how to do the rest and make the filter work. Below is my Viewmodel and the Xaml code. If anyone can help me with this I would really apreciate it. Viewmodel: https://paste.mod.gg/tkpwmlsfinzm/0 wpf: https://paste.mod.gg/kjpzganipcsn/0
3 replies
CC#
Created by Slem P on 11/16/2022 in #help
❔ C code wont run
C# wont run my code and i cant find out why
8 replies
CC#
Created by Slem P on 11/9/2022 in #help
❔ How do I restrict user from using numbers in Name
bool newSt = true;


while (newSt)
try
{


Console.WriteLine("Please enter the number of users you want to enter");


int iUsers = Convert.ToInt32(Console.ReadLine());



string[,] array = new string[iUsers, 3];
for (int i = 0; i < iUsers; i++)
{
Console.Write("Please enter your name: ");
string sUsrName = Console.ReadLine();
Console.Write("Please enter your nationality: ");
String sUsrNationality = Console.ReadLine();

Console.Write("Please enter your city: ");
string sUsrHome = Console.ReadLine();

array[i, 0] = sUsrName;
array[i, 1] = sUsrNationality;
array[i, 2] = sUsrResidence;
Console.WriteLine($"Name: {array[i, 0]}\nNationality: {array[i, 1]}\nCity: {array[i, 2]}");
newSt = false;
}
}
catch (SystemException)
{
Console.WriteLine("\n----Incorrect input, please try again----\n");

}
bool newSt = true;


while (newSt)
try
{


Console.WriteLine("Please enter the number of users you want to enter");


int iUsers = Convert.ToInt32(Console.ReadLine());



string[,] array = new string[iUsers, 3];
for (int i = 0; i < iUsers; i++)
{
Console.Write("Please enter your name: ");
string sUsrName = Console.ReadLine();
Console.Write("Please enter your nationality: ");
String sUsrNationality = Console.ReadLine();

Console.Write("Please enter your city: ");
string sUsrHome = Console.ReadLine();

array[i, 0] = sUsrName;
array[i, 1] = sUsrNationality;
array[i, 2] = sUsrResidence;
Console.WriteLine($"Name: {array[i, 0]}\nNationality: {array[i, 1]}\nCity: {array[i, 2]}");
newSt = false;
}
}
catch (SystemException)
{
Console.WriteLine("\n----Incorrect input, please try again----\n");

}
9 replies