Grid view problem

Posted by Shoyebaziz123 under ASP.NET on 6/11/2009 | Views : 1043 | Status : [Member] | Replies : 1
Hi Friends,
I have a Gridview ,the gridview have the columns

Sr.No ItemName Rate Quantity Amount Total
Label dropdownlist textbox textbox textbox textbox

dropdownlist must be filled from items coming from database...when page loads only one row must be show with all items in dropdown
user can select item from dropdownlist based on selection enters values i.e rate ,quantity, amount when first row complte filling then second row should be generated...with these fillds/control and so on.

i have use templte fields and bind the data to dropdownlist but when i run my application..there are several rows shows with these fields which is please give me an idea......if you have any link of sample.please send me.



Posted by: Majith on: 6/12/2009 [Member] Starter

Greetings Shoyebaziz,

In the Gridview RowdataBound Event load the Dropdown control as follows:

if (e.Row.RowType == DataControlRowType.DataRow)


DropDownList ddl = (DropDownList)e.Row.FindControl("ddlDH");
ddl.DataSource = GetData();

where ddlDH is the name of dropdown control and the Getdata() is method for calling from DAL


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

Login to post response