Hi,
I have a grid that scrolls horizontally and each column represent a day and row is a type. I use multiple IGGridViewCell based classes to achive that. The datasourcehelper CreateCell decides based on a row what class to use. ALl works great.
Now I want to replace my old implementation of editable cells with built-in feature that is available based on ColumDefinitions, but I am a little puzzled on how to do that using IGGridViewColumnDefinition since I do not have columns (it is just cell path that is being used to lookup the value while the grid is scrolled horizontally).
Am I confused for a reason or I am missing something?
Thank you
Mark
Hey Mark,
So it sounds like you're just flipping your data, right?
So every item in the array of your data represents a Column, instead of a row?
If so, that sounds like you should just use the IGGridViewSingleRowSingleFieldDataSourceHelper. Basically this DatasourceHelper flips your data automatically.
The singleRow datasource helper takes a single column definition, thats repeated, so you'd basically just move the logic in your dsh CreateCell method, to the column's CreateCell method.
Does that make sense?
-SteveZ
Steve,
Sorry, but after looking into SingleRowDatasourcehelper i am still not clear how it is going to help me.
I have 16 rows, each row has unique cells and dynamic number of columns. Today my IGGridViewDataSourceHelper returns numberofColumns, numberofFixedColumns etc.....
From rowid I know which cell to create but now I want to use editable cells feature (available in ColumnDefinitions) and am not sure how to achieve similar functionality since I do not have named column names - each row contains the same column.
any suggestion
thank you
mark
Thank you, I attempted very similar approach as well ;~)
The reason that I am going through this conversion is because at the moment I am using my own EditView field management but have problem that
after rotation and/or scrolling the cells do not get tap events anymore or do but after quite a few clicking.
Same happening here as well, just try the following steps:
take new uploaded code and run it
1. click on PT02. you will see cell is going to edit mode3. now scroll all the way to the right4.click on PT9 - cell again it is going to edit mode5. dismiss the keyboard which would turn off edit mode6. now do not scroll and just try click on PT8 and get it into edit mode - not possible.
I tried exactly what you said with the sample you attached. However, its working. in Step 6, the PT8 cell is going into edit mode, without me scrolling. I just display the editor in PT9, close the keyboard, and the click PT8.
yeah, it is inconsistent. Happening after FAST scroll most of the time.
I recorded the video using Jing (great free software) , if you see me staying on some cell for a few seconds and nothing changing - it's me trying to click w/o success.
To view just drop unzipped file into Chrome browser.
steve,
by no means i want to rush you, just was wondering if you were able to see the recording and reproduce on your side the behavior I am seeing
Sorry for the delay!
I wasn't able to reproduce that exact issue in your video. I did get a crash though in some cases. And thats related to the fact that we're not setting the _edtiCell to null in one case:
public override void DidEndDisplayingCell(IGGridView gridView, IGGridViewCell cell, IGCellPath path) { if (cell == _editCell) { IGCellPath normPath = this.NormalizePath(cell.Path); var colDef = this.ColumnDefinitions.GetItem<NSObject>(normPath.RowIndex) as IGGridViewColumnDefinition; colDef.RemoveEditor(cell.GridView, cell.Path, this, false, false); _editCell = null; } }
Adding that should avoid the crash. Perhaps thats related to the issue you're running into. However, i'm not sure why it wouldn't just be crashing for you then.
Got the fix - all good.
Thank you again
Yes, as soon as we get it fixed, we will send you a private build.
Thanks again for your patience, and creating that sample.
Hope you have a good weekend as well!
that is a great news. many days trying to resolve thinking it is to do with cells and editors until last night when I decided to add sliderview.
thank you very much
hopefully once it is fixed I will be able to get a private build again
have a great weekend
Ok i figured it out.
Looks like there is a bug in the tab view, where floating hit targets for the tabs aren't getting positioned correctly when you rotate.
My developer that works on the tab view is out today, but i'll have him look into it first thing next week.
I was able to figure out what was happening by looping through all the the views in the hierarchy and apply a border so that i could see if anything rogue was floating around.
this.applyBorderToAllSubViews (this.View); private void applyBorderToAllSubViews(UIView view) { foreach (UIView v in view.Subviews) { this.applyBorderToAllSubViews (v); v.Layer.BorderColor = UIColor.Red.CGColor; v.Layer.BorderWidth = 1; } }
Thanks for the sample. I was finally able to reproduce it!!
Unfortunately, right now i have no idea whats the issue... Its really weird. There is basically a dead spot that occurs, and you can't even scroll on that area. Something is eating the event, but if you click slightly to the left, or slightly to the right of it, it works fine...
I wish Xamarin had a visual inspector that I could use to debug like Xcode does, then i could see if there is some rogue invisible element floating there. (Although i kind of doubt it, since it eventually goes away...)
Anyways, this may take some time to debug, but i just wanted to let you know that i am looking into it.