You must Sign In to post a response.
  • Category: .NET

    Add image into a column in a gridview

    Hi ,

    here is my code.

    LocationFilesList = new ObservableCollection<storedprocedureResult>(WorkListArray.ToList());

    this LocationFilesList i am using as a itemsource in my wpf gridview.If the gender is 'M' we should add the one image to the patientnumber which is already displayed in the grid under patientnumber..we are storing any image as binaryfile in a dabase.it should be just visible in the UI in addition to patientnumber if it is 'male'.we can take the image from the project folder itself.

    How to do that?

    no need of using foreachloop because the grid may contain more than 1000 records.

    var item = (from p in LocationFilesList where p.Gender == "Male" select p).ToList();

    Can we filter like above and again can we able to add the image?If so how to do or gimme any alternative solution

    Thanks in advance.
  • #768781
    Hai Sharmila,
    You don't need to use the for loop or for-each loop for your scenario. As you need to bind the List with the data template.
    Please find below the example of having the image in the GridView column:

    http://stackoverflow.com/questions/3823323/how-to-display-values-as-images-in-gridviewcolumn

    Hope it will be helpful to you.

    Regards,
    Pawan Awasthi(DNS MVM)
    +91 8123489140 (whatsApp), +60 14365 1476(Malaysia)
    pawansoftit@gmail.com

  • #768788
    I have applied the same concept :).Anyhow Thank you for your response Pawan.


Sign In to post your comments