.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Kaviya Balasubramanian
Sgraph Infotech
Imran Ghani
Post New Web Links

ListView - adding images into SubItems

Posted By:      Posted Date: September 29, 2010    Points: 0   Category :Windows Application
 

I have a listView which has Customer names, Services selected, and a Status. As for the status I would like to use images. If is Ok, or Canceled.

I would like to know how to add  images (which are in Properites.Resources) to the listView into 2rd SubItem (Status).

But most important is how then to check which image is on the selected index. So far I was using words (OK and Canceled) and it was not hard to enter these words into subItems and not even hard to check them. But I am really not sure how to do the same with images?

My listView has detailed view, and I would like to keep it this way.

 

EDIT: I did this, but the image doesnt appear:

 

ImageList imageList1 = new ImageList();

private void Form1_Load(object sender, EventArgs e)
{
 Image image1 = Properties.Resources.okIcon;
 Image image2 = Properties.Resources.cancelIcon;
 imageList1.Images.Add(image1);
 imageList1.Images.Add(image2); 
 //I have added this line of code to connect imageList with my listView:
 this.listViewLista.SmallImageList = imageList1; 
}

//and then I have a code which


View Complete Post


More Related Resource Links

WPF & ListView: Show Images

  
I'd like to show rows into listview dynamically. These rows have 2 controls: Images + Text .xaml <     ListView Height="225" HorizontalAlignment="Left" Margin="6,52,0,0" Name="ListViewHosts" VerticalAlignment="Top" Width="176" Tag="ListViewHosts">       <ListView.View>       <GridView>       <GridViewColumn Width="auto" Header="Imagen" DisplayMemberBinding="{Binding Imagen}">       <GridViewColumn.CellTemplate>       <DataTemplate>       <Image Width="10" Height="10" VerticalAlignment="Center" HorizontalAlignment="Center" Source="{Binding Imagen}"/>       </DataTemplate>       </GridViewColumn.CellTemplate>       </GridViewColumn>         <GridViewColumn Header="Host" DisplayMemberBinding="{Binding Host}"/>         </GridView>       </ListView.View>       </ListView> Code System.Drawing.   Bitmap Imagen0 = new System.Drawing

Adding watermark or text to images on uploading or displaying

  

Is there a way to process images once uploaded to my asp.net site, to put a watermark or some text across the image to copyright the images? I would like to do this server-side if possible.

The other option I have discovered here (http://wpglamour.com/how-to-watermark-all-your-uploaded-images/) would be to store the images as they are on the server, but to manipulate the display so it appears the image is watermarked . However, this solution is in PHP. Does anyone know a good PHP to VB.NET translator?! Or does anyone have a good suggested link, idea or code? Or can I add PHP to my ASP.NET site?


C# ListView groups and subItems. Multiple rows? SubItems as 2d array?

  

I am attempting to have multiple rows in one column associated with 1 ListViewItem.

I am pulling the data from an XML file with XQuery.  I am able to iterate over the multiple elements using:

listItem.Group = listView1.Groups["phone"];

var g = q.Elements("phone");//data pulled from query

 foreach( var p in g )

{

string phone_num = p.Value;

listItem.SubItems.Add(phone_num);

}

 

I have also tried:

 listItem.SubItems.Add(new ListViewItem.ListViewSubItem(listItem, phone_num));

 

I am attempting output similar to:

 

Client                Phone #      ColumnN     

--------------------------------------------

John Smith        123-4567       blahN

                        234-5677         -

Jane Smith        345-6787      blahN

Thanks in advance for any help.


show images in datalist or listview from url

  

Hello, i need to show images from url wich i have in my behind code. For example i have listview control :

 <asp:ListView ID="ListView1" runat="server">            
            <ItemTemplate>
                <div id="divItem">
                    <asp:Image ID="Image1" runat="server" ImageUrl="????" />
                </div>

Adding Dynamic Rows in ASP.NET GridView Control with TextBoxes and with Delete functionality

  
In my previous examples, I have demonstrated on how to add dynamic rows in GridView control with TextBoxes and how to save the values into the database. Now, seems that most of the developers are asking if how to add a delete functionality with it. So in this example, I'm going to show on how to delete a certain row in the dynamic GridView with TextBoxes.

Using ASP.NET 3.5's ListView and DataPager Controls: Displaying Data with the ListView

  
Prior to ASP.NET 3.5, developers who needed to display a set of records could choose between the GridView, DataList, and Repeater controls. The GridView provides rich data features, but has a very boxy layout; the DataList and Repeater allow for a more flexible layout, but lack the "point and click" data features found in the GridView, DetailsView, and FormView controls. The ListView bridges the gap between layout flexibility and built-in data features.

This article, the first in a series of articles on the ListView and DataPager controls, looks at the ListView's many available templates and illustrates how to display data. Read on to learn more!

Adding Rows in GridView without using a Database

  
This article describes on how to add rows in GridView without using a database. Basically the GridView will be populated with data based on the values entered in the TextBox on Button Click and retain the GridView data on post back.

Adding Multiple Columns and Rows in GridView without using a Database

  
This article describes on how to add multiple columns and rows in GridView without using a database. Basically the GridView will be populated with data based on the values entered in each TextBoxes on Button Click and retain the GridView data on post back.

Adding Dynamic Rows in GridView with TextBoxes

  
I decided to write this article because this has been asked so many times before at the forums(http://forums.asp.net) . Basically, this example shows on how to generate a Row in GridView with TextBoxes when clicking a Button that is residing inside a GridView Footer.

Adding Dynamic Rows in GridView with TextBoxex in C#

  
I decided to write this article because this has been asked so many times before at the forums(http://forums.asp.net) . Basically, this example shows on how to generate a Row in GridView with TextBoxes when clicking a Button that is residing inside a GridView Footer.

Creating an Excel Spreadsheet and Adding Data to It Programmatically

  
The Interoperability services make it veryeasy to work with COM Capable Applications such as Word and Excel. Thisarticle reveals using Excel from a managed application. Excel is thespreadsheet component of Microsoft Office 2000. The majority of Excelprogrammatic functionality is exposed through Automation via the typelibrary Excel9.olb. The intention of this article is to express that amanaged application can interrelate with Excel as a COM server.

Adding Search Refinements in SharePoint 2010

  
I have been playing around with SharePoint 2010 Search this morning. I love the new UI. The search refinements panel is just begging to be messed with. In my case I wanted to add the file extension JPG as an Image Type refiner.

WPF Tutorial - Using The ListView, Part 1

  
Many of the controls in WPF have a downright dizzying array of capabilities and features, due in large part to the composibility of all the components. The ListView control is a great example of this - the possibilities are almost endless. This series of tutorials on the ListView will hopefully make the space of possible options seem not quite as daunting

Images in WPF

  
How to create a Thumbnail of an Image. How to automatically crop an image. The following method allows you to automatically crop an image to it's content.

Adding Client-Side Confirmation When Deleting

  
The JavaScript confirm(string) function displays its string input parameter as the text inside a modal dialog box that comes equipped with two buttons - OK and Cancel (see Figure 1). The confirm(string) function returns a Boolean value depending on what button is clicked (true, if the user clicks OK, and false if they click Cancel).

Reading and Writing Images From a Windows Mobile Database using UltraLite 10(C#)

  
Periodically I get a request for information on how to read and write binary data to a database running on Windows Mobile. If you search the Internet you can typically find examples that are available on Windows Desktops or allow you to read and write to a local file system. The problem is that it can take a bit of work to get this code to work on Windows Mobile accessing a database.

Ultimately you might be asking, why would I want to store and image in a database? Well in an environment where you synchronizing data between a local mobile database and a consolidated (central) database this can be extremely useful. Imagine if an insurance adjuster went to an accident scene, took a picture of a damaged car, loaded it into his Windows Mobile database and then replicated that image up to the Insurance headquarters for approval. All of this could be done in a very short period of time when using images in the database. Another good example might be a doctor who was waiting for a patient chart to become available. If you could store the image in a database this chart could be sent down to the doctor's device once it became available.

For this article I am not going to get into how to synchronize the images to and from a remote and central database as this is typically fairly straightforward when using a data synchronization technologies like MobiLink

Save images to SQL CE

  
Storing binary objects (such as image, office document etc.) into database is a little cumbersome when it comes to retrieval. Hence the most commonly accepted way is only store the file path in the database, and to store the documents on a file share.
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend