R
rockdale
Hi, all:
I implemented an alphabet list so that when user click letter A then I
will re-bind a gridview control using SQL stored procedure. It works
fine. The problem is I populate my alphabet repeater by select the ini
of name from database. So that my alphabet does not have 26 letters, my
customer does not like it since it may spell something bad. Now I am
trying to display 26 letters, letters that exist in my database will be
linkbutton, others are just label only (so that user can not click on
it).
I am think using a helper function to decide it is linkbutton or label,
for example
<%if(myHelperFunc(Eval("letter")){%>
<asp:linkbutton />
<%}else{%>
<asp:label />
<%}%>
But I believe there are some better ways to do this, like dynamic
create linkbutton or label on the repeater create event, only I do not
know how.
Also, I would like to add # to include all those name that starts with
number, is there a way in SQL that I can group numbers, or I have to do
in my c# code?
Thanks
-rockdale
I implemented an alphabet list so that when user click letter A then I
will re-bind a gridview control using SQL stored procedure. It works
fine. The problem is I populate my alphabet repeater by select the ini
of name from database. So that my alphabet does not have 26 letters, my
customer does not like it since it may spell something bad. Now I am
trying to display 26 letters, letters that exist in my database will be
linkbutton, others are just label only (so that user can not click on
it).
I am think using a helper function to decide it is linkbutton or label,
for example
<%if(myHelperFunc(Eval("letter")){%>
<asp:linkbutton />
<%}else{%>
<asp:label />
<%}%>
But I believe there are some better ways to do this, like dynamic
create linkbutton or label on the repeater create event, only I do not
know how.
Also, I would like to add # to include all those name that starts with
number, is there a way in SQL that I can group numbers, or I have to do
in my c# code?
Thanks
-rockdale