Filter gridview by a Alphabet repeater

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top