Hi, I need to represent hierarchical data in my XamGrid in a particular format, where expandable rows have a "+/-" next to them. To accomplish this, I overrode the TextColumn class and its TextColumnContentProvider to add in the +/- behavior. It works, but when the window is grown, for some reason the cells that were not visible before don't display their data. What can I do to fix this?
I tried to attach a sample solution illustrating the problem, but the forum kept giving me "500 Server Error" errors (I guess you guys are having problems with the new site). I don't have access to filesharing websites on this PC, but if you email me then I can reply with the solution.
Thanks!
HI,
I am reviewing your issue and have replicated it.
I am working on a resolution.
Sincerely, Matt Developer Support Engineer
I was able to prevent the nullrefrence execption with the following code snippet:
void expandBlock_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { var r = (Row)_cell.Row; r.IsExpanded = !r.IsExpanded; ExpandColumnClickEventArgs _clickeventargs = new ExpandColumnClickEventArgs(_cell.Row.Index, _cell.Row.Data); if (_column != null) { _column.OnClick(_clickeventargs); } else { _column = _cell.Column as ExpandColumn; _column.OnClick(_clickeventargs); } }
void expandBlock_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
var r = (Row)_cell.Row;
r.IsExpanded = !r.IsExpanded;
ExpandColumnClickEventArgs _clickeventargs = new ExpandColumnClickEventArgs(_cell.Row.Index, _cell.Row.Data);
if (_column != null)
_column.OnClick(_clickeventargs); }
else
{ _column = _cell.Column as ExpandColumn;
_column.OnClick(_clickeventargs);
} }
Here is a forum post on creating Custom Columns: http://ko.infragistics.com/community/blogs/devin_rader/archive/2010/07/08/creating-custom-columns-for-xamgrid.aspx
Hi, I tried using that code snippet, but I'm still getting disappearing values when I resize the window.
Please let me know if you need further assistance regarding this case.
Sincerely,
MattDeveloper Support Engineer
If you change the ResolveDisplayElement method to return the dataBlock rather than the stackpanel then the issue isn't present.