Urgent:Inserting records from datagrid through drop down list

M

Muhammad Usman

Respected Assistant

I have table in a database named "student" having fields
like name of student,Roll No and Status.The status is one
of them absent,present or leave.The name and rollno field
is already entered but the status is entered from datagrid
in such a way that name and rollno is feteched from
database and display on datagrid and the status is insert
from the dropdown list in the datagrid.

I want to display the dropdown list in my datagrid and
then the selected value is store in a data base how it
become possible using c#.
thanks
usman.
 
R

Raja Saravanan

You can use ItemTemplate for creating dropdown in the table

<asp:TemplateColumn HeaderText="Status">
<ItemTemplate>
<asp:dropdownlist ...
</ItemTemplate>
</asp:TemplateColumn>

Then you can access this dorpdown list value in the datagrid by
(DropDownList)(e.Item.Cells[4].Controls[0]).SelectedValue

HTH
Raja
 

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

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top