Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic CurrentScrollRow value causes exception (Read 3115 times)
Necroman
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 49
Joined: Jul 27th, 2009
CurrentScrollRow value causes exception
Aug 31st, 2009 at 9:57am
Print Post  
If I have TableNode with several rows, some of them spanned into singleline row and expanded, CurrentScrollRow is higher than 0. Then calling this causes exception:

Code
Select All
node.Rows.Clear();
int row = node.AddRow();
node[0, row].ColumnSpan = 2;
node[0, row].Text = "something"; // here 



the Rows.Clear() call doesn't reset the CurrentScrollRow counter and then, when drawing into TableNode cell some internal checks for row and col count throws an exception, that row number must be non-negative and lower than total row count, but that's true.
My solution is set CurrentScrollRow to 0 before this code block.
Expected behavior: CurrentScrollRow should be set to 0 when Rows.Clear() is called.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: CurrentScrollRow value causes exception
Reply #1 - Aug 31st, 2009 at 10:13am
Print Post  
Hi,

We haven't implemented yet the ability to modify a table by directly adding items to or removing from the TableNode member collections. You should use the RedimTable method or set the RowCount and ColumnCount properties.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Necroman
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 49
Joined: Jul 27th, 2009
Re: CurrentScrollRow value causes exception
Reply #2 - Aug 31st, 2009 at 10:30am
Print Post  
Using node.RedimTable(0, 0); instead of node.Rows.Clear(); resulted in the same exception - CurrentScrollRow has the previous value and caused exception when painting. I guess the problem is not in setting node/row count, but in resetting it.
The question is, how to redraw TableNode, if underlying object has changed - Added/Removed items, etc.?
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint