<?xml version='1.0' encoding="utf-8"?>
      <rss version='2.0'>
      <channel>
      <title>Форум на Исходниках.RU</title>
      <link>https://forum.sources.ru</link>
      <description>Форум на Исходниках.RU</description>
      <generator>Форум на Исходниках.RU</generator>
  	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=319145&amp;view=findpost&amp;p=2759193</guid>
        <pubDate>Tue, 23 Nov 2010 15:15:52 +0000</pubDate>
        <title>Ошибка при добавлении новой строки в DataGridview</title>
        <link>https://forum.sources.ru/index.php?showtopic=319145&amp;view=findpost&amp;p=2759193</link>
        <description><![CDATA[coder: У меня нормально получается, может у тебя проблема с шаблонами ячеек:<br>
<div class='tag-quote'><span class='tag-quote-prefix'>Цитата</span> <div class='quote '>По крайней мере одна из управляющих колонок DataGridView не имеют шаблон ячейки.</div></div><br>
Может быть кроме добавление колонки есть еще какие-то действие?]]></description>
        <author>coder</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=319145&amp;view=findpost&amp;p=2758733</guid>
        <pubDate>Tue, 23 Nov 2010 08:24:39 +0000</pubDate>
        <title>Ошибка при добавлении новой строки в DataGridview</title>
        <link>https://forum.sources.ru/index.php?showtopic=319145&amp;view=findpost&amp;p=2758733</link>
        <description><![CDATA[Raistlin: Добавлять строки напрямую в DataGridView не принято. Установите вашему гриду какой-либо источник данных (BindingList, BindingSource и т.д. - читать MSDN) и работайте с ним. Кстати, при установке свойства AutoGenerateColumns у грида, необходимые колонки будут сгенерированы сами на основе публичных свойств класса, объекты которого содержатся в источнике.]]></description>
        <author>Raistlin</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=319145&amp;view=findpost&amp;p=2758656</guid>
        <pubDate>Tue, 23 Nov 2010 06:46:34 +0000</pubDate>
        <title>Ошибка при добавлении новой строки в DataGridview</title>
        <link>https://forum.sources.ru/index.php?showtopic=319145&amp;view=findpost&amp;p=2758656</link>
        <description><![CDATA[VoimiX: Имею следующий код для добавления новой строки в DataGridView<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">&nbsp;DataGridViewRow row = new DataGridViewRow();</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;List&#60;string&#62; str = new List&#60;string&#62;();</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;for (int i = 0; i &#60; grData.Columns.Count; i++)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;str.Add(&quot;&#60;Новое значение&#62;&quot;);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;row.CreateCells(grData, str.ToArray());</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;grData.Rows.Add(row);</div></ol></div></div></div></div><script>preloadCodeButtons('1');</script><br>
<br>
На строке <strong class='tag-b'>row.CreateCells(grData, str.ToArray());</strong> происходит ошибка<br>
<br>
<strong class='tag-b'>At least one of the DataGridView control&#39;s columns has no cell template.</strong><br>
<br>
Собственно непонятно почему такая ошибка происходит.<br>
<br>
Сами колонки добавлял так<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">DataGridViewTextBoxColumn newCol = new DataGridViewTextBoxColumn();</div><div class="code_line">newCol.HeaderText = fdc.Name;</div><div class="code_line">grData.Columns.Add(newCol);</div></ol></div></div></div></div>]]></description>
        <author>VoimiX</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      </channel>
      </rss>
	