- queryeditor_v0.0.2.7.zip
- QueryEditor v0.0.2.7
- QueryEditor.sln
- QueryEditor.suo
- QueryEditor
- app.config
- AppIco.ico
- bin
- Debug
- Release
- Classes
- Forms
- Icons
- AppIco.ico
- BinaryObject.bmp
- Connect.png
- Copy.png
- Cut.png
- DB.ico
- Edit_Redo.png
- Edit_Undo.png
- Exec.png
- Execute.ico
- Find.png
- Folder.ico
- FunctionImg.bmp
- Open.png
- Paste.png
- Query.ico
- Refresh.png
- Replace.bmp
- Save.png
- Table.ico
- Thumbs.db
- Working.gif
- Inherited Controls
- Modules
- My Project
- obj
- QueryEditor.vbproj
- QueryEditor.vbproj.user
- Resources
- Tutorial.rar
- Temp
- QueryEditor_All.zip
- QueryEditor_All
- QueryEditor_All_v0.0.2.5.zip
- QueryEditor 0.0.2.5
- QueryEditor.sln
- QueryEditor.suo
- QueryEditor
- app.config
- AppIco.ico
- bin
- Debug
- Release
- Classes
- Forms
- Icons
- AppIco.ico
- BinaryObject.bmp
- Connect.png
- Copy.png
- Cut.png
- DB.ico
- Edit_Redo.png
- Edit_Undo.png
- Exec.png
- Execute.ico
- Find.png
- Folder.ico
- FunctionImg.bmp
- Open.png
- Paste.png
- Query.ico
- Refresh.png
- Replace.bmp
- Save.png
- Table.ico
- Thumbs.db
- Working.gif
- Inherited Controls
- Modules
- My Project
- obj
- QueryEditor.vbproj
- QueryEditor.vbproj.user
- Resources
- Tutorial.rar
- Temp
- QueryEditor_All_v0.0.2.4.zip
- QueryEditor_All v0.0.2.4
|
Imports System.ComponentModel
<ToolboxBitmap(GetType(System.Windows.Forms.DataGridView))> _
Public Class DevDataGridView
Inherits System.Windows.Forms.DataGridView
#Region "Added Properties"
#Region "IndexOnRowHeader Dealing"
''' <summary>the internal value of the IndexOnRowHeader Property,
''' and it's set to true as an initialization
''' </summary>
Private _IndexOnRowHeader As Boolean = True
''' <summary>Indicates whether each row has a header of its index(starts by 1) or not</summary>
<CategoryAttribute("Appearance")> _
<Description("Indicates whether each row has a header of its index(starts by 1) or not")> _
Public Property IndexOnRowHeader() As Boolean
Get
Return _IndexOnRowHeader
End Get
Set(ByVal value As Boolean)
If _IndexOnRowHeader <> value Then
_IndexOnRowHeader = value
If RowHeadersVisible Then ' for Optimization ,
' no need to set it if it's not Visible
For Each row As DataGridViewRow In Me.Rows
row.HeaderCell.Value = GetRowHeaderText(row.Index)
Next
End If
End If
End Set
End Property
''' <summary>
''' The header of a row could be Set from different places,
''' so I made it in a Function to uniform the operations that are done to get it
''' </summary>
''' <param name="RowIndex">Index of the row whose header you're asking for</param>
Private Function GetRowHeaderText(ByVal RowIndex As Integer) As String
Return If(Me.IndexOnRowHeader, _
CType(RowIndex + 1, String), _
String.Empty)
End Function
#End Region
#Region "Misc"
''' <summary>
''' Gives a little tip about why this control is made for
''' </summary>
<CategoryAttribute("Misc")> _
<Description("Gives a little tip about why this control is made for")> _
Public ReadOnly Property NewFeatures() As String
Get
Return "1 - Inherits System.Windows.Forms.DataGridView :" & Environment.NewLine & _
"2 - Enables you from putting the Number of each Row in its HeaderCell"
End Get
End Property
#End Region
#End Region
#Region "Added Events"
''' <summary>Occurs when the rows count of the calling instance is changed</summary>
Public Event RowsCountChanged(ByVal sender As Object, ByVal e As System.EventArgs)
''' <summary>raises RowsCountChanged events in the needed time</summary>
Private Sub OnRowsCountChanged() Handles Me.RowsAdded, Me.RowsRemoved
RaiseEvent RowsCountChanged(Me, New System.EventArgs)
End Sub
#End Region
#Region "Overrides Subs and Functions"
Protected Overrides Sub OnCellFormatting(ByVal e As System.Windows.Forms.DataGridViewCellFormattingEventArgs)
MyBase.OnCellFormatting(e)
If RowHeadersVisible Then ' for Optimization ,
' no need to set it if it's not Visible
Rows(e.RowIndex).HeaderCell.Value = GetRowHeaderText(e.RowIndex)
End If
End Sub
#End Region
End Class
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.