Adjust field/column

Hi,
Is there one example to include the country flag, to the field/column within Gridview, like the following?
https://dl.dropboxusercontent.com/u/40211031/tt41.png
LVL 11
HuaMin ChenSystem AnalystAsked:
Who is Participating?
 
Imran Javed ZiaConsultant Software Engineer - .NET ArchitectCommented:
Hi,
There is no built in functionality in GridView or any famous tool as per my knowledge. What you have to do is, show some image. for this you can use any of following approach:

use you country code /id and map them with related images stored on web server.
             <asp:TemplateField>
                  <ItemTemplate>
                      <asp:Image ID="Image1" ImageUrl="Image/<%#ImagePath%>_flag.png" runat="server" />
                  </ItemTemplate>
              </asp:TemplateField>

You can save flag path in database and use that path to show image/flag.
             <asp:TemplateField>
                  <ItemTemplate>
                      <asp:Image ID="Image1" ImageUrl="<%#ImagePath%>" runat="server" />
                  </ItemTemplate>
              </asp:TemplateField>
You can store flag image in database and show it where it is required.





You may find following articles helpful:
https://msdn.microsoft.com/en-us/library/aa479350.aspx
http://www.c-sharpcorner.com/UploadFile/5089e0/show-image-in-gridview-using-Asp-Net/
http://www.beansoftware.com/ASP.NET-Tutorials/Images-Database.aspx
http://codedisplay.com/display-images-in-gridview-from-sql-server-database-table-using-asp-net-c-vb-net/

Thanks and regards
0
 
kyodaiCommented:
I haven't found an example to make a country flag, but here is a general tutorial about using graphics in gridview:

http://www.codemag.com/Article/0707061
0
 
HuaMin ChenSystem AnalystAuthor Commented:
BTW, is there one url to freely download the country/area flag?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.