The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I am attempting to use the code below in the PrepareViewStyleInfo to obtain the DataRow so that I may prepare how my GDBG is to look. The 1st and second rows will be retrieved properly, but the 3rd row and up all come back as the 2nd row.
Any help would be appreciated.
Thanks,
Virgil
Dim Row As DataRow
Dim PartType As String
Dim RecordState As GridBoundRecordState = _Grid.Binder.GetRecordStateAtRowIndex(e.RowIndex)
Dim o As Object = RecordState.ListManager.Current
Dim drv As DataRowView = CType(o, DataRowView)
Row = drv.Row
PartType = Row(ColumnNames.BaseQuoteData.PartType)
ADAdministrator Syncfusion Team April 13, 2005 12:42 AM UTC
The row being drawn is not always the current record. It is only the record at e.RowIndex which may or may not be Current.
Try:
Dim drv As DataRowView = RecordState.Table(RecordState.Position)
VIVirgilApril 13, 2005 03:50 PM UTC
Tha worked Clay. Thanks.
VIVirgilApril 15, 2005 12:08 PM UTC
Clay,
The code you provided works well except in the case of a new row. When mousing over the row, the following error is thrown (row #32 is the new row).
An unhandled exception of type ''System.IndexOutOfRangeException'' occurred in system.data.dll
Additional information: Index 32 is not non-negative and below total rows count.
ADAdministrator Syncfusion Team April 15, 2005 12:14 PM UTC
Before trying to use it, check for valid values like
RecordState.Position > -1 && RecordState.Position < RecordState.Table.Count
Or, you could check e.RowIndex < grid.Model.RowCount. The AddNew row does not have a record associated with it until it is actually added.