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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Concurrency error in GridGroupingControl

Thread ID:

Created:

Updated:

Platform:

Replies:

71382 Jan 29,2008 01:28 PM UTC May 5,2008 10:44 AM UTC WinForms 8
loading
Tags: GridControl
harisan
Asked On January 29, 2008 01:28 PM UTC

Hello,

I used griddroupingcontrol and populated data from dataset. After make changes and save the dataset, it work fine. But after made further changes in the same table and tried to save the dataset, I got DBConcurrency exception error message. Kindly advise how to correct it?

Thanks for your help and Best Regards,
Harry


haneefm [Syncfusion]
Replied On January 29, 2008 11:39 PM UTC

Hi Harry,

It is hard to trace why this issue is arising without seeing it in a live application. Is there any possible way for you to provide us with a sample that shows this exception? Can you reproduce it in one of our browser samples? It will be easier for us to have a closer look into the problem and to resolve it.

We appreciate your patience, and Thank you for the interest shown in syncfusion Product.

Best regards,
Haneef


harisan
Replied On January 30, 2008 04:34 AM UTC

Dear Haneef,

Please try to trace the problem in the file attached, I've commented any problem in the code since I also got incorrect Header text problem.

Thanks and Best Regards,
Harry



GGC problem of concurrency and header text.zip

haneefm [Syncfusion]
Replied On January 30, 2008 11:13 PM UTC

Hi Harry,

Please use the below code snippet to get the column name of gridcell in a gridgrouping control.

Private Sub gridGroupingControl1_TableControlCellClick(ByVal sender As Object, ByVal e As GridTableControlCellClickEventArgs)
Dim cm As CurrencyManager = e.TableControl.Table.GetCurrencyManager()
Dim dv As System.Data.DataView = cm.List

If Not dv Is Nothing Then
Dim col As GridColumnDescriptor = e.TableControl.Table.GetColumnDescriptorAt(e.Inner.RowIndex,e.Inner.ColIndex)
If Not col Is Nothing Then
Console.WriteLine(col.MappingName)
Console.WriteLine( dv.Table.Columns.Contains(col.MappingName) )
End If
End If
End Sub

let me know if this helps.

Best regards,
Haneef


harisan
Replied On January 31, 2008 05:02 AM UTC

Hi Haneef,

I got invalid cast exception error as follow:
Unable to cast object of type 'System.Windows.Forms.BindingSource' to type 'System.Data.DataView

on this code: Dim dv As System.Data.DataView = cm.List

Please advise how to avoid this error?

How to change the DragColumnHeaderText of Child, grandchild tables?

Private Sub AddGroupDropAreas(ByVal table As GridTable, ByVal GridName As GridGroupingControl)
Dim t As GridTable
Dim rd As Syncfusion.Grouping.RelationDescriptor = table.TableDescriptor.ParentRelation
If Not (rd Is Nothing) AndAlso rd.RelationKind <> Syncfusion.Grouping.RelationKind.RelatedMasterDetails Then
Return
End If

For Each t In table.RelatedTables
'Console.WriteLine("AddGroupDropArea " + t.Info)

GridName.AddGroupDropArea(t)
'recurse...
AddGroupDropAreas(t, GridName)

'This command failed, and the header text still show default value ! What's wrong??
GridName.GridGroupDropArea.DragColumnHeaderText = "Group Your Data"
Next t
End Sub

Thanks and Best Regards,
Harry



haneefm [Syncfusion]
Replied On February 1, 2008 05:16 PM UTC

Hi Harry,

You can try the below code to get the column headertext in TableControlCellClick event.

Private Sub gridGroupingControl1_TableControlCellClick(ByVal sender As Object, ByVal e As GridTableControlCellClickEventArgs)
Dim column As GridColumnDescriptor = e.TableControl.Table.GetColumnDescriptorAt(e.Inner.RowIndex,e.Inner.ColIndex)
If Not column Is Nothing Then
Dim colMappingName As String = column.MappingName
Dim colHeaderText As String = column.HeaderText
Console.WriteLine(colMappingName)
Console.WriteLine(colHeaderText")
Console.WriteLine( column.FieldDescriptor.GetPropertyType() )
End If
End Sub

You can use the below code snippet to set the DragColumnHeaderText that is displayed when no columns were added to GroupDropArea.

Dim c As Control
For Each c In Me.GridName.GroupDropPanel.Controls
Dim model As GridGroupDropArea = c
If Not model Is Nothing Then
model.DragColumnHeaderText = "New Text"
End If
Next

Let me know if this helps.

Best regards,
Haneef


harisan
Replied On February 2, 2008 06:48 AM UTC

Hello Haneef,

Yes, both of it worked as expected at last! THANKS.

If I tried to enable column selection by use:
.TableOptions.AllowSelection = GridSelectionFlags.None
.TableOptions.ListBoxSelectionMode = SelectionMode.MultiExtended

I need to set like above in order to work out this code:
For Each allRecord As SelectedRecord In ggc.Table.SelectedRecords
allRecord.Record.Delete()
Next

The problem is that: I can't enter new record on childtable with foreignkey relation type. Since after we click on pencil icon and click on the new row, the child table immediately closed. It was no problem for childtable with masterdetail relation type.

Please advise me how to make it works for foreignkey relation type child table?


Best Regards,
Harry


haneefm [Syncfusion]
Replied On April 24, 2008 05:20 PM UTC

Hi Harry,

You need to set the ChildTableDescriptor.AllowNew to true to enable AddNewRecord in a Foreign ChildTable. Below are the codes:

GridRelationDescriptor parentToChildRelationDescriptor = new GridRelationDescriptor();
parentToChildRelationDescriptor.Name = "Child";
parentToChildRelationDescriptor.ChildTableName = "MyChildTable"; // same as SourceListSetEntry.Name for childTable (see below)
parentToChildRelationDescriptor.RelationKind = RelationKind.ForeignKeyReference;
parentToChildRelationDescriptor.ChildTableDescriptor.AllowNew = false;
parentToChildRelationDescriptor.RelationKeys.Add("ForeignCategoryID", "CategoryID");
parentToChildRelationDescriptor.RelationKeys.Add("ForeignInsideCategoryID", "InsideCategoryID");

Best regards,
Haneef


harisan
Replied On May 5, 2008 10:44 AM UTC

Dear Haneef,

In this case, there is no way to add any data of foreign key related table by this way right?

Thanks,
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

;