We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to show/notify ggc record dirty state

Thread ID:

Created:

Updated:

Platform:

Replies:

71722 Feb 11,2008 12:06 PM UTC Apr 19,2008 02:32 AM UTC Windows Forms 4
loading
Tags: GridControl
harisan
Asked On February 11, 2008 12:06 PM UTC

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


harisan
Replied On February 15, 2008 07:46 AM UTC

Hello,

Is there any perfect method to show unsaved record state for the user?

Thanks,
Harry


x
Replied On April 10, 2008 03:28 PM UTC

f


haneefm [Syncfusion]
Replied On 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





harisan
Replied On 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


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;