I'd like post a related question. If this one can be resolved, then I'm not too concerned about what I asked in the earlier post about hiding/disabling navigation buttons.
if (Request.Params["txtSelectedHeaderId"] != null && Request.Params["txtSelectedHeaderId"].ToString() != "")
string txtSelectedHeaderId = Request.Params["txtSelectedHeaderId"];
int intListIndex = Convert.ToInt32(txtSelectedHeaderId.Substring(17, txtSelectedHeaderId.LastIndexOf("_") - 17));
if ((intListIndex % 2) == 0)
rrSearchResults.InitialItemIndex = intListIndex;
rrSearchResults.InitialItemIndex = intListIndex - 1;
As you can see if the saved item index is an even number, I set the RadRotator's InitialItemIndex to the saved value. If the saved item index is an odd number, I minus one. So index 0 and 1 should share the same InitialIteamIndex, so should 2 and 3 , 4 and 5 and so on and so forth.
Now this completely works fine when the number of items is an even number (based on a search). However, the problem comes in when the no of items is odd. So if the number of items is 5, the indexes would look like this [0 1] [2 3] [4 0] [2 3] and it goes on....
If you click on the 2nd '0' index item, my above piece of code won't work properly. It will show [0 1] instead of remainig at [4 0] - it will not just select the item but also serve navigate across - which is clearly not the intention.
Does anyone have a suggestion to work around this? Unfortunately, there's no way to determine which is the left and right item in view (as opposed to relying on the index value) in order to determine how to set the InitialItemIndex on postback.