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.

data object load vs data indexer load method

Thread ID:





26110 Mar 14,2005 04:42 PM Mar 15,2005 08:39 AM Windows Forms 3
Tags: GridControl
Philip Bishop
Asked On March 14, 2005 04:42 PM

Ok we''ve ran in to a little problem in how we load our grids. When we first started working with loads we always loaded them doing the double for i,j loop data indexer method of loading. After doing some reading in the forum we learned about data object loading and how the time it takes to load a form was more then cut in half if not more on some of our bigger grids. I''ve asked clay some other question about that in the past. This had been working fine we thought until we started doing some extra testing. I have attached or will email a sample. Run the sample and first select a range of cells in col1 starting in row1 for a total of 5 rows. Ok now in the row header notice the rows with the header of " .... ". these are read only cells. Ok now if you click the add to col1 button there is code behind it to add 100 to all the selected cells in the range but it shouldnt do anything to the read only cells but it is. So if you notice after you clicked it added 100 to the read only cell. Now select a range in col2 starting in row one for 5 rows. then click the add to col2 button. this has the same code to add 100 to all the cells but notice after you click it it DOESNT add to the read only cell row4,col2 like it did do in col1. now if you look at my setupgrid code col1 is loaded and calculated using the data object load. col2 is loaded using the data indexer load. so my question is why isnt the readonly stopping something from changing its value like it does in the data indexer slower way of loading??

Administrator [Syncfusion]
Replied On March 14, 2005 05:20 PM

If you want the ReadOnly setting respected when using the data object directly, you will have to test it.
If Not data(row, col).GetValue(data(row, col).ReadOnlyProperty) Then
           data(row, col).SetValue(data(row, col).CellValueProperty, decWorkMax)
End If

Philip Bishop
Replied On March 15, 2005 08:37 AM

Why exactly is that? It seems like from our workings with read only all the other times in the past you cant ever make it go away and end up doing things like ignore read only. So why is this different?

Administrator [Syncfusion]
Replied On March 15, 2005 08:39 AM

You are accessing the GridControl.Data object directly to modify it. This by-passes all the code that is in GridControl (and GridControl.Model) that checks and respects things like grid.IgnoreReadOnly. If you want these checks, then use the indexer on the GridControl which does not bypass the GridControl code and hits such checks (but is slower because it does not by pass the GridControl code).


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.

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.