2
Reply

Enable 1st row & disable rest of the rows in gridview

chethana mn

chethana mn

Sep 2 2013 4:43 AM
1.6k

Im working on asp.net with c#. I have a gridview with templatefield columns, data comes from sql database. I have link on the item template. Where initially only first row of the gridview should be enable, rest of the rows should be disable(all the rows should be visible),

My project is on booking beds for patients,where each room has 4 beds. Patient No1,Patient No2,Patient No3,Patient No4 are my gridview 4 rows with proper details of room, i should book Patient No1 first, and that time rest of the rows like Patient No2,Patient No3,Patient No4 shouldn't allow me click(book), when Patient No1 is booked then Patient No2 should be allow to book and other rows like Patient No3, Patient No4 shouldn't allow me to click(book) so on...

My problem is how can i enable the row & disable rest of the rows when the action is completed.

I have gone through many links & tried also but so far no luck as my condition seems complicated

Plz help me

Coding written for gridview

<asp:TemplateField HeaderText="View Details">
    <ItemTemplate>
        <a href='Application.aspx?BedNo=<%# Eval("Pat_ID") %>'>View </a>
   </ItemTemplate>
</asp:TemplateField>

Answers (2)