View Complete Post
I have wrote a very simple application. In the application, I added a listview control and set to virtual mode. Then I added a thread to append items into the listview. And I added a sort function for the listview. I found the application will crash
when appending data after I sort the listview.
The code of thread is below:
private void ThreadWork()
int i = 0;
BeginInvoke(new Action<int>(NotifyUI), i);
private void NotifyUI(int arg)
int i = arg;
ListViewItem item1 = new ListViewItem("item" + i / 100, 0);
item1.Checked = true;
item1.SubItems.Add(i.ToString() + "," + 1);
item1.SubItems.Add(i.ToString() + "," + 2);
this.listView1.VirtualListSize = this._listItems.Count;
this.listView1.EnsureVisible(this._listItems.Count - 1);
The sort function of listview is very simple. I just sort this._listItems. I added the code in the handler of button click.
What's wrong with
How do I change to edit mode programmatically using vb code? My edit button is not switching the record to edit mode and I get the error: The ListView 'ListView1' raised event ItemEditing which wasn't handled.. I am using a similar edit button on several FormViews and they work fine. I cannot figure out why it is not working on the ListView. I have searched the Net for a couple days without success for ideas on how to access using VB coding. Does anyone have any ideas? Thanks.
I get the following error on last line below (working on remote host): 'E:\web\sfcascom\ls_admin/uploads/images/001.JPG' is not a valid virtual path,
Note that the slashes go in different directions
I've tried a number of things but nothing seems to work. Thanks-
Partial Class Protected_imageupload
Private Sub btnUpload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUpload.Click
' Initialize variables
Dim sSavePath As String
Dim sThumbExtension As String
Dim intThumbWidth As Integer
Dim intThumbHeight As Integer
Dim sFilename As String = ""
' Set constant values
'sSavePath = "images/"
sSavePath = Server.MapPath("~/") + "ls_admin/uploads/images/"
sThumbExtension = "_thumb"
intThumbWidth = 160
intThumbHeight = 120
' If file field isn?t empty
If FilUpload.PostedFile IsNot Nothing Then
' Check file size (mustn?t be 0)
Dim myFile As Http
May i know what is the Differenc that they actually make in IIS7 .
Please tell me at a low level as i am still a novice in Asp.Net
Thanks in Advance.
I've got a listview and I've put a button control in one of the columns, I'm trying to figure out how I have listen to the button click within a certain row, but can't see the button in the dropdown for the IDs I can generate events for.
I'd like to get the primary key of the row that's been clicked on and then run a sql statement against it.
Any help would be appreciated.
As far as I understand the ListView-Control and the DataPager-Control, they work like this: The ListView gets its datarows from its data source, then the DataPager causes the ListView to display only a subset of those rows.
So what, when I want to use custom databinding for the ListView, that *already* gets the certain subset from SQL-Server (for better performance). Can I and how can I use the DataPager then?