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. Image for the cookie policy date
close icon

Using GridModel with gridControl

Hello there.
I am trying to attach a GridModel to a gridControl,
the problem is that all the settings I did don't work after attaching.
I mean
ActivateCurrentCellBehavior, AllowSelection and ShowCurrentCellBorderBehavior.
I set both gridControl's settings and gridModel options but it doesn't work.

In the attached sample you can see the GridControl looking just like I want,
but after you uncomment the "gridControl1.Attach(data);" is shows the border across selected cell which I need to avoid.

Can anyone help me with this?

Thanx.



WindowsApplication7_24aa9e16.rar

1 Reply

LS Lingaraj S Syncfusion Team June 20, 2009 07:15 AM UTC

Hi Erlan,

Thank you for your interest in Syncfusion product.

The GridControl model was disposed from the GridControl, so Exception throws in AcitivateCurrentCellBehaviour. If you want to reset the model, then please try using null value in Model property to avoid this issue.

Refer the code below:

gridControl1.Attach(data);
gridControl1.BeginUpdate();
gridControl1.Model = null;
gridControl1.Model=data;
this.gridControl1.Model.ResetGridCells();
gridControl1.EndUpdate(true);
gridControl1.Refresh();


Refer the modified sample in below link:
http://files.syncfusion.com/support/samples/Grid.Windows/Forums/ModifiedModelSmaple.zip

Please let me know if you have any queries.

Regards,
Lingaraj S.

Loader.
Live Chat Icon For mobile
Up arrow icon