# C1.Win.FlexGrid.C1FlexGridBase.SetCellImage

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Win_FlexGrid_C1FlexGridBase_SetCellImage_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.SetCellImage*">SetCellImage Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Win_FlexGrid_C1FlexGridBase_SetCellImage_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.SetCellImage*"></a>
<h4 id="C1_Win_FlexGrid_C1FlexGridBase_SetCellImage_System_Int32_System_String_System_Drawing_Image_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.SetCellImage(System.Int32,System.String,System.Drawing.Image)">SetCellImage(int, string, Image)</h4>
<div class="markdown level1 summary"><p>Sets the image displayed in a grid cell.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void SetCellImage(int row, string colName, Image newImage)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub SetCellImage(row As Integer, colName As String, newImage As Image)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">row</span></td>
      <td><p>Row index.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">colName</span></td>
      <td><p>Column name.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.image">Image</a></td>
      <td><span class="parametername">newImage</span></td>
      <td><p>An <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.image">Image</a> object containing an image to display in the cell.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Win_FlexGrid_C1FlexGridBase_SetCellImage_System_Int32_System_String_System_Drawing_Image__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>In addition to the usual cell contents, you can display images in cells.
There are two methods for showing images in cells:</p>
<p>1. You can use the <a class="xref" href="C1.Win.FlexGrid.C1FlexGridBase.SetCellImage.html#C1_Win_FlexGrid_C1FlexGridBase_SetCellImage_System_Int32_System_String_System_Drawing_Image_">SetCellImage(int, string, Image)</a> and <a class="xref" href="C1.Win.FlexGrid.C1FlexGridBase.GetCellImage.html#C1_Win_FlexGrid_C1FlexGridBase_GetCellImage_System_Int32_System_String_">GetCellImage(int, string)</a> methods to 
assign images directly to the cells. In this case, the cell contents and the image are 
independent. To update the image, you need to call <a class="xref" href="C1.Win.FlexGrid.C1FlexGridBase.SetCellImage.html#C1_Win_FlexGrid_C1FlexGridBase_SetCellImage_System_Int32_System_String_System_Drawing_Image_">SetCellImage(int, string, Image)</a> again.</p>
<p>2. You can use the <a class="xref" href="C1.Win.FlexGrid.RowCol.ImageMap.html#C1_Win_FlexGrid_RowCol_ImageMap">ImageMap</a> property to associate images with 
specific cell values. In this case, images are updated automatically whenever the cell 
contents change. The <a class="xref" href="C1.Win.FlexGrid.RowCol.ImageAndText.html#C1_Win_FlexGrid_RowCol_ImageAndText">ImageAndText</a> property allows you to specify whether 
the control should display the images in addition to or instead of the cell text.</p>
</div>


<a id="C1_Win_FlexGrid_C1FlexGridBase_SetCellImage_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.SetCellImage*"></a>
<h4 id="C1_Win_FlexGrid_C1FlexGridBase_SetCellImage_System_Int32_System_Int32_System_Drawing_Image_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.SetCellImage(System.Int32,System.Int32,System.Drawing.Image)">SetCellImage(int, int, Image)</h4>
<div class="markdown level1 summary"><p>Sets the image displayed in a grid cell.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void SetCellImage(int row, int col, Image newImage)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub SetCellImage(row As Integer, col As Integer, newImage As Image)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">row</span></td>
      <td><p>Row index.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">col</span></td>
      <td><p>Column index.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.image">Image</a></td>
      <td><span class="parametername">newImage</span></td>
      <td><p>An <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.image">Image</a> object containing an image to display in the cell.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Win_FlexGrid_C1FlexGridBase_SetCellImage_System_Int32_System_Int32_System_Drawing_Image__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>In addition to the usual cell contents, you can display images in cells.
There are two methods for showing images in cells:</p>
<p>1. You can use the <a class="xref" href="C1.Win.FlexGrid.C1FlexGridBase.SetCellImage.html#C1_Win_FlexGrid_C1FlexGridBase_SetCellImage_System_Int32_System_String_System_Drawing_Image_">SetCellImage(int, string, Image)</a> and <a class="xref" href="C1.Win.FlexGrid.C1FlexGridBase.GetCellImage.html#C1_Win_FlexGrid_C1FlexGridBase_GetCellImage_System_Int32_System_String_">GetCellImage(int, string)</a> methods to 
assign images directly to the cells. In this case, the cell contents and the image are 
independent. To update the image, you need to call <a class="xref" href="C1.Win.FlexGrid.C1FlexGridBase.SetCellImage.html#C1_Win_FlexGrid_C1FlexGridBase_SetCellImage_System_Int32_System_String_System_Drawing_Image_">SetCellImage(int, string, Image)</a> again.</p>
<p>2. You can use the <a class="xref" href="C1.Win.FlexGrid.RowCol.ImageMap.html#C1_Win_FlexGrid_RowCol_ImageMap">ImageMap</a> property to associate images with 
specific cell values. In this case, images are updated automatically whenever the cell 
contents change. The <a class="xref" href="C1.Win.FlexGrid.RowCol.ImageAndText.html#C1_Win_FlexGrid_RowCol_ImageAndText">ImageAndText</a> property allows you to specify whether 
the control should display the images in addition to or instead of the cell text.</p>
</div>
</div>
