How to show/notify ggc record dirty state
Hello,
I would like to show any unsaved record by this code:
Private Sub ggc_QueryCellStyleInfo()
Dim rec As GridRecordRow = CType(IIf(TypeOf ggBusiness.Table.DisplayElements(e.TableCellIdentity.RowIndex) _
Is GridRecordRow, ggBusiness.Table.DisplayElements(e.TableCellIdentity.RowIndex), Nothing), GridRecordRow)
If Not rec Is Nothing Then
Dim dr As DataRowView = CType(IIf(TypeOf rec.GetData() Is DataRowView, rec.GetData(), Nothing), DataRowView)
If Not dr Is Nothing AndAlso dr.Row.RowState = DataRowState.Modified Then
e.Style.BackColor = Color.HotPink
Try
e.Style.CellTipText = String.Format("Previous Value: {0}", dr.Row(e.TableCellIdentity.ColIndex, DataRowVersion.Original).ToString)
Catch ex As IndexOutOfRangeException 'ChildColumn
End Try
e.Style.TextColor = Color.White
End If
End If
end sub
This code only works if user edit parent table, but didn't work for child table(backcolor didn't changed)
1. How to fix it to work on all edited tables?
2. How to change back color only on edited record field (not one row)?
3. How to make blinking cell appearance on edited cell(s) and show tooltiptext indicate original value?
Awaiting for your perfect solutions.
Best Regards and Thanks,
Harry
I would like to show any unsaved record by this code:
Private Sub ggc_QueryCellStyleInfo()
Dim rec As GridRecordRow = CType(IIf(TypeOf ggBusiness.Table.DisplayElements(e.TableCellIdentity.RowIndex) _
Is GridRecordRow, ggBusiness.Table.DisplayElements(e.TableCellIdentity.RowIndex), Nothing), GridRecordRow)
If Not rec Is Nothing Then
Dim dr As DataRowView = CType(IIf(TypeOf rec.GetData() Is DataRowView, rec.GetData(), Nothing), DataRowView)
If Not dr Is Nothing AndAlso dr.Row.RowState = DataRowState.Modified Then
e.Style.BackColor = Color.HotPink
Try
e.Style.CellTipText = String.Format("Previous Value: {0}", dr.Row(e.TableCellIdentity.ColIndex, DataRowVersion.Original).ToString)
Catch ex As IndexOutOfRangeException 'ChildColumn
End Try
e.Style.TextColor = Color.White
End If
End If
end sub
This code only works if user edit parent table, but didn't work for child table(backcolor didn't changed)
1. How to fix it to work on all edited tables?
2. How to change back color only on edited record field (not one row)?
3. How to make blinking cell appearance on edited cell(s) and show tooltiptext indicate original value?
Awaiting for your perfect solutions.
Best Regards and Thanks,
Harry
SIGN IN To post a reply.
4 Replies
HA
harisan
February 15, 2008 07:46 AM UTC
Hello,
Is there any perfect method to show unsaved record state for the user?
Thanks,
Harry
Is there any perfect method to show unsaved record state for the user?
Thanks,
Harry
X
x
April 10, 2008 03:28 PM UTC
f
HA
haneefm
Syncfusion Team
April 12, 2008 12:12 AM UTC
Hi Harry,
1. How to fix it to work on all edited tables?
2. How to change back color only on edited record field (not one row)?
>>>>>>>
You can try this code snippet.
Private Sub gridGroupingControl1_QueryCellStyleInfo(ByVal sender As Object, ByVal e As Syncfusion.WindowsForms.Grid.Grouping.GridTableCellStyleInfoEventArgs)
Dim el As Element = e.TableCellIdentity.DisplayElement
If elKind = Syncfusion.Grouping.DisplayElementKind.Record Then
Dim rec As Record = el.GetRecord()
If Not rec Is Nothing Then
Dim row As DataRowView = rec.GetData() as DataRowView
If row <> Nothing And row.Row.RowState = DataRowState.Modified Then
e.Style.BackColor = Color.Pink
End If
End If
End If
End Sub
and let me know if this helps.
3. How to make blinking cell appearance on edited cell(s) and show tooltiptext indicate original value?
>>>>>>>
Please refer to below forum thread that discuss with simillar issue.
http://www.syncfusion.com/support/Forums/message.aspx?&MessageID=68956
Best regards,
Haneef
1. How to fix it to work on all edited tables?
2. How to change back color only on edited record field (not one row)?
>>>>>>>
You can try this code snippet.
Private Sub gridGroupingControl1_QueryCellStyleInfo(ByVal sender As Object, ByVal e As Syncfusion.WindowsForms.Grid.Grouping.GridTableCellStyleInfoEventArgs)
Dim el As Element = e.TableCellIdentity.DisplayElement
If elKind = Syncfusion.Grouping.DisplayElementKind.Record Then
Dim rec As Record = el.GetRecord()
If Not rec Is Nothing Then
Dim row As DataRowView = rec.GetData() as DataRowView
If row <> Nothing And row.Row.RowState = DataRowState.Modified Then
e.Style.BackColor = Color.Pink
End If
End If
End If
End Sub
and let me know if this helps.
3. How to make blinking cell appearance on edited cell(s) and show tooltiptext indicate original value?
>>>>>>>
Please refer to below forum thread that discuss with simillar issue.
http://www.syncfusion.com/support/Forums/message.aspx?&MessageID=68956
Best regards,
Haneef
HA
harisan
April 19, 2008 02:32 AM UTC
Hello Haneef,
Thank you, it is helpful.
Would like to know how to make this code work on nested tables:
For Each record As SelectedRecord In selRecords 'del highlighted records only work on parent table
record.Record.Delete()
Next record
Last time you provide this code:
Dim el As Element = ggBusiness.Table.GetInnerMostCurrentElement() 'del rec on child/nested tables
If Not el Is Nothing Then
Dim rec As Record = el.GetRecord()
rec.Delete()
End If
But it can only delete one record each time.
I need to delete selected records work out on nested tables.
Thank you for your advise!
Best Regards,
Harry
Thank you, it is helpful.
Would like to know how to make this code work on nested tables:
For Each record As SelectedRecord In selRecords 'del highlighted records only work on parent table
record.Record.Delete()
Next record
Last time you provide this code:
Dim el As Element = ggBusiness.Table.GetInnerMostCurrentElement() 'del rec on child/nested tables
If Not el Is Nothing Then
Dim rec As Record = el.GetRecord()
rec.Delete()
End If
But it can only delete one record each time.
I need to delete selected records work out on nested tables.
Thank you for your advise!
Best Regards,
Harry
SIGN IN To post a reply.
- 4 Replies
- 3 Participants
-
HA harisan
- Feb 11, 2008 12:06 PM UTC
- Apr 19, 2008 02:32 AM UTC