I have an issue with some of my IsDirty logic using the RadGrid control. Basically we are inheriting the RadGrid control to create what is called RadGridView control in our pages.
Here is the logic to capture the grid data for an initial capture and for a current capture...
<P><FONT color=#2b91af size=2>RadGridView</FONT><FONT size=2> rgv = |
(</FONT><FONT color=#2b91af size=2>RadGridView</FONT><FONT |
size=2>)childControl;</P> |
<P></FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> |
saveCurrentPageIndex = rgv.CurrentPageIndex;</P> |
<P></P> |
<P></FONT><FONT color=#0000ff size=2>for</FONT><FONT size=2> (</FONT><FONT |
color=#0000ff size=2>int</FONT><FONT size=2> p = 0; p < rgv.PageCount; |
p++)</P> |
<P>{</P> |
<P>rgv.CurrentPageIndex = p;</P> |
<P>rgv.Rebind();</P> |
<P></FONT><FONT color=#0000ff size=2>for</FONT><FONT size=2> (</FONT><FONT |
color=#0000ff size=2>int</FONT><FONT size=2> r = 0; r < rgv.Items.Count; |
r++)</P> |
<P>{</P> |
<P></FONT><FONT color=#0000ff size=2>for</FONT><FONT size=2> (</FONT><FONT |
color=#0000ff size=2>int</FONT><FONT size=2> c = 0; c < |
rgv.Items[r].Cells.Count; c++)</P> |
<P>{</P> |
<P>controlValues.Append(rgv.ClientID);</P> |
<P>controlValues.Append(</FONT><FONT color=#a31515 size=2>"_Pg"</FONT><FONT |
size=2> + p + </FONT><FONT color=#a31515 size=2>"Row"</FONT><FONT size=2> + r + |
</FONT><FONT color=#a31515 size=2>"Col"</FONT><FONT size=2> + c);</P> |
<P>controlValues.Append(</FONT><FONT color=#a31515 size=2>":"</FONT><FONT |
size=2>);</P> |
<P>controlValues.Append(rgv.Items[r].Cells[c].Text);</P> |
<P>controlValues.Append(</FONT><FONT color=#a31515 size=2>","</FONT><FONT |
size=2>);</P> |
<P>}</P> |
<P>}</P> |
<P>}</P> |
<P>rgv.CurrentPageIndex = saveCurrentPageIndex; </FONT><FONT color=#008000 |
size=2>//Reset page to saved page index.</P></FONT><FONT size=2> |
<P>rgv.Rebind();<BR></P></FONT> |
This is just part of the code to cycle through the data cells and create one big string of the control name and associated data. The format is a colon between control name and data. With a comma after each pair of control/data pair. In the case of RadGrid the I added the page, row and col to the control name to identify each cell.
Ok, now the initial creatation of the string runs through this code with with no issues. The grid is sorted in descending order and there is 11 items in the grid with paging on and page size to 10. So I have 10 items in the first page and one in the second page. No problem. The in my cancel button I do another capture and this time the same code is ran but now the page 0 has 10 items and then the page 1 has 10 items (same items). It's like the move to page 2 (index 1) is not moving to the next page.
Why does this work on the initial creatation of the string but not the current creatation of the string. What am I doing wrong???
TIA! JerryM