views:

161

answers:

1

hi i have gridview control in that control i need to add and image in a cell how to do it in c#..... please help me thanks in advance....

A: 

Just guessing:

This.YourDataGrid.Rows(0).Cells(0).Value = "yourStringHere";
This.YourDataGrid.Rows(0).Cells(1).Value = yourImageHere;

This.YourDataGrid.Rows.Add(new Object() {"yourStringHere", yourImage});

I'm not sure about the last line, how to inline an array, I just started coding in C#...

Edit: And make sure that the column is defined as a DataGridViewImageColumn.

Bobby
here the problem is string is going for next cell ... i need like both string and imsge should add in 0th cell only...
RV
@RV: That's not possible. I mean, workaround would be to create an image, draw the string _and_ the image into it and then show that one in the grid.
Bobby