<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.dotnetzone.gr:443/cs/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>WinForms</title><link>https://www.dotnetzone.gr:443/cs/forums/12/ShowForum.aspx</link><description>Θέματα για rich client / windows εφαρμογές, σε οποιαδήποτε γλώσσα (VB.NET, C#, managed C++, κ.α.)</description><dc:language>el</dc:language><generator>CommunityServer 2.1 SP3 (Build: 20423.1)</generator><item><title>Απ: datagrid datasource</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/72724.aspx</link><pubDate>Fri, 31 May 2013 22:08:49 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:72724</guid><dc:creator>Libra Storm</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/72724.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=12&amp;PostID=72724</wfw:commentRss><description>&lt;p&gt;CellFormating event ή OnFellFormating method αν το έχεις κληρονομήσει.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;a style="font-size:10pt;" href="http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.cellformatting.aspx"&gt;http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.cellformatting.aspx&lt;/a&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Απ: datagrid datasource</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/72721.aspx</link><pubDate>Fri, 31 May 2013 20:48:35 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:72721</guid><dc:creator>evagelos</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/72721.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=12&amp;PostID=72721</wfw:commentRss><description>&lt;P&gt;αλλη μια ερώτηση πανω στο ιδιο θεμα.&lt;/P&gt;
&lt;P&gt;ενα column με ονομα markcolor εχει διαφορες τιμες. (1,2,3 κλπ) &lt;BR&gt;καθε μια τιμη αντιστοιχει και σε ενα χρώμα&lt;BR&gt;1=κοκκινο &lt;BR&gt;2=μπλε &lt;BR&gt;3=κιτρινο&lt;/P&gt;
&lt;P&gt;οταν γεμιζει το gridview υπαρχει περιπτωση να αλλαζω και το χρωμα του row με την αναλογη τιμη;&lt;/P&gt;</description></item><item><title>Απ: datagrid datasource</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/72243.aspx</link><pubDate>Mon, 04 Mar 2013 20:26:42 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:72243</guid><dc:creator>evagelos</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/72243.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=12&amp;PostID=72243</wfw:commentRss><description>&lt;P&gt;οκ ολα μια χαρα&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description></item><item><title>Απ: datagrid datasource</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/72215.aspx</link><pubDate>Thu, 28 Feb 2013 07:14:56 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:72215</guid><dc:creator>Libra Storm</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/72215.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=12&amp;PostID=72215</wfw:commentRss><description>&lt;PRE&gt;&lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:black;BACKGROUND-COLOR:transparent;"&gt;&lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:blue;BACKGROUND-COLOR:transparent;"&gt;using&lt;/SPAN&gt; System;
&lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:blue;BACKGROUND-COLOR:transparent;"&gt;using&lt;/SPAN&gt; System.Collections.Generic;
&lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:blue;BACKGROUND-COLOR:transparent;"&gt;using&lt;/SPAN&gt; System.ComponentModel;
&lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:blue;BACKGROUND-COLOR:transparent;"&gt;using&lt;/SPAN&gt; System.Data;
&lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:blue;BACKGROUND-COLOR:transparent;"&gt;using&lt;/SPAN&gt; System.Drawing;
&lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:blue;BACKGROUND-COLOR:transparent;"&gt;using&lt;/SPAN&gt; System.Linq;
&lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:blue;BACKGROUND-COLOR:transparent;"&gt;using&lt;/SPAN&gt; System.Text;
&lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:blue;BACKGROUND-COLOR:transparent;"&gt;using&lt;/SPAN&gt; System.Windows.Forms;

&lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:blue;BACKGROUND-COLOR:transparent;"&gt;namespace&lt;/SPAN&gt; WindowsFormsApplication1
{
    &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:blue;BACKGROUND-COLOR:transparent;"&gt;public&lt;/SPAN&gt; partial &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:blue;BACKGROUND-COLOR:transparent;"&gt;class&lt;/SPAN&gt; Form1 : Form
    {
        &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:blue;BACKGROUND-COLOR:transparent;"&gt;public&lt;/SPAN&gt; Form1()
        {
            InitializeComponent();
        }

        &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:blue;BACKGROUND-COLOR:transparent;"&gt;private&lt;/SPAN&gt; &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:blue;BACKGROUND-COLOR:transparent;"&gt;void&lt;/SPAN&gt; Form1_Shown(&lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:blue;BACKGROUND-COLOR:transparent;"&gt;object&lt;/SPAN&gt; sender, EventArgs e)
        {
            &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:blue;BACKGROUND-COLOR:transparent;"&gt;int&lt;/SPAN&gt; i;
            DataTable dt1 &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:red;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:blue;BACKGROUND-COLOR:transparent;"&gt;new&lt;/SPAN&gt; DataTable();
            DataTable dt2 &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:red;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:blue;BACKGROUND-COLOR:transparent;"&gt;new&lt;/SPAN&gt; DataTable();
            DataRow r;

            dt1.Columns.Add(&lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:#666666;BACKGROUND-COLOR:#e4e4e4;"&gt;"descr"&lt;/SPAN&gt;);
            dt1.Columns.Add(&lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:#666666;BACKGROUND-COLOR:#e4e4e4;"&gt;"catid1"&lt;/SPAN&gt;, &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:blue;BACKGROUND-COLOR:transparent;"&gt;typeof&lt;/SPAN&gt;(&lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:blue;BACKGROUND-COLOR:transparent;"&gt;int&lt;/SPAN&gt;));

            dt2.Columns.Add(&lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:#666666;BACKGROUND-COLOR:#e4e4e4;"&gt;"catid1"&lt;/SPAN&gt;, &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:blue;BACKGROUND-COLOR:transparent;"&gt;typeof&lt;/SPAN&gt;(&lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:blue;BACKGROUND-COLOR:transparent;"&gt;int&lt;/SPAN&gt;));
            
            &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:blue;BACKGROUND-COLOR:transparent;"&gt;for&lt;/SPAN&gt; (i &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:red;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; 0; i &amp;lt; 5; i++)
            {
                r &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:red;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; dt1.NewRow();

                r[&lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:#666666;BACKGROUND-COLOR:#e4e4e4;"&gt;"descr"&lt;/SPAN&gt;] &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:red;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:#666666;BACKGROUND-COLOR:#e4e4e4;"&gt;"descr"&lt;/SPAN&gt; &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:red;BACKGROUND-COLOR:transparent;"&gt;+&lt;/SPAN&gt; i;
                r[&lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:#666666;BACKGROUND-COLOR:#e4e4e4;"&gt;"catid1"&lt;/SPAN&gt;] &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:red;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; i &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:red;BACKGROUND-COLOR:transparent;"&gt;+&lt;/SPAN&gt; 1;

                dt1.Rows.Add(r);

                r &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:red;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; dt2.NewRow();

                r[&lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:#666666;BACKGROUND-COLOR:#e4e4e4;"&gt;"catid1"&lt;/SPAN&gt;] &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:red;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; i &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:red;BACKGROUND-COLOR:transparent;"&gt;+&lt;/SPAN&gt; 1;

                dt2.Rows.Add(r);
            }

            &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:blue;BACKGROUND-COLOR:transparent;"&gt;for&lt;/SPAN&gt; (i &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:red;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; 0; i &amp;lt; dt1.Rows.Count; i++)
            {
                TabPage tbg &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:red;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:blue;BACKGROUND-COLOR:transparent;"&gt;new&lt;/SPAN&gt; TabPage(dt1.Rows&lt;img src="http://www.dotnetzone.gr/cs/emoticons/emotion-55.gif" alt="Idea" /&gt;[&lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:#666666;BACKGROUND-COLOR:#e4e4e4;"&gt;"descr"&lt;/SPAN&gt;].ToString());
                &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:green;BACKGROUND-COLOR:transparent;"&gt;//tbg.Enter += new EventHandler(tbg_Enter);&lt;/SPAN&gt;
                DataGridView gv &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:red;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:blue;BACKGROUND-COLOR:transparent;"&gt;new&lt;/SPAN&gt; DataGridView();

                gv.Name &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:red;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; dt1.Rows&lt;img src="http://www.dotnetzone.gr/cs/emoticons/emotion-55.gif" alt="Idea" /&gt;[&lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:#666666;BACKGROUND-COLOR:#e4e4e4;"&gt;"descr"&lt;/SPAN&gt;].ToString();

                gv.Dock &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:red;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; DockStyle.Fill;

                tabControl1.Controls.Add(tbg);

                gv.Name &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:red;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; dt1.Rows&lt;img src="http://www.dotnetzone.gr/cs/emoticons/emotion-55.gif" alt="Idea" /&gt;[&lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:#666666;BACKGROUND-COLOR:#e4e4e4;"&gt;"descr"&lt;/SPAN&gt;].ToString();

                gv.AllowUserToAddRows &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:red;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:blue;BACKGROUND-COLOR:transparent;"&gt;false&lt;/SPAN&gt;;

                DataTable tmpDT &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:red;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; dt2.Select(&lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:#666666;BACKGROUND-COLOR:#e4e4e4;"&gt;"catid1 = "&lt;/SPAN&gt; &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:red;BACKGROUND-COLOR:transparent;"&gt;+&lt;/SPAN&gt; dt1.Rows&lt;img src="http://www.dotnetzone.gr/cs/emoticons/emotion-55.gif" alt="Idea" /&gt;[&lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:#666666;BACKGROUND-COLOR:#e4e4e4;"&gt;"catid1"&lt;/SPAN&gt;].ToString()).CopyToDataTable();
                &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:green;BACKGROUND-COLOR:transparent;"&gt;//gv.DataSource = dt2.Select("catid1 = " + dt1.RowsIdea["catid1"].ToString()).CopyToDataTable();&lt;/SPAN&gt;

                tbg.Controls.Add(gv); &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:green;BACKGROUND-COLOR:transparent;"&gt;// πρώτα το βάζουμε&lt;/SPAN&gt;

                &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:blue;BACKGROUND-COLOR:transparent;"&gt;int&lt;/SPAN&gt; tmp2 &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:red;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; tmpDT.Rows.Count;
                gv.DataSource &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:red;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; tmpDT; &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:green;BACKGROUND-COLOR:transparent;"&gt;// και μετά το κάνουμε populate&lt;/SPAN&gt;
                &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:blue;BACKGROUND-COLOR:transparent;"&gt;int&lt;/SPAN&gt; tmpGV &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:red;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; gv.Rows.Count;

                gv.Columns[&lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:#666666;BACKGROUND-COLOR:#e4e4e4;"&gt;"catid1"&lt;/SPAN&gt;].HeaderText &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:red;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:#666666;BACKGROUND-COLOR:#e4e4e4;"&gt;"Column "&lt;/SPAN&gt; &lt;SPAN style="FONT-SIZE:11px;FONT-FAMILY:Courier New;FONT-WEIGHT:normal;COLOR:red;BACKGROUND-COLOR:transparent;"&gt;+&lt;/SPAN&gt; i;
            }
        }
    }
}&lt;/SPAN&gt;&lt;/PRE&gt;</description></item><item><title>Απ: datagrid datasource</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/72205.aspx</link><pubDate>Tue, 26 Feb 2013 17:35:50 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:72205</guid><dc:creator>evagelos</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/72205.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=12&amp;PostID=72205</wfw:commentRss><description>&lt;p&gt;τα πέρασα τα captions &lt;/p&gt;&lt;p&gt;dt2.Columns["code"].Caption = "Κωδικός";&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;αλλα πάλι τίποτα.&lt;/p&gt;&lt;p&gt;και επίσης στο grid δεν αλλάζει το headertext.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Απ: datagrid datasource</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/72202.aspx</link><pubDate>Tue, 26 Feb 2013 07:30:35 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:72202</guid><dc:creator>George J. Capnias</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/72202.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=12&amp;PostID=72202</wfw:commentRss><description>&lt;p&gt;Καλησπέρα,&lt;/p&gt;&lt;p&gt;Μερικά pointers για σένα:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Για να μπορέσει να γεμίσει το GridView από το Data Table και να πάρει σωστά τα ονόματα των columns, θα πρέπει να τα περάσεις στα Captions των columns τα ονόματα που θέλεις (dt.Columns["&lt;em&gt;ColumnName&lt;/em&gt;"].Caption = "&lt;em&gt;Column Title&lt;/em&gt;"). Δεν χρειάζεται να φτιάχνεις εσύ στις στήλες και να τις γεμίζεις στην συνέχεια&lt;/li&gt;&lt;li&gt;Έχω την εντύπωση, επειδή βάζεις στήλες από την αρχή στο DataGridView,&amp;nbsp;δεν μπορεί να τις ταιριάξει με τις στήλες του DataTable και για αυτό δεν σου βάζει δεδομένα.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/p&gt;&lt;p&gt;George J.&lt;/p&gt;</description></item><item><title>datagrid datasource</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/72200.aspx</link><pubDate>Tue, 26 Feb 2013 00:33:04 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:72200</guid><dc:creator>evagelos</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/72200.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=12&amp;PostID=72200</wfw:commentRss><description>&lt;p&gt;Γεια σας παιδια,&lt;/p&gt;&lt;p&gt;έχω μια φορμα που ανοίγω δυναμικά tabs.&lt;/p&gt;&lt;p&gt;Σε αυτά τα tabs βαζω datagrid που θέλω να έχουν τιμές απο datatable.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;table border="0" cellSpacing="0" cellPadding="0" width="100%"&gt;&lt;tr style="line-height:normal;vertical-align:top;"&gt;&lt;td style="width:40px;text-align:right;"&gt;&lt;pre style="margin:0px;padding:2px;color:gray;font-family:courier new;font-size:11px;border-right-width:1px;border-right-style:solid;"&gt;1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
 &lt;/pre&gt;&lt;/td&gt;&lt;td&gt;&lt;pre style="margin:0px;padding:2px 2px 2px 8px;"&gt;&lt;span style="color:black;font-family:Courier New;font-size:11px;font-weight:normal;background-color:transparent;"&gt;            &lt;span style="color:blue;font-family:Courier New;font-size:11px;font-weight:normal;background-color:transparent;"&gt;for&lt;/span&gt; (i &lt;span style="color:red;font-family:Courier New;font-size:11px;font-weight:normal;background-color:transparent;"&gt;=&lt;/span&gt; 0; i &amp;lt; dt1.Rows.Count; i++)
            {
                TabPage tbg &lt;span style="color:red;font-family:Courier New;font-size:11px;font-weight:normal;background-color:transparent;"&gt;=&lt;/span&gt; &lt;span style="color:blue;font-family:Courier New;font-size:11px;font-weight:normal;background-color:transparent;"&gt;new&lt;/span&gt; TabPage(dt1.Rows&lt;img src="http://www.dotnetzone.gr/cs/emoticons/emotion-55.gif" alt="Idea" /&gt;[&lt;span style="font-family:Courier New;font-size:11px;font-weight:normal;"&gt;"descr"&lt;/span&gt;].ToString());
                &lt;span style="color:green;font-family:Courier New;font-size:11px;font-weight:normal;background-color:transparent;"&gt;//tbg.Enter += new EventHandler(tbg_Enter);&lt;/span&gt;
                DataGridView gv &lt;span style="color:red;font-family:Courier New;font-size:11px;font-weight:normal;background-color:transparent;"&gt;=&lt;/span&gt; &lt;span style="color:blue;font-family:Courier New;font-size:11px;font-weight:normal;background-color:transparent;"&gt;new&lt;/span&gt; DataGridView();
                gv.Name &lt;span style="color:red;font-family:Courier New;font-size:11px;font-weight:normal;background-color:transparent;"&gt;=&lt;/span&gt; dt1.Rows&lt;img src="http://www.dotnetzone.gr/cs/emoticons/emotion-55.gif" alt="Idea" /&gt;[&lt;span style="font-family:Courier New;font-size:11px;font-weight:normal;"&gt;"descr"&lt;/span&gt;].ToString();
                gv.Dock &lt;span style="color:red;font-family:Courier New;font-size:11px;font-weight:normal;background-color:transparent;"&gt;=&lt;/span&gt; DockStyle.Fill;
                tabControl1.Controls.Add(tbg);
                gv.Name &lt;span style="color:red;font-family:Courier New;font-size:11px;font-weight:normal;background-color:transparent;"&gt;=&lt;/span&gt; dt1.Rows&lt;img src="http://www.dotnetzone.gr/cs/emoticons/emotion-55.gif" alt="Idea" /&gt;[&lt;span style="font-family:Courier New;font-size:11px;font-weight:normal;"&gt;"descr"&lt;/span&gt;].ToString();
                gv.AllowUserToAddRows &lt;span style="color:red;font-family:Courier New;font-size:11px;font-weight:normal;background-color:transparent;"&gt;=&lt;/span&gt; &lt;span style="color:blue;font-family:Courier New;font-size:11px;font-weight:normal;background-color:transparent;"&gt;false&lt;/span&gt;;
                DataTable tmpDT &lt;span style="color:red;font-family:Courier New;font-size:11px;font-weight:normal;background-color:transparent;"&gt;=&lt;/span&gt; dt2.Select(&lt;span style="font-family:Courier New;font-size:11px;font-weight:normal;"&gt;"catid1 = "&lt;/span&gt; &lt;span style="color:red;font-family:Courier New;font-size:11px;font-weight:normal;background-color:transparent;"&gt;+&lt;/span&gt; dt1.Rows&lt;img src="http://www.dotnetzone.gr/cs/emoticons/emotion-55.gif" alt="Idea" /&gt;[&lt;span style="font-family:Courier New;font-size:11px;font-weight:normal;"&gt;"catid1"&lt;/span&gt;].ToString()).CopyToDataTable();                
                &lt;span style="color:green;font-family:Courier New;font-size:11px;font-weight:normal;background-color:transparent;"&gt;//gv.DataSource = dt2.Select("catid1 = " + dt1.Rows&lt;img src="http://www.dotnetzone.gr/cs/emoticons/emotion-55.gif" alt="Idea" /&gt;["catid1"].ToString()).CopyToDataTable();&lt;/span&gt;
                                
                &lt;span style="color:blue;font-family:Courier New;font-size:11px;font-weight:normal;background-color:transparent;"&gt;int&lt;/span&gt; tmp2 &lt;span style="color:red;font-family:Courier New;font-size:11px;font-weight:normal;background-color:transparent;"&gt;=&lt;/span&gt; tmpDT.Rows.Count;
                gv.DataSource &lt;span style="color:red;font-family:Courier New;font-size:11px;font-weight:normal;background-color:transparent;"&gt;=&lt;/span&gt; tmpDT;
                &lt;span style="color:blue;font-family:Courier New;font-size:11px;font-weight:normal;background-color:transparent;"&gt;int&lt;/span&gt; tmpGV &lt;span style="color:red;font-family:Courier New;font-size:11px;font-weight:normal;background-color:transparent;"&gt;=&lt;/span&gt; gv.Rows.Count;
                

                tbg.Controls.Add(gv);&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;το πρόβλημά μου είναι ότι ενώ το tmpDT (Γραμμή 11)&amp;nbsp;ΠΑΝΤΑ έχει τιμές, το tmpGV (γραμμή 15) πάντα πέρνει την τιμή 0.&lt;/p&gt;&lt;p&gt;Με απότέλεσμα όταν πάω να αλλάξω επικεφαλίδα στο grid column να μου πετάει μήνυμα λάθους.&lt;/p&gt;&lt;pre&gt;&lt;span style="color:black;font-family:Courier New;font-size:11px;font-weight:normal;background-color:transparent;"&gt;gv.Columns[&lt;span style="font-family:Courier New;font-size:11px;font-weight:normal;"&gt;"code"&lt;/span&gt;].HeaderText &lt;span style="color:red;font-family:Courier New;font-size:11px;font-weight:normal;background-color:transparent;"&gt;=&lt;/span&gt; &lt;span style="font-family:Courier New;font-size:11px;font-weight:normal;"&gt;"Κωδικός"&lt;/span&gt;;&lt;/span&gt;&lt;/pre&gt;</description></item></channel></rss>