Thanks. I'll try it to see how it works.
Jamestown48
Posts
-
How to sort multi-column in DataGridView? -
Trap DataGrid Sort EventThis is from MS Help file example. It might be usable to your occasion. //=================================== private void sortButton_Click(object sender, System.EventArgs e) { // Check which column is selected, otherwise set NewColumn to null. DataGridViewColumn newColumn = dataGridView1.Columns.GetColumnCount( DataGridViewElementStates.Selected) == 1 ? dataGridView1.SelectedColumns[0] : null; DataGridViewColumn oldColumn = dataGridView1.SortedColumn; ListSortDirection direction; // If oldColumn is null, then the DataGridView is not currently sorted. if (oldColumn != null) { // Sort the same column again, reversing the SortOrder. if (oldColumn == newColumn && dataGridView1.SortOrder == SortOrder.Ascending) { direction = ListSortDirection.Descending; } else { // Sort a new column and remove the old SortGlyph. direction = ListSortDirection.Ascending; oldColumn.HeaderCell.SortGlyphDirection = SortOrder.None; } } else { direction = ListSortDirection.Ascending; } // If no column has been selected, display an error dialog box. if (newColumn == null) { MessageBox.Show("Select a single column and try again.", "Error: Invalid Selection", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { dataGridView1.Sort(newColumn, direction); newColumn.HeaderCell.SortGlyphDirection = direction == ListSortDirection.Ascending ? SortOrder.Ascending : SortOrder.Descending; } } Jamestown
-
How to sort multi-column in DataGridView?When you have a DataGridView of a table how do you sort multi-column in DataGridViw? Any help will be appreciated. Thank you.:rolleyes: Jamestown
-
How to access parent form's control.Say I have a few buttons on an MDIparent form. By pressing one of the buttons I activated an MDIchild from. At this point I would like to know what kind of buttons or controls the MDIparent form has. Any help would be much appreciated. :rolleyes:
-
Turning off the insertion point.If you do that way the focus is certainly on one of the buttons. But at that moment if click the TextBox you will see the blinking cusor in the TextBox. This is not what I want. I don't want the blicking cursor show up in the TextBox until I click either (ADD) or (EDIT) button is clicked. Is this clear to you? Thanks.
-
Turning off the insertion point.Not exactly. I know TextBox.Visble=false; and TextBox.Enabled=true; This is not exactly what I want. Specifically after you creating a TextBox and when you run the form you'll see the cursor is blinking in the TextBox. ( when there is only one TextBox in the form for example). I want to turn off the blinking cursor off or make it disappear for certain period of time until the user do somthing. That's all I want. It seems so simple but I could not find anything about it in C#. Thanks.
-
Turning off the insertion point.No, I am justing creating a window form and dragged/dropped a TextBox onto the form. And when the form in running I want to hold the insertion point off until user clicks either (EDIT) or (Add) button is clicked. At that point I want the user click any Input TextBox to type in any data the user desires in the TextBox. As you all expect, as soon as the window is running and when you click the TextBox, eventhough no (EDIT) or (ADD) button is clicked, you will see the cursor (inertion point) is blinking ready to accept the input. I want the cusor to be off until the user clicks either (EDIT) or (ADD) is clicked. Is my description clear enough? Thanks.
-
Turning off the insertion point.Hi, everybody. Could anyone help me with this subtle and foolish question? My question is: How do you turn on and off the insertion point(blinking cursor)like in TextBox in C#? Thanks.