Click here to Skip to main content
15,891,657 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# Pin
Pete O'Hanlon11-Sep-13 1:38
mvePete O'Hanlon11-Sep-13 1:38 
GeneralRe: C# Pin
Member 1026649411-Sep-13 1:59
Member 1026649411-Sep-13 1:59 
GeneralRe: C# Pin
Pete O'Hanlon11-Sep-13 2:51
mvePete O'Hanlon11-Sep-13 2:51 
GeneralRe: C# Pin
Keith Barrow11-Sep-13 2:20
professionalKeith Barrow11-Sep-13 2:20 
GeneralRe: C# Pin
Member 1026649411-Sep-13 1:34
Member 1026649411-Sep-13 1:34 
QuestionlistViewNV_KeyPress function it does not run ? Pin
Member 245846710-Sep-13 22:51
Member 245846710-Sep-13 22:51 
AnswerRe: listViewNV_KeyPress function it does not run ? Pin
Richard MacCutchan10-Sep-13 23:04
mveRichard MacCutchan10-Sep-13 23:04 
Questionhow can I access to a DGV column contents? Pin
babak1410-Sep-13 20:59
babak1410-Sep-13 20:59 
Hi friends :
I want to know that how can I access to a column contents?
because "Gridcol" just returns columns header and in "Finaldgv" just columns header will be added. Actually I need each columns header text with its contents. Frown | :( here ,I indicated the main line which copy "Gridcol" into "Finaldgv" by "****"
this is my code :

C#
 private static DataGridView Firstdgv;    
        private static DataGridView Finaldgv = new DataGridView();     
        private static List<string> SelectedColumns = new List<string>();  
        private static List<string> AvailableColumns = new List<string>();  
 
 
   public  void Print_DataGridView(DataGridView dgv1)
        {
            PrintPreviewDialog ppvw;
            try
            {
                // Getting DataGridView object to print
                Firstdgv = dgv1;
                 
 
                // Getting all Coulmns Names in the DataGridView
                AvailableColumns.Clear();
                foreach (DataGridViewColumn c in Firstdgv.Columns)
                {
                    if (!c.Visible) continue;
                    AvailableColumns.Add(c.HeaderText);
                }
 
                // Showing the PrintOption Form
                FrmPrintOptions dlg = new FrmPrintOptions(AvailableColumns);
                if (dlg.ShowDialog() != DialogResult.OK) return;
 
                PrintTitle = dlg.PrintTitle;
                PrintAllRows = dlg.PrintAllRows;
                FitToPageWidth = dlg.FitToPageWidth;
                SelectedColumns = dlg.GetSelectedColumns();
 
               // RowsPerPage = 0;
 
                ppvw = new PrintPreviewDialog();
 
                //ppvw.Document = printDoc;
                Finaldgv.AutoGenerateColumns = false;
                foreach (DataGridViewColumn GridCol in Firstdgv.Columns)
                {
                    if (!GridCol.Visible) continue;
                    if (!SelectedColumns.Contains(GridCol.HeaderText)) continue;
                   Finaldgv.Columns.Add((DataGridViewColumn)GridCol.Clone()); ****
                     
                 }   
 
                DGVPrinter obj = new DGVPrinter();
                obj.PrintPreviewDataGridView(Finaldgv);
 
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
}

AnswerRe: how can I access to a DGV column contents? Pin
OriginalGriff10-Sep-13 21:49
mveOriginalGriff10-Sep-13 21:49 
GeneralRe: how can I access to a DGV column contents? Pin
babak1410-Sep-13 22:47
babak1410-Sep-13 22:47 
GeneralRe: how can I access to a DGV column contents? Pin
OriginalGriff10-Sep-13 23:10
mveOriginalGriff10-Sep-13 23:10 
GeneralRe: how can I access to a DGV column contents? Pin
babak1411-Sep-13 1:29
babak1411-Sep-13 1:29 
GeneralRe: how can I access to a DGV column contents? Pin
OriginalGriff11-Sep-13 2:23
mveOriginalGriff11-Sep-13 2:23 
Questiondisplay loading processes on SplashScreen Pin
Jassim Rahma10-Sep-13 10:15
Jassim Rahma10-Sep-13 10:15 
AnswerRe: display loading processes on SplashScreen Pin
SledgeHammer0110-Sep-13 10:26
SledgeHammer0110-Sep-13 10:26 
AnswerRe: display loading processes on SplashScreen Pin
Mycroft Holmes10-Sep-13 15:00
professionalMycroft Holmes10-Sep-13 15:00 
QuestionHow can I solve this error : " Provided column already belongs to the DataGridView control" Pin
babak1410-Sep-13 7:14
babak1410-Sep-13 7:14 
AnswerRe: How can I solve this error : " Provided column already belongs to the DataGridView control" Pin
Richard Deeming10-Sep-13 7:22
mveRichard Deeming10-Sep-13 7:22 
GeneralRe: How can I solve this error : " Provided column already belongs to the DataGridView control" Pin
babak1410-Sep-13 8:03
babak1410-Sep-13 8:03 
GeneralRe: How can I solve this error : " Provided column already belongs to the DataGridView control" Pin
babak1410-Sep-13 8:16
babak1410-Sep-13 8:16 
QuestionMessageBox with textbox WPF Pin
juliogyn10-Sep-13 3:57
juliogyn10-Sep-13 3:57 
AnswerRe: MessageBox with textbox WPF Pin
Richard MacCutchan10-Sep-13 5:17
mveRichard MacCutchan10-Sep-13 5:17 
QuestionTake the first day of the month and the last day of the month ? Pin
Member 24584679-Sep-13 22:59
Member 24584679-Sep-13 22:59 
AnswerRe: Take the first day of the month and the last day of the month ? Pin
Richard MacCutchan9-Sep-13 23:43
mveRichard MacCutchan9-Sep-13 23:43 
GeneralRe: Take the first day of the month and the last day of the month ? Pin
Pete O'Hanlon10-Sep-13 0:44
mvePete O'Hanlon10-Sep-13 0:44 

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.