LABEL BOUND IN GRIDVIEW AND GRIDVIEWROWDATABOUND

Posted by Anu_dgr8 under Regular Expressions on 3/18/2011 | Points: 10 | Views : 1366 | Status : [Member] | Replies : 2
I HAVE A LABEL DOCTOR_ID WHICH IS BOUND IN THE GRIDVIEW.AND THERE ARE OTHER LABEL AND CONTROL PAIRS AS SHOWN IN THE 2ND TEMPLATE FIELD.SOMETHING LIKE THIS:
<asp:TemplateField>
<HeaderTemplate>
Doctor ID</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lblDoctorID" runat="server" Text='<% #DataBinder.Eval(Container,"Dataitem.DOCTOR_ID") %>'
CssClass="small">
</asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
Profile</HeaderTemplate>
<ItemTemplate>
<asp:DropDownList ID="ddlCategory" runat="server" CssClass="dtext" Width="100px">
</asp:DropDownList>
<asp:Label ID="lblCategory" runat="server" Visible="false" CssClass="small"></asp:Label>
</ItemTemplate>
</asp:TemplateField>

NOW AT GRIDVIEW'S ROWDATABOUND EVENT,FOR EVERY ROW'S DOCTOR_ID,I WANNA CHECK IF RECORD EXISTS FOR IT IN THE TABLE.IF YES,I WANT TO set the text property of lblCategory and MAKE THE lblCategory VISIBLE.How to do it ,takin performance into consideration?

Thanks in Advance:)

Thanks and Regards,
Hoosha Boosha



Responses

Posted by: Prabhakar on: 3/18/2011 [Member] [MVP] Starter | Points: 25

Up
0
Down
Hi Anu_dgr8

firstly u write a check function Gridview_Rowdatabound . . if ur Doctor Id Return true so u set ur lblCategory text property & visibility. . .

Best Regard's
Prabhakar

Anu_dgr8, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Anu_dgr8 on: 3/18/2011 [Member] Starter | Points: 25

Up
0
Down
i have already done this...and this is not the best way..i mean i am considering the performance of my website...can anyone tell me a better of doin this?

Thanks and Regards,
Hoosha Boosha

Anu_dgr8, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response