How do I change an ActiveIndex numeric value to text?
In my ASP.Net web page, I want to change the active index numerical values to text values.
For instance, the active index currently renders nume开发者_如何学Crically as 1, 2, 3, 4, etc... I would like to have this index render as a, b, c, d, etc...
Could you please suggest a way to do so?
You can convert them easily using:
char c = (char)(96 + index);
It will return a when index is 1, b when 2 and so on...
You will have to write additional code if you want aa for index value of 27.
write simple mapping function which returns corresponding alphabet.
The answers to this question will help. Basically you can just cast your int to a char if you want a really rudimentary solution.
精彩评论