Profile image upload option and a new ‘Settings’ option within the security module, once enabled the ‘sys-admin’ end-user can change options such as: 100% usage of the screen, new dates panel, calendar form with mobile optimization Toolbar horizontal with scrolling, optimized mobile panels, fixed bottom toolbar, new scroll up buttonĪutomatic optimization while accessing on mobile devices! features included: Which ensures we won't create a duplicate checkbox inside of the dataGridView when we refresh the Data for the grid.- Automatic optimization while accessing on mobile devices! features included (this.chbx) //// Remove so we don't have a duplicate I have also added the following if statement inside of the SetupDGV method: if ((this.chbx)) Var newLocation = new Point(headerCellLocation.X + widthVal, headerCellLocation.Y + quarterCellHeight) // Calculate the new Location for the Checkbox // Get 1/4 of the Cells height (so the checkbox sits in the center) // Get the Cell width (minus) the checkbox width (minus) any scrolling there is // Get the Horizontal Scrolling Offset (if the User has scrolled) Var headerCellLocation = dataGridView1.GetCellDisplayRectangle(0, -1, true).Location Inside the Paint Event Handler I have the following code: private void Handle_Paint(object sender, PaintEventArgs e) Instead I have used the Paint event using: += this.Handle_Paint I have removed the dataGridView1_Scroll Event Handler. Assign Click event to the Header CheckBox.Ĭbx.Click += new EventHandler(chb圎nable_Click) Point headerCellLocation = dataGridView1.GetCellDisplayRectangle(0, -1, true).Location Ĭhbx.Location = new Point(headerCellLocation.X + 60, headerCellLocation.Y + 8) private void btnRefresh_Click(object sender, EventArgs e) However, when i click the refresh button(data in gridview refresh) and i scroll the bar again, it comes with the problem below(Picture2). If (e.ScrollOrientation = ScrollOrientation.HorizontalScroll)Ĭhbx.Location = new Point( - (e.NewValue - e.OldValue), ) private void dataGridView1_Scroll(object sender, ScrollEventArgs e) Since I want to fix the checkbox header in the column when i scroll the bar, so i create 'scroll'event to handle it. I have a datagridview with multiple column and I had create a custom checkbox in one of the column header.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |