Hi
How do I use RowFormatting to populate "custom" text into a ChildRadGridView ?
The following code populates the MasterGridView properly but my commented out code causes the program to fall over in a heap.
Any ideas ?
Kind Regards
David
How do I use RowFormatting to populate "custom" text into a ChildRadGridView ?
The following code populates the MasterGridView properly but my commented out code causes the program to fall over in a heap.
Private Sub rgvInvoices_RowFormatting(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.RowFormattingEventArgs) Handles rgvInvoices.RowFormatting |
Dim loUserRow As _the_dl_outletDataSet.UsersRow = Me._the_dl_outletDataSet.Users.FindByU_nId(CType(Me.rgvInvoices.Rows(e.RowElement.ViewInfo.CurrentIndex).Cells("I_U_nId").Value, System.Int64)) |
If loUserRow IsNot Nothing Then |
CType(e.RowElement.RowInfo.Cells("sCustomerName").CellElement, Telerik.WinControls.UI.GridCellElement).Text = loUserRow.U_sLastName & ", " & loUserRow.U_sFirstName |
End If |
CType(e.RowElement.RowInfo.Cells("sBillingAddress").CellElement, Telerik.WinControls.UI.GridCellElement).Text = CStr(Me.rgvInvoices.Rows(e.RowElement.ViewInfo.CurrentIndex).Cells("I_sBillingAddress1").Value) & vbNewLine |
If String.IsNullOrEmpty(CStr(Me.rgvInvoices.Rows(e.RowElement.ViewInfo.CurrentIndex).Cells("I_sBillingAddress2").Value)) Then |
CType(e.RowElement.RowInfo.Cells("sBillingAddress").CellElement, Telerik.WinControls.UI.GridCellElement).Text &= CStr(Me.rgvInvoices.Rows(e.RowElement.ViewInfo.CurrentIndex).Cells("I_sBillingAddress2").Value) & vbNewLine |
End If |
CType(e.RowElement.RowInfo.Cells("sBillingAddress").CellElement, Telerik.WinControls.UI.GridCellElement).Text &= CStr(Me.rgvInvoices.Rows(e.RowElement.ViewInfo.CurrentIndex).Cells("I_sBillingCity").Value) & vbNewLine & CStr(Me.rgvInvoices.Rows(e.RowElement.ViewInfo.CurrentIndex).Cells("I_sBillingCounty").Value) & vbNewLine & CStr(Me.rgvInvoices.Rows(e.RowElement.ViewInfo.CurrentIndex).Cells("I_sBillingPostCode").Value) & vbNewLine & CStr(Me.rgvInvoices.Rows(e.RowElement.ViewInfo.CurrentIndex).Cells("I_sBillingCountry").Value) |
Dim loDeliveryAddressRow As _the_dl_outletDataSet.DeliveryAddressesRow = Me._the_dl_outletDataSet.DeliveryAddresses.FindByDA_nId(CType(Me.rgvInvoices.Rows(e.RowElement.ViewInfo.CurrentIndex).Cells("I_DA_nId").Value, System.Int64)) |
If loDeliveryAddressRow IsNot Nothing Then |
CType(e.RowElement.RowInfo.Cells("sDeliveryAddress").CellElement, Telerik.WinControls.UI.GridCellElement).Text = loDeliveryAddressRow.DA_sAddress1 & vbNewLine |
If loDeliveryAddressRow.IsDA_sAddress2Null Then |
CType(e.RowElement.RowInfo.Cells("sDeliveryAddress").CellElement, Telerik.WinControls.UI.GridCellElement).Text &= loDeliveryAddressRow.DA_sAddress2 & vbNewLine |
End If |
CType(e.RowElement.RowInfo.Cells("sDeliveryAddress").CellElement, Telerik.WinControls.UI.GridCellElement).Text &= loDeliveryAddressRow.DA_sCity & vbNewLine & loDeliveryAddressRow.DA_sCounty & vbNewLine & loDeliveryAddressRow.DA_sPostCode & vbNewLine & loDeliveryAddressRow.DA_sCountry |
End If |
'Select Case CType(sender, Telerik.WinControls.UI.RadGridView).Name |
' Case "rgvInvoices" |
' Case "rgvAuditTrail" |
' Select Case CType(Me.rgvInvoices.Rows(e.RowElement.ViewInfo.CurrentIndex).Cells("AT_nType").Value, _Enum.AuditTrailTypes) |
' Case AuditTrailTypes.OrderPlaced |
' CType(e.RowElement.RowInfo.Cells("sType").CellElement, Telerik.WinControls.UI.GridCellElement).Text = "Order Placed" |
' Case AuditTrailTypes.OrderCancelled |
' CType(e.RowElement.RowInfo.Cells("sType").CellElement, Telerik.WinControls.UI.GridCellElement).Text = "Order Cancelled" |
' Case AuditTrailTypes.PaymentUnverified |
' CType(e.RowElement.RowInfo.Cells("sType").CellElement, Telerik.WinControls.UI.GridCellElement).Text = "Payment unverified" |
' Case AuditTrailTypes.PaymentVerified |
' CType(e.RowElement.RowInfo.Cells("sType").CellElement, Telerik.WinControls.UI.GridCellElement).Text = "Payment verified" |
' Case Else |
' CType(e.RowElement.RowInfo.Cells("sType").CellElement, Telerik.WinControls.UI.GridCellElement).Text = "Unknown Audit Trail entry" |
' End Select |
'End Select |
End Sub |
Any ideas ?
Kind Regards
David