Click here to Skip to main content
15,886,199 members

access selected item in list view

MaazSh asked:

Open original thread
hello,
First i'm sorry for my weak english.
I need to have an image view(telerik rad list view) and an image list,when user clicks on images of image list,the selected image appears in the picture box.
but i can't access selected item's key to show it from list box.
i have no idea how to access image key
I tried following links :
http://www.telerik.com/help/aspnet-ajax/listview-selecting-items.html[^]
http://www.telerik.com/community/forums/aspnet-ajax/listview/get-selected-value-of-radlistview.aspx[^]
http://www.telerik.com/community/forums/aspnet-ajax/listview/how-get-selecteditem-fileds-such-as-key-id-name-in-itemcommand-event.aspx[^]

but i couldn't find any way to access them.

this is my code to load image in image list and from image list to image view :
C#
 private void radButtonElement1_Click(object sender, EventArgs e)
        {
 string[] imgs;
            openFileDialog1.ShowDialog();
            imgs = openFileDialog1.FileNames;
            int i = 0;
            foreach (string im in imgs)
            {
            Bitmap bmp = new Bitmap(im);
            imageList1.Images.Add(bmp);
            ListViewDataItem item = new ListViewDataItem();
            item.Image = imageList1.Images[i];
            this.radListView1.Items.Add(item);
            i++;
            }
            radListView1.ItemSize = new Size(100, 100);
            radListView1.AllowArbitraryItemHeight = false;
            radListView1.AllowArbitraryItemWidth = false;
}

thank you.
Tags: C#, Windows Forms, Visual Studio 2012

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900