FieldName property not working on EnhancedList


Author
Message
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
You could also change the CheckCurrentRowBeforeNavigate property to false so that the business object will not check the business rules on the row before it attempts to navigate the CurrentRowIndex.  The business rules would still get checked before it saves, though.
Andria Jensen
Andria Jensen
Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)
Group: Forum Members
Posts: 336, Visits: 497
I have it figure out.  I was Navigating by primary key on a FocusedRowChanged event, but the grid was firing that event when the data source was changing so it was trying to navigate when it shouldn't have been.  I changed the event to a click so it would only be on user interaction.  Works great now.
Andria Jensen
Andria Jensen
Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)
Group: Forum Members
Posts: 336, Visits: 497
When I create a new record, it creates a blank row in the grid before I have saved it.  I think this is causing my index out of range problem.  What in the BO is causing this to happen in the grid?  I don't understand how these work together...I thought it would be the same as the EnhancedList since it was inherited.
Andria Jensen
Andria Jensen
Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)
Group: Forum Members
Posts: 336, Visits: 497
Now that I have this setup with the DevEx grid I'm getting some completely different behaviors than I was with the EnhancedList.  For example, I create a new record and go to input the data into my bound fields.  I select a date from a drop-down and it checks the business rules when I do the selection instead of when I call save.  I'm not sure how this is happening, but it's causing the red error icons to pop up before I actually save.  I can't input everything in before it starts popping error icons. 

Also, If I create a new record and then undo it gives me an error sayig that the current row is out of range.  This is true because for some reason it's hanging on to the new record it creates.  I'm not sure what the difference in the interaction is between the GridControl and the BO vs. the EnhancedList and the BO, but it's very different and I'm not sure where I'm going wrong getting these to work together. 

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
It depends.  In some circumstances you may have to call the refresh.
Andria Jensen
Andria Jensen
Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)
Group: Forum Members
Posts: 336, Visits: 497
Great, I got it working.  Does that mean the grid will automatically refresh when the BO changes if you use a BusinessBindingSource?  No calling RefreshDataSource?
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
You will want to use a BusinssBindingSource control.  Simply drop it on the form and then select the BO it is supposed to wrap.  This basically emits each row with the strong-typed field properties and supports the two-way data-binding as well.
Andria Jensen
Andria Jensen
Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)
Group: Forum Members
Posts: 336, Visits: 497
Ok, so now I'm switching all these EnhancedList controls over to a straight DevExpress GridControl....thank god for inheritance!  I am having a problem though (surprise).  I am setting the data source to my BO's CurrentDataTable, but it's not populating correctly.  It almost like the rows are all there but the data isn't showing up in them.  I can scroll down and select through the grid, but the cells are blank.  The DataTable shows data when I look at it in debug, but something's not going right with the population.  Is there something else I need to do with the BO besides set the CurrentDataTable as the DataSource?  There used to be something like IsListSource, but that's gone now...is there something else?
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Well, the primary key field must be added as a column within the PopulationDataSourceSettings, or you will not be able to select it out of the columns.  In fact, the DataTable that is dynamically created to be the DataSource of the EnhancedList will not even contain the primary key value.  You're best bet might to be to use the basic DevExpress GridControl without the EnhancedList and just create a business object that contains the data you need and set it as the DataSource of the grid (through a BusinessBindingSource) which will allow you to control everything that is visible/non-visible within the grid and also control the column names themselves.
Andria Jensen
Andria Jensen
Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)
Group: Forum Members
Posts: 336, Visits: 497
Let me just add something further to explain this.  This post is actually stemming off Post#2537 where I'm trying to keep the focus from moving to the top of my EnhancedList after a requery.  That's why I started trying to do this code.  Also to note here is that my primary key field is not a visible column.  With DevExpress you can still access this column even though you can't see it.  But, with the EnhancedList that column won't be a part of DisplayFieldNames or FormatColumns or anything to do with the PopulationDataSourceSettings except for the Tag field.  I'm not sure where to go with this, but I have to make it work.
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