Urgent:Inserting records from datagrid through drop down list

  • Thread starter Thread starter Muhammad Usman
  • Start date Start date
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.
 
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
 
Back
Top