Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Help with a datagrid

Help with a datagrid

Scheduled Pinned Locked Moved C#
csshelplearning
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Johnny 0
    wrote on last edited by
    #1

    The following code works well, when I tab trought the emptyDataGrid the cells are in edit mode but when the form shows up, the emptyDataGrid seems to be focused because if I tab I fall in the second cell of the grid but if I just type it doesn't put the keystrokes in the first cell, it is like the first cell is not in edit mode. Tried multiple things but nothing works. Not sure what to do. The result that should be obtained is as soon as the form shows up, at the first keystroke the first cell of emptyDataGrid should be in edit mode and registering keystrokes of course. Thanks for any help. (Writing a good finder is definitely the worst thing I never tackled in programming) public void SetFinder(ref ComplexObject finderObject) { finderObject.Read(); complexObject = finderObject; dataGrid = finderObject.FinderDatagrid; dataGrid.ColumnHeadersVisible = false; datagridSplit.Panel2.Controls.Add(dataGrid); foreach (DataColumn column in finderObject.Tables[0].Columns) { if (column.ColumnMapping == MappingType.Element) { emptyTable.Columns.Add(new DataColumn(column.ColumnName, column.DataType)); } } emptyTable.Rows.Add(emptyTable.NewRow()); emptyTable.AcceptChanges(); emptyDataGrid.DataSource = emptyTable; emptyDataGrid.AllowUserToAddRows = false; emptyDataGrid.AllowUserToResizeRows = false; emptyDataGrid.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing; emptyDataGrid.Dock = DockStyle.Fill; emptyDataGrid.RowHeadersVisible = false; emptyDataGrid.ScrollBars = ScrollBars.None; datagridSplit.Panel1.Controls.Add(emptyDataGrid); datagridSplit.SplitterDistance = emptyDataGrid.PreferredSize.Height + 5; emptyDataGrid.EditingControlShowing += new DataGridViewEditingControlShowingEventHandler(emptyDataGrid_EditingControlShowing); emptyDataGrid.CellLeave += new DataGridViewCellEventHandler(emptyDataGrid_CellLeave); emptyDataGrid.CellEnter += new DataGridViewCellEventHandler(emptyDataGrid_CellEnter); dataGrid.Scroll += new ScrollEventHandler(dataGrid_Scroll); emptyDataGrid.Scroll += new ScrollEventHandler(emptyDataGrid_Scroll); empt

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups