|
ListView does not support ComboBox columns, but you can create your own control based on ListView and add the features you need, but that would be too time consuming. In short, go for DataGridView.
|
|
|
|
|
Thank you everyone. After taking everything into account and discussing with the previous developer, I have decided to switch to drop the ListView. There wasn't really a right answer, but thanks for all the input.
Craigslist Troll: litaly@comcast.net
"I have a theory that the truth is never told during the nine-to-five hours. "
— Hunter S. Thompson
|
|
|
|
|
how to detect programmatically that mouse pointer is placed on windows title bar and also detect when move out from title bar with c#.
tbhattacharjee
|
|
|
|
|
The standard Form object doesn't expose any events for the non-client area of a form, except for border resizing. You'd have to create your own version of the Form class, override the WndProc method and parse any WM_NCHITTEST messages you get. From here, you can raise your own custom defined events in your new form class.
You can read more on the mouse messages here[^].
You can read up on more examples of this in these Google results[^].
|
|
|
|
|
How to extract from array items at specific inidces?
List<int> ints;
int[] indices;
List<int> slected = ints select items at 'indices';
Чесноков
|
|
|
|
|
I don't see a problem here.
List<int> ints;
int[] indices;
List<int> slected=new List<int>();
ints=...;
indices=...;
foreach(int index in indices) slected.Add(ints[index]);
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
I was thinking about 1 line of code as in LINQ
selected = ints.Select(i => i[ints]);
Чесноков
|
|
|
|
|
Once you got it I'll be curious to see it. In the mean time I just use foreach(int index in indices) slected.Add(ints[index]); which is one line of code anyway.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
You can use the Where clause ie
private void indices()
{
List<int> listInts = new List<int>() { 1, -23, 45, -723, 29, 49, -90, 628, 476, 39, -10, 30 };
int[] indices = new int[] { 3, 5, 7, 9 };
var selected = listInts.Where((i, index) => !indices.Contains(index));
}
That will do it.
...and I have extensive experience writing computer code, including OIC, BTW, BRB, IMHO, LMAO, ROFL, TTYL.....
|
|
|
|
|
It may be compact and correct, but I don't like it much as it is an expensive, quadratic, operation: it will look for each element in the list of indices.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
As I stated, it will work, whether it is efficient is a completely different story. I prefer your method to be honest, but I also like to keep my hand in with these new fangled things MS keeps bringing in. Some of them are actually plenty useful, sometimes, but like all these abstractions that are creeping into our job, supposedly to make our lives easier, you have to weigh up the various options.
...and I have extensive experience writing computer code, including OIC, BTW, BRB, IMHO, LMAO, ROFL, TTYL.....
|
|
|
|
|
thanks for the hint, would you be able to solve assignement in one statement?
there is array of ints and array of objects with public int MyValue property.
the number of elements in both arrays are equal.
How to assign those all ints to every object MyValue in one pass?
for (int i = 0; i < ints.Length; i++)
objects[i].MyValue = ints[i];
Чесноков
|
|
|
|
|
Why on earth are you trying to solve this in one statement? The more you try to achieve that, the harder it's going to be for you to remember what your code actually does and how it works.
|
|
|
|
|
just to practice LINQ queries
Чесноков
|
|
|
|
|
While I agree with Pete, here is how you would do that:
ints.Select((intValue, intIndex) => intIndex).ToList().ForEach((index) => objects[index].MyValue = ints[index]);
|
|
|
|
|
List<int> selected = (from i in indices select ints[i]).ToList();
|
|
|
|
|
|
Hello, I want to create a table in c# to display result.
I create a DateTable and I entered the information in it, but now I can´t display the information in my form.
I am creating a Window Application
How can I solve it??
If Someone have any example, can give me??
Thanks
|
|
|
|
|
You need to bind it to some form of output, such as a DataGrid . Suppose you have dragged a DataGrid onto your form and called it dgResult , you need to bind the DataTable to it using the following:
dgResult.DataSource = myDataTable;
|
|
|
|
|
A DataGridView is often used to display the content of a DataTable; and data binding may make it very easy to do. There are examples everywhere, the one I have on-line is rather complex, it's in my CP Vanity article. I suggest you google DataGridView DataTable.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Yes I use a DataGridView an I use this sentences.
datagridview_table.DataSource = dttable;
datagridview_table.show();
But it doesn´t show me nothing.
Thanks
|
|
|
|
|
MiguelSanchezCuarental wrote: datagridview_table.show();
???
I've never used Show() on anything but a Form.
If you add the DGV to the Form, it gets shown automatically. Either use Visual Designer, or issue the statement this.Controls.Add(myDGV);
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
I can solve this.
Thank you very much.
|
|
|
|
|
Hi,
i'm mahesh
how to dynamically convert panel value into imageurl value using c sharp web page???
|
|
|
|
|
Would you like to try rephrasing that?
Use English this time, please...
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|