I have got a problem with GridView because I do not understand how can I add pictures.
This code was imported by database (in GridView):
Name id
Robert 1
Robert 2
Robert 3
In designer: I clicked the GridView -> add new column -> Choose a field type -> ImageField
Header text -> “images”
Data field -> empty
Url Format String -> empty
I want to take data id from my second column in GridView and later put it in the third column –img src=”id.jpg”– this example can help me understand GridView. Can you help me?
I will try explain better:
EXAMPLE A:<asp:BoundField DataField="id" HeaderText="id"
InsertVisible="False" ReadOnly="True" SortExpression="id" />
EXAMPLE B:<asp:ImageField HeaderText="picture" DataField="img src="id from EXAMPLE A.jpg""></asp:ImageField>
you just need to use the
DataImageUrlFormatStringproperty and ending up having yourImageFieldlike