Click here to Skip to main content
15,901,122 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to set an environmet variable in C# ? Pin
Scott Dorman12-Oct-07 2:52
professionalScott Dorman12-Oct-07 2:52 
GeneralRe: How to set an environmet variable in C# ? Pin
Dave Kreskowiak11-Oct-07 4:23
mveDave Kreskowiak11-Oct-07 4:23 
GeneralRe: How to set an environmet variable in C# ? Pin
s v joshi12-Oct-07 3:25
s v joshi12-Oct-07 3:25 
QuestionAlright, I need help with GetJSObject() Pin
shea85110-Oct-07 21:11
shea85110-Oct-07 21:11 
AnswerRe: Alright, I need help with "GetJSObject()"; Pin
Anthony Mushrow10-Oct-07 21:24
professionalAnthony Mushrow10-Oct-07 21:24 
AnswerRe: Alright, I need help with GetJSObject() Pin
wizardzz10-Apr-12 9:24
wizardzz10-Apr-12 9:24 
QuestionQuestion about active directory Pin
Robert Wang198310-Oct-07 21:10
Robert Wang198310-Oct-07 21:10 
QuestionThe value DataGridViewRow.Tag is lost after sorting Pin
Michael Sync10-Oct-07 21:01
Michael Sync10-Oct-07 21:01 
I'm facing one problem with DataGridViewRow.Tag. I set some values to DataGridViewRow.Tag. Then, I get those values whenever it is necessary. but when I do sorting the GridView by clicking the header of Girdview, all values which was set are gone...

The following is my sample code..

Filling the data to DataView

private void Form1_Load(object sender, EventArgs e)<br />
        {<br />
            // TODO: This line of code loads data into the 'employeeMgmtDataSet.Employees' table. You can move, or remove it, as needed.<br />
            this.employeesTableAdapter.Fill (this.employeeMgmtDataSet.Employees);<br />
<br />
        }


Setting the value to DataGridViewRow.Tag
private void button1_Click(object sender, EventArgs e)<br />
        {<br />
            <br />
            foreach ( DataGridViewRow dr in dataGridView1.Rows )<br />
            {<br />
               dr.Tag   = "Michael Sync";<br />
            }<br />
        }


Getting the value from DataGridViewRow.Tag
private void button2_Click(object sender, EventArgs e)<br />
       {<br />
           foreach ( DataGridViewRow dr in dataGridView1.Rows )<br />
           {<br />
               Console.WriteLine (dr.Tag.ToString ());<br />
           }<br />
       }


it works fine before sorting.. but Tag become "null" after sorting.. Why is it happening like that?

Any idea would be appreciated. Thanks in advance..



Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)

AnswerRe: The value DataGridViewRow.Tag is lost after sorting Pin
TJoe11-Oct-07 3:07
TJoe11-Oct-07 3:07 
QuestionToolStripMenuItem with ContextMenuStrip Pin
User 269896710-Oct-07 21:00
User 269896710-Oct-07 21:00 
AnswerRe: ToolStripMenuItem with ContextMenuStrip Pin
half-life10-Oct-07 21:21
half-life10-Oct-07 21:21 
GeneralRe: ToolStripMenuItem with ContextMenuStrip Pin
User 269896710-Oct-07 21:49
User 269896710-Oct-07 21:49 
GeneralRe: ToolStripMenuItem with ContextMenuStrip Pin
half-life10-Oct-07 21:53
half-life10-Oct-07 21:53 
GeneralRe: ToolStripMenuItem with ContextMenuStrip Pin
User 269896710-Oct-07 22:01
User 269896710-Oct-07 22:01 
GeneralRe: ToolStripMenuItem with ContextMenuStrip Pin
half-life10-Oct-07 22:07
half-life10-Oct-07 22:07 
QuestionThreads Pin
half-life10-Oct-07 20:56
half-life10-Oct-07 20:56 
AnswerRe: Threads Pin
Anthony Mushrow10-Oct-07 21:17
professionalAnthony Mushrow10-Oct-07 21:17 
GeneralRe: Threads Pin
half-life10-Oct-07 21:23
half-life10-Oct-07 21:23 
QuestionRegarding DIV Pin
Satish_S10-Oct-07 20:48
Satish_S10-Oct-07 20:48 
QuestionLoading data to SQL Server from .csv file Pin
Aswini Kumar10-Oct-07 20:29
Aswini Kumar10-Oct-07 20:29 
AnswerRe: Loading data to SQL Server from .csv file Pin
Rob Philpott10-Oct-07 22:22
Rob Philpott10-Oct-07 22:22 
QuestionCan I Get File Extension(openfiledialog) Pin
chanzeb10-Oct-07 20:17
chanzeb10-Oct-07 20:17 
AnswerRe: Can I Get File Extension(openfiledialog) Pin
Giorgi Dalakishvili10-Oct-07 20:19
mentorGiorgi Dalakishvili10-Oct-07 20:19 
GeneralRe: Can I Get File Extension(openfiledialog) Pin
aswini10-Oct-07 20:23
aswini10-Oct-07 20:23 
GeneralRe: Can I Get File Extension(openfiledialog) Pin
Giorgi Dalakishvili10-Oct-07 20:25
mentorGiorgi Dalakishvili10-Oct-07 20:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.