Click here to Skip to main content
15,896,111 members
Home / Discussions / C#
   

C#

 
GeneralRe: How do i do this assignment???? Pin
Richard MacCutchan25-Oct-18 21:52
mveRichard MacCutchan25-Oct-18 21:52 
GeneralRe: How do i do this assignment???? Pin
OriginalGriff26-Oct-18 0:47
mveOriginalGriff26-Oct-18 0:47 
AnswerRe: How do i do this assignment???? Pin
Pete O'Hanlon26-Oct-18 1:40
mvePete O'Hanlon26-Oct-18 1:40 
GeneralRe: How do i do this assignment???? Pin
Eddy Vluggen26-Oct-18 8:33
professionalEddy Vluggen26-Oct-18 8:33 
QuestionBackground worker release resources Pin
udi altman24-Oct-18 8:00
udi altman24-Oct-18 8:00 
AnswerRe: Background worker release resources Pin
OriginalGriff24-Oct-18 20:01
mveOriginalGriff24-Oct-18 20:01 
AnswerRe: Background worker release resources Pin
Eddy Vluggen25-Oct-18 0:45
professionalEddy Vluggen25-Oct-18 0:45 
QuestionDataGridView with scrollbar is flickering Pin
Shine Ashraf23-Oct-18 23:40
Shine Ashraf23-Oct-18 23:40 
I'm facing an issue , while populating data within datagridview control.
If datagridview's scroll bar is present, then it's showing a flickering and the scroll bar is not movable.
I have implemented solutions for handling double buffering, but could n't find any luck.

My working code:

C#
<pre>  public RxnDetailSelectionForm()
        {
            InitializeComponent();

            this.ClientSize = Properties.Settings.Default.RxnImportFormSize;      // restore size

            this.groupBoxSelSectionType.Enabled = false;
            this.groupBoxSelExptType.Enabled = false;
            this.groupBoxSelExptType.Visible = false;
            this.radioButtonSameSectionSameExpt.Checked = true;
            this.dataGridView1.Focus();
            PopulateData();
        }

        /// <summary>
        /// Enables the form and its contents to be double buffered
        /// </summary>
        protected override CreateParams CreateParams
        {
            get
            {
                CreateParams cp = base.CreateParams;
                cp.ExStyle |= 0x02000000;   // WS_EX_COMPOSITED
                return cp;
            }
        }

        public void PopulateData()
        {
            this.dataGridView1.Rows.Clear();
            DataTable dataTable = new DataTable("t");
            BindingSource bindingSource = new BindingSource();
            for (int i = 0; i < dataGridView1.ColumnCount; ++i)
            {
                dataTable.Columns.Add(new DataColumn(dataGridView1.Columns[i].Name));
                dataGridView1.Columns[i].DataPropertyName = dataGridView1.Columns[i].Name;
            }

            dataTable.ReadXml("SampleData.xml");
            bindingSource.DataSource = dataTable;
            dataGridView1.DataSource = bindingSource;

            this.dataGridView1.Rows[0].Selected = true;
        }

        private void RxnDetailSelectionForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            Properties.Settings.Default.RxnImportFormSize = (sender as Form).ClientSize;  // save current size
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

AnswerRe: DataGridView with scrollbar is flickering Pin
Eddy Vluggen23-Oct-18 23:48
professionalEddy Vluggen23-Oct-18 23:48 
GeneralRe: DataGridView with scrollbar is flickering Pin
Shine Ashraf24-Oct-18 0:03
Shine Ashraf24-Oct-18 0:03 
GeneralRe: DataGridView with scrollbar is flickering Pin
Eddy Vluggen24-Oct-18 0:07
professionalEddy Vluggen24-Oct-18 0:07 
AnswerRe: DataGridView with scrollbar is flickering Pin
OriginalGriff23-Oct-18 23:53
mveOriginalGriff23-Oct-18 23:53 
GeneralRe: DataGridView with scrollbar is flickering Pin
Shine Ashraf24-Oct-18 0:07
Shine Ashraf24-Oct-18 0:07 
QuestionHow to program credit card swipe in winform ? Pin
Member 245846723-Oct-18 21:18
Member 245846723-Oct-18 21:18 
AnswerRe: How to program credit card swipe in winform ? Pin
OriginalGriff23-Oct-18 21:25
mveOriginalGriff23-Oct-18 21:25 
AnswerRe: How to program credit card swipe in winform ? Pin
Chris Quinn23-Oct-18 22:59
Chris Quinn23-Oct-18 22:59 
QuestionC# Input id Insert problems Pin
7007654323-Oct-18 21:16
7007654323-Oct-18 21:16 
QuestiondateTimePicker / smtp client Pin
User 1367511423-Oct-18 1:50
User 1367511423-Oct-18 1:50 
AnswerRe: dateTimePicker / smtp client Pin
BillWoodruff23-Oct-18 3:34
professionalBillWoodruff23-Oct-18 3:34 
GeneralRe: dateTimePicker / smtp client Pin
User 1367511424-Oct-18 1:23
User 1367511424-Oct-18 1:23 
AnswerRe: dateTimePicker / smtp client Pin
OriginalGriff23-Oct-18 4:23
mveOriginalGriff23-Oct-18 4:23 
GeneralRe: dateTimePicker / smtp client Pin
User 1367511424-Oct-18 1:21
User 1367511424-Oct-18 1:21 
GeneralRe: dateTimePicker / smtp client Pin
OriginalGriff24-Oct-18 1:35
mveOriginalGriff24-Oct-18 1:35 
QuestionC# Socket TCP - Change the client class to send the file, and the server receives the file. Pin
Member 1181344422-Oct-18 6:13
Member 1181344422-Oct-18 6:13 
AnswerRe: C# Socket TCP - Change the client class to send the file, and the server receives the file. Pin
Afzaal Ahmad Zeeshan22-Oct-18 7:43
professionalAfzaal Ahmad Zeeshan22-Oct-18 7:43 

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.