Datagrid Issues


Author
Message
Scott Hershberger
Scott Hershberger
StrataFrame Beginner (10 reputation)StrataFrame Beginner (10 reputation)StrataFrame Beginner (10 reputation)StrataFrame Beginner (10 reputation)StrataFrame Beginner (10 reputation)StrataFrame Beginner (10 reputation)StrataFrame Beginner (10 reputation)StrataFrame Beginner (10 reputation)StrataFrame Beginner (10 reputation)
Group: Forum Members
Posts: 10, Visits: 26
I need to fill a datagrid based on multiple tables in the database. I got this accomplished by adding custom values to the bo and it works great. It's very fast. I am now having two issues though. One, I cannot sort on a custom value column. I simply get a column not found error. Second, and this may be .net related, when I close .net and open it again, my datagrid is filled in, not only with the columns that I had previously specified, but with everything from the BO added on, even copies of what I already had there. Does anyone have any idea how to fix either of these?



Thanks
Reply
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Point A is not understood.

Well, this is a more lengthy topic and a brief answer is not very easy.  There are a lot of ways to sort within .NET.  When you bind to a grid, it expects the IBindingList interface.  The SF BusinessBindingSource provides a way to wrap a business object with this interface.  The way the grid interprets this is that each row is a unique business object with the value that is on that specific row.  So when you start introducing custom columns for soirting, I would have to understand what your custom field is even doing before I could give you much of an answer.

Any idea on this?

OK.  This is your grid not serializing the columns that were created the last time you were in teh designer...or...it is overwriting the columns that were saved.  This is the grid, not SF.  When you define the columns to show in the grid, it will create a collection and store this in a grid property.  Depending which grid you are using this will be different everytime.  But the one thing that is consistent regardless of the grid type is that it will save this to the .designer file so the next time you come back in it will load up its column collection and know which columns will be in the grid.  Your designer is not remembering this for some reason.  This too can be caused from a large number of things and giving a concrete answer to the exact cause would be difficult at best.  The the reason the columns are not remembered is because of the .designer file or the constructor code of the grid.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search