|
Hi Richard,
I think selection is behaving indifferently after Next/Previous operation ...Let me Dig more into it and get back to you.
Thanks
Rakesh
|
|
|
|
|
Hi Richard,
I just tried a sample where I have a ListView and Two Buttons Next and Previous....
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
lvw1.Items.Add("Row1");
lvw1.Items.Add("Row2");
lvw1.Items.Add("Row3");
lvw1.Items.Add("Row4");
lvw1.Items.Add("Row5");
lvw1.Items.Add("Row6");
lvw1.Items.Add("Row7");
lvw1.SelectedIndex = 0;
}
private void Next_Click(object sender, RoutedEventArgs e)
{
lvw1.SelectedIndex = lvw1.SelectedIndex + 1;
}
private void Previous_Click(object sender, RoutedEventArgs e)
{
lvw1.SelectedIndex = lvw1.SelectedIndex - 1;
}
}
I make first item as selected by default.
And then on Next and Previous I just move the selected index according to the action.
Here also we can observe that when I do Mouse down and select an item and then do shift select..everything is good. for example ..Mouse down on Row2 and then Shift select Row 4.
Row2,Row3,Row4 gets selected..All good.
Now I do click on Next Row3 gets selected...Now when I do Shift Select Row 5
Row2,Row3,Row4,Row5 gets selected. which is wrong as the expected selection should have been Row3,Row4,Row5.
Now I am confused whether this is the existing behavior of WPF listview or is there a workaround for the above...
Also if we keep doing Next and then do shift selection after several Next operation I find that shift selection keeps all the selections in memory and selects bunch of rows..
Any help would be appreciated.Need this feature shipped in a week
Thanks
Rakesh
|
|
|
|
|
Hi Richard,
As a workaround...
looks like I found the solution @
http://stackoverflow.com/questions/11950021/wpf-listview-shift-selecting-multiple-items-wrong-start-item
Need to change the SelectionMode on Next and Previous Operation and set it back
private void Next_Click(object sender, RoutedEventArgs e)
{
lvw1.SelectionMode = SelectionMode.Single;
lvw1.SelectedIndex = lvw1.SelectedIndex + 1;
lvw1.SelectionMode = SelectionMode.Extended;
}
private void Previous_Click(object sender, RoutedEventArgs e)
{
lvw1.SelectionMode = SelectionMode.Single;
lvw1.SelectedIndex = lvw1.SelectedIndex - 1;
lvw1.SelectionMode = SelectionMode.Extended;
}
Thanks
Rakesh
|
|
|
|
|
Well that is the obvious answer, but you also need to check that you are not falling off either end of your list. If your selected item in the above is the last or first in the list then your index could be set to -1, or 1 beyond the end, which would be incorrect.
Use the best guess
|
|
|
|
|
Hi Richard,
Thanks a lot...It was just a sample ...I just wanted to be sure that issue was not specific to my logic in Next/Previous.
Appreciate your help..
Thanks
Rakesh
|
|
|
|
|
If you are doing selection manipulation via code, it might be that you are not clearing the local variables you have that hold the selected text.
Check if such a scenario does exist.
|
|
|
|
|
Hi Abhinav,
I just tried a sample where I have a ListView and Two Buttons Next and Previous....
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
lvw1.Items.Add("Row1");
lvw1.Items.Add("Row2");
lvw1.Items.Add("Row3");
lvw1.Items.Add("Row4");
lvw1.Items.Add("Row5");
lvw1.Items.Add("Row6");
lvw1.Items.Add("Row7");
lvw1.SelectedIndex = 0;
}
private void Next_Click(object sender, RoutedEventArgs e)
{
lvw1.SelectedIndex = lvw1.SelectedIndex + 1;
}
private void Previous_Click(object sender, RoutedEventArgs e)
{
lvw1.SelectedIndex = lvw1.SelectedIndex - 1;
}
}
I make first item as selected by default.
And then on Next and Previous I just move the selected index according to the action.
Here also we can observe that when I do Mouse down and select an item and then do shift select..everything is good. for example ..Mouse down on Row2 and then Shift select Row 4.
Row2,Row3,Row4 gets selected..All good.
Now I do click on Next Row3 gets selected...Now when I do Shift Select Row 5
Row2,Row3,Row4,Row5 gets selected. which is wrong as the expected selection should have been Row3,Row4,Row5.
Now I am confused whether this is the existing behavior of WPF listview or is there a workaround for the above...
Also if we keep doing Next and then do shift selection after several Next operation I find that shift selection keeps all the selections in memory and selects bunch of rows..
Any help would be appreciated.Need this feature shipped in a week Frown |
Thanks
Rakesh
|
|
|
|
|
Hi Abhinav,
As a workaround...
looks like I found the solution @
http://stackoverflow.com/questions/11950021/wpf-listview-shift-selecting-multiple-items-wrong-start-item
Need to change the SelectionMode on Next and Previous Operation and set it back
private void Next_Click(object sender, RoutedEventArgs e)
{
lvw1.SelectionMode = SelectionMode.Single;
lvw1.SelectedIndex = lvw1.SelectedIndex + 1;
lvw1.SelectionMode = SelectionMode.Extended;
}
private void Previous_Click(object sender, RoutedEventArgs e)
{
lvw1.SelectionMode = SelectionMode.Single;
lvw1.SelectedIndex = lvw1.SelectedIndex - 1;
lvw1.SelectionMode = SelectionMode.Extended;
}
Thanks
Rakesh
|
|
|
|
|
|
Hi Everybody Good Afternoon,
i have developed intranet web application the hr person will upload the image i will store the location
"\stplsvr03\photos\" + txtticketno.Text.Trim() + ".jpg"
here txtticketno the photo stote this name
same i have developed apllication intranet using another server
in that server if i give the imageurl=@"\stplsvr03\photos\" + txtticketno.Text.Trim() + ".jpg"
the image only showing in internet explorer non showing fire box
any one give the solution
|
|
|
|
|
The problem you're observing is due to the fact you are using a backslash \ as the path separator and not the forward slash / as written in the specification. IE is being "user friendly" (DAU) and being a child of windows it also accepts backslashes. I will not rant about how MS has done a lot of harm with this irregular behaviour because IE's stupidity doesn't stop there.
Cheers!
"I had the right to remain silent, but I didn't have the ability!"
Ron White, Comedian
|
|
|
|
|
i have this error and the solutions that i found don't work.
the error is:
-------------
Error 12 Unable to copy file "obj\x86\Debug\WindowsFormsApplication1.exe" to "bin\Debug\WindowsFormsApplication1.exe". The process cannot access the file 'bin\Debug\WindowsFormsApplication1.exe' because it is being used by another process. WindowsFormsApplication1
Error 11 Could not copy "obj\x86\Debug\WindowsFormsApplication1.exe" to "bin\Debug\WindowsFormsApplication1.exe". Exceeded retry count of
10. Failed. WindowsFormsApplication1
Warning 9 Could not copy "obj\x86\Debug\WindowsFormsApplication1.exe" to "bin\Debug\WindowsFormsApplication1.exe". Beginning retry 9 in 1000ms. The process cannot access the file 'bin\Debug\WindowsFormsApplication1.exe' because it is being used by another process. WindowsFormsApplication1
Warning 8 Could not copy "obj\x86\Debug\WindowsFormsApplication1.exe" to "bin\Debug\WindowsFormsApplication1.exe". Beginning retry 8 in 1000ms. The process cannot access the file 'bin\Debug\WindowsFormsApplication1.exe' because it is being used by another process. WindowsFormsApplication1
Warning 7 Could not copy "obj\x86\Debug\WindowsFormsApplication1.exe" to "bin\Debug\WindowsFormsApplication1.exe". Beginning retry 7 in 1000ms. The process cannot access the file 'bin\Debug\WindowsFormsApplication1.exe' because it is being used by another process. WindowsFormsApplication1
Warning 6 Could not copy "obj\x86\Debug\WindowsFormsApplication1.exe" to "bin\Debug\WindowsFormsApplication1.exe". Beginning retry 6 in 1000ms. The process cannot access the file 'bin\Debug\WindowsFormsApplication1.exe' because it is being used by another process. WindowsFormsApplication1
Warning 5 Could not copy "obj\x86\Debug\WindowsFormsApplication1.exe" to "bin\Debug\WindowsFormsApplication1.exe". Beginning retry 5 in 1000ms. The process cannot access the file 'bin\Debug\WindowsFormsApplication1.exe' because it is being used by another process. WindowsFormsApplication1
...
THE SOLUTION THAT I FIND:
-------------------------
add following lines of code to the pre-build event command line of your project.
if exist "$(TargetPath).locked" del "$(TargetPath).locked"
if exist "$(TargetPath)" if not exist "$(TargetPath).locked" move "$(TargetPath)" "$(TargetPath).locked"
SECOND SOLUTION:
--------------
if exist "$(ProjectDir)bin\$(TargetFileName).locked" del "$(ProjectDir)bin\$(TargetFileName).locked"
if exist "$(ProjectDir)bin\$(TargetFileName)" if not exist "$(ProjectDir)bin\$(TargetFileName).locked" move "$(ProjectDir)bin\$(TargetFileName)" "$(ProjectDir)bin\$(TargetFileName).locked"
Can you please help me??
|
|
|
|
|
maybe it is the basic thing to say, but did you make sure the application properly shut down before compiling it?
access the task manager and in it, under processes look for anything associated with your application
also, did you try:
Build>clean solution and then Build>rebuild
Hope this Help
Eyal
|
|
|
|
|
Thank you very much!!
Your solution it works !!!
|
|
|
|
|
|
Hello all!
how do I make the computer think the mouse has performed a scroll, thus making him respond and indeed scroll across the screen?
Thanks in advance!
|
|
|
|
|
|
Hi fellows,
I have to resolve the following problem: how can I create a MP4 video file from a bunch of images (jpg, gif, tiff or bmp)? Can somebody help me?
Thanks!
|
|
|
|
|
It's called a "slideshow".
There are many products out there (freeware and for $10+) that will take "pictures" and make a "movie".
If you're not particular about the final format, you can even use "Windows MovieMaker" (and use a MP4 converter after-the-fact if necessary).
Odds are, you may alread have other "movie maker" software on your PC if you use HP or Canon products.
Just Google: slideshow mp4
|
|
|
|
|
I don't want to buy one or to get one. I want to develop one.
|
|
|
|
|
If you would have added C# to the Google search it would have given you the answer.
|
|
|
|
|
Is this the answer to my problem, to google for some key words? Smart answer. So, we can throw away such kind of forums and use only google search. Thanks for the useful answer, it helped alot.
|
|
|
|
|
|
|
Good Morning,
I have a C# desktop application in VS10. I want to able to use an online search engine to retrieve information. I use the following code to call a webpage from the desktop:
string getPage = "http://www.theWebpage.com/";
System.Diagnostics.Process.Start(getPage);
Once I am on that page, I want to pass the information from a textbox on my application directly to a search box on the webpage. Now, I can obviously do this by cutting and pasting the info into the webpage, but what I was wondering if I can have it load the info into the search box automatically when the page loads. The closest I can come now is to automatically copy the info from the textbox using the copy function, but that still requires to user to click and paste. I know how to do this from webpage to webpage but I have never done it from a desk application before. Can it be done? Thank You...Pat
|
|
|
|