Dim g As MyGridViewRow = New MyGridViewRow(e.Row) Dim d As MyDataSet.MyRow = g.DataRow g.uxOrderIdLabel.Text = d.OrderId.ToString() ' TODO: Populate other controls similarly.
Imports Microsoft.VisualBasic Imports System.Data Public Class MyGridViewRow Private _gvRow As GridViewRow '== Constructor and Public Methods ============================================================ Public Sub New(ByVal gvRow As GridViewRow) _gvRow = gvRow End Sub Public ReadOnly Property DataRow() As MyDataSet.MyRow Get Return CType(CType(_gvRow.DataItem, DataRowView).Row, MyDataSet.MyRow) End Get End Property '== Private Functions ========================================================================= Private Function FindControl(Of ControlType As {Control})(ByVal id As String) As ControlType Dim result As ControlType = Nothing Dim ctl As Object = _gvRow.FindControl(id) If ctl IsNot Nothing Then result = CType(ctl, ControlType) End If Return result End Function '== Control Properties ======================================================================== ' TODO: Create one read-only property per control on your grid view row Public ReadOnly Property uxNameLabel() As Label Get Return FindControl(Of Label)("uxNameLabel") End Get End Property End Class
TODO
ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2024, Patrick Jasinski.