2
Answers

How to get Serial no from Gridview?

Photo of nagaraju

nagaraju

13y
1.6k
1

Hi,

     I am developing a project for online exam. I am displaying questions from DB and binding to gridview randomly. So serial no for questions will not in ascending order. So i am using  <%#Container.DataItemIndex+1 %>   expression to display in order. Now in middle user wants to see what are all unanswered questions in that paper i am giving one "Review " button. So how can i show that unanswered questions from gridview. Some one pls help me.

Thanks in advance.

Regards,

Rajesh

Answers (2)

0
Photo of Dipen Lama
NA 331 195.9k 18y
Use Place holder control to place the user control dynamically.
Here is some lines:

    string userControlName = "UserControl1.ascx"; 
 
    Control control1 ;
    control1 = LoadControl( userControlName );
    placeHolderControl1.Controls.Clear();
    placeHolderControl1.Controls.Add( control1 );