Click here to Skip to main content
15,914,642 members
Home / Discussions / Windows Forms
   

Windows Forms

 
GeneralRe: mdi form Pin
darkelv1-Feb-08 3:38
darkelv1-Feb-08 3:38 
GeneralRe: mdi form Pin
Naresh1234567892-Feb-08 0:27
Naresh1234567892-Feb-08 0:27 
GeneralRe: mdi form Pin
Joachim Kerschbaumer12-Feb-08 1:37
Joachim Kerschbaumer12-Feb-08 1:37 
QuestionGenerating XML using default values in XSD Pin
GangadharMG31-Jan-08 18:46
GangadharMG31-Jan-08 18:46 
GeneralRe: Generating XML using default values in XSD Pin
led mike1-Feb-08 4:33
led mike1-Feb-08 4:33 
Questionhow to use stylesheet class for crystal reports in windows form in VS 2005 Pin
MohdImranRizvi26128129-Jan-08 21:47
MohdImranRizvi26128129-Jan-08 21:47 
AnswerRe: how to use stylesheet class for crystal reports in windows form in VS 2005 Pin
John_Adams1-Feb-08 7:42
John_Adams1-Feb-08 7:42 
GeneralFunny DataGridView Behaviour Pin
Brady Kelly28-Jan-08 10:13
Brady Kelly28-Jan-08 10:13 
From last night I was at work until 03H30 this morning, due to, among other things, what I find a strange quirk in an unbound DataGridView. When I use a class derived from DataGridViewRow, and add two or more of these rows to the grid, without populating their cells (still creating them), all my custom properties are set to null from the second row onwards. It doesn't matter whether I populate the cells of the first row or not, it always survives, but for every subsequent row, if I don't populate at least one cell, it gets sanitised. Even if the first row has no populated cells, populating one cell on a subsequent row ensures its survival.

I will illustrate. I have numbered only the lines that are relevant. The grid does not allow additions, so there are only two rows.

1. In the current state, firstRow.RowName = "Row A" and lastRow.RowName = "Row B".
2. If I comment out line 4, firstRow.RowName = "Row A" and lastRow.RowName = {null}.
3. It doesn't seem to matter at all whether lines 1 and 2 are commented out or not.



note
        public class NamedRow: DataGridViewRow
        {
            public NamedRow() {}

            public NamedRow(string rowName):this()
            {
                this.RowName = rowName;
            }
            public string RowName { get; set; }
        }        
        
        private void GridBadForm_Load(object sender, EventArgs e)
        {
            dgvLayout.Columns.Add("Column 1", "Column 1");
            dgvLayout.Columns.Add("Column 2", "Column 2");

            NamedRow namedRowA = new NamedRow("Row A");
            namedRowA.CreateCells(dgvLayout);
            //namedRowA.Cells[0].Value = "A One";
            //namedRowA.Cells[1].Value = "A Two";

            NamedRow namedRowB = new NamedRow("Row B");
            namedRowB.CreateCells(dgvLayout);
            //namedRowB.Cells[0].Value = "B One";
            namedRowB.Cells[1].Value = "B Two";

            dgvLayout.Rows.Clear();
            dgvLayout.Rows.Add(namedRowA);
            dgvLayout.Rows.Add(namedRowB);

            NamedRow firstRow = (NamedRow)dgvLayout.Rows[0];
            NamedRow lastRow = (NamedRow)dgvLayout.Rows[dgvLayout.Rows.Count - 1];
            Debug.Print(firstRow.RowName);
            Debug.Print(lastRow.RowName);
        }




GeneralFull Screen and visible start menu [modified] Pin
Spaz8027-Jan-08 22:34
Spaz8027-Jan-08 22:34 
GeneralRe: Full Screen and visible start menu Pin
Spaz8028-Jan-08 0:48
Spaz8028-Jan-08 0:48 
GeneralRe: Full Screen and visible start menu Pin
Ahmad Rifai Yusuf2-Feb-08 1:30
Ahmad Rifai Yusuf2-Feb-08 1:30 
GeneralWhere to get menus Pin
Sun Rays27-Jan-08 21:52
Sun Rays27-Jan-08 21:52 
GeneralRe: Where to get menus Pin
John_Adams28-Jan-08 18:00
John_Adams28-Jan-08 18:00 
Generalchange format of dateTimePicker in ASp.net windows application Pin
Cuckoo27-Jan-08 19:22
Cuckoo27-Jan-08 19:22 
GeneralNegative rowIndex for new DataGridViewRow Pin
Brady Kelly27-Jan-08 2:55
Brady Kelly27-Jan-08 2:55 
GeneralRe: Negative rowIndex for new DataGridViewRow Pin
Luc Pattyn27-Jan-08 3:09
sitebuilderLuc Pattyn27-Jan-08 3:09 
GeneralRe: Negative rowIndex for new DataGridViewRow Pin
Brady Kelly27-Jan-08 3:20
Brady Kelly27-Jan-08 3:20 
GeneralRe: Negative rowIndex for new DataGridViewRow Pin
Luc Pattyn27-Jan-08 4:04
sitebuilderLuc Pattyn27-Jan-08 4:04 
GeneralRe: Negative rowIndex for new DataGridViewRow Pin
Brady Kelly27-Jan-08 4:13
Brady Kelly27-Jan-08 4:13 
GeneralRe: Negative rowIndex for new DataGridViewRow Pin
Luc Pattyn27-Jan-08 4:35
sitebuilderLuc Pattyn27-Jan-08 4:35 
GeneralRe: Negative rowIndex for new DataGridViewRow Pin
Brady Kelly27-Jan-08 4:50
Brady Kelly27-Jan-08 4:50 
GeneralRe: Negative rowIndex for new DataGridViewRow Pin
Luc Pattyn27-Jan-08 5:40
sitebuilderLuc Pattyn27-Jan-08 5:40 
GeneralRe: Negative rowIndex for new DataGridViewRow Pin
Brady Kelly27-Jan-08 5:52
Brady Kelly27-Jan-08 5:52 
GeneralRe: Negative rowIndex for new DataGridViewRow Pin
Luc Pattyn27-Jan-08 6:29
sitebuilderLuc Pattyn27-Jan-08 6:29 
GeneralRe: Negative rowIndex for new DataGridViewRow Pin
Brady Kelly27-Jan-08 6:54
Brady Kelly27-Jan-08 6:54 

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.