Size: 1187
Comment:
|
Size: 1616
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 14: | Line 14: |
1. Double Clicked on DGV object to create a CellContentClick event handler. To start with I'll just do a MessageBox as shown in Table I Below 1. |
1. Double Clicked on DGV object to create a CellContentClick event handler. To start with I'll just do a MessageBox as shown in Section 1 of the code below |
Line 17: | Line 16: |
if (Utilities.IsANonHeaderLinkCell((DataGridView)sender, e)) { string cellValue = (string)dgvTopics.Rows[e.RowIndex].Cells[e.ColumnIndex].Value; MessageBox.Show(cellValue); } |
{{{ //Section 1: Accessing the selected value if (Utilities.IsANonHeaderLinkCell(()sender, e)) . { . string cellValue = (string)dgvTopics.Rows[e.RowIndex].Cells[e.ColumnIndex].Value; MessageBox.Show(cellValue); } //Section 2: Utility Function used in Section 1 public static bool IsANonHeaderLinkCell(DataGridView dgv, DataGridViewCellEventArgs cellEvent) { if (dgv.Columns[cellEvent.ColumnIndex] is DataGridViewLinkColumn && cellEvent.RowIndex != -1) { return true; } else { return false; } } //Section 3: Added to MainForm_Load to sort grid this.dgvTopics.Sort(dgvTopics.Columns[1], ListSortDirection.Ascending); }}} |
Line 24: | Line 37: |
Dr. A
More info about Dr. "A" and his Wife Dr. Anderson can be found at http://www.scotnpatti.com.
Current Projects
Bible Beliefs Database Project
- Add the connection to the Data Connections in Server Explorer
- Add a data set item to the project. This is a nice gui place to create the data set. Drag and drop the tables on the page and you will build yourself a nice database diagram similar to what you would do in Visio.
Next I added a DataGridView Object, bound it to the TopicTextViewOrdered and changed the column type to DataGridViewLinkColumn.
- Note the contextMenuStrip should be where we click to add a new belief possibly
Turned TrackVisitedState to false.
Double Clicked on DGV object to create a CellContentClick event handler. To start with I'll just do a MessageBox as shown in Section 1 of the code below
//Section 1: Accessing the selected value if (Utilities.IsANonHeaderLinkCell(()sender, e)) . { . string cellValue = (string)dgvTopics.Rows[e.RowIndex].Cells[e.ColumnIndex].Value; MessageBox.Show(cellValue); } //Section 2: Utility Function used in Section 1 public static bool IsANonHeaderLinkCell(DataGridView dgv, DataGridViewCellEventArgs cellEvent) { if (dgv.Columns[cellEvent.ColumnIndex] is DataGridViewLinkColumn && cellEvent.RowIndex != -1) { return true; } else { return false; } } //Section 3: Added to MainForm_Load to sort grid this.dgvTopics.Sort(dgvTopics.Columns[1], ListSortDirection.Ascending);