ahbenshaut
Well-known member
Good Day. I have been having a heck of a time trying to figure this out. If any one has any ideas, Please Tell Me!
Ok here goes...
I have a datagrid on a form that is populated by a stored procedure. I have created a datagridtablestyle so the datagrid looks like I want it to. When the datagrid is populated 2 things need to happen, 1. determine what the RegCCStatus of the account is, and depending on the status, 2. either add 10 or 45 days to the DateReceived field.
Here's a snippet of the datagridtablestyle...
<code>
Dim OverDues As New DataGridTableStyle
OverDues.MappingName = "OverDues"
Dim colDateReceived As New DataGridTextBoxColumn
Dim colAccountNum As New DataGridTextBoxColumn
Dim colRegCCStatus As New DataGridTextBoxColumn
Dim colDueDate As New DataGridTextBoxColumn
With colDateReceived
.MappingName = "ClaimReceivedDate"
.HeaderText = "Date Received"
.Width = 80
End With
With colAccountNum
.MappingName = "AccountNumber"
.HeaderText = "Account Number"
.Width = 100
.NullText = ""
.TextBox.Enabled = False
End With
With colRegCCStatus
.MappingName = "RegCCStatus"
.HeaderText = "Reg CC Status"
.Width = 110
.NullText = ""
.TextBox.Enabled = False
End With
With colDueDate <--This is where 10 or 45 days need to be added
.MappingName = "DateReceived"
.HeaderText = "Due Date"
.Width = 100
End With
With OverDues.GridColumnStyles
.Add(colCaseNumber)
.Add(colDateReceived)
.Add(colAccountNum)
.Add(colRegCCStatus)
.Add(colDueDate)
.Add(colAssignedTo)
End With
With OverDues
.AlternatingBackColor = Silver
.BackColor = White
End With
With dgOverDues
.CaptionBackColor = Maroon
.CaptionForeColor = White
.SelectionForeColor = White
.CaptionText = "OverDues"
End With
dgOverDues.TableStyles.Clear()
dgOverDues.TableStyles.Add(OverDues)
'********************************
If ds.Tables(0).Rows.Count > 0 Then
With dgOverDues
.DataSource = ds.Tables(0)
.Expand(-1)
.NavigateTo(0, "OverDues")
End With
End If
Ok here goes...
I have a datagrid on a form that is populated by a stored procedure. I have created a datagridtablestyle so the datagrid looks like I want it to. When the datagrid is populated 2 things need to happen, 1. determine what the RegCCStatus of the account is, and depending on the status, 2. either add 10 or 45 days to the DateReceived field.
Here's a snippet of the datagridtablestyle...
<code>
Dim OverDues As New DataGridTableStyle
OverDues.MappingName = "OverDues"
Dim colDateReceived As New DataGridTextBoxColumn
Dim colAccountNum As New DataGridTextBoxColumn
Dim colRegCCStatus As New DataGridTextBoxColumn
Dim colDueDate As New DataGridTextBoxColumn
With colDateReceived
.MappingName = "ClaimReceivedDate"
.HeaderText = "Date Received"
.Width = 80
End With
With colAccountNum
.MappingName = "AccountNumber"
.HeaderText = "Account Number"
.Width = 100
.NullText = ""
.TextBox.Enabled = False
End With
With colRegCCStatus
.MappingName = "RegCCStatus"
.HeaderText = "Reg CC Status"
.Width = 110
.NullText = ""
.TextBox.Enabled = False
End With
With colDueDate <--This is where 10 or 45 days need to be added
.MappingName = "DateReceived"
.HeaderText = "Due Date"
.Width = 100
End With
With OverDues.GridColumnStyles
.Add(colCaseNumber)
.Add(colDateReceived)
.Add(colAccountNum)
.Add(colRegCCStatus)
.Add(colDueDate)
.Add(colAssignedTo)
End With
With OverDues
.AlternatingBackColor = Silver
.BackColor = White
End With
With dgOverDues
.CaptionBackColor = Maroon
.CaptionForeColor = White
.SelectionForeColor = White
.CaptionText = "OverDues"
End With
dgOverDues.TableStyles.Clear()
dgOverDues.TableStyles.Add(OverDues)
'********************************
If ds.Tables(0).Rows.Count > 0 Then
With dgOverDues
.DataSource = ds.Tables(0)
.Expand(-1)
.NavigateTo(0, "OverDues")
End With
End If