Click here to Skip to main content
14,735,834 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have gridview in which textboxes are added dynamically.
i retrieved datas from sql and i want the datas to be displayed in textboxes.
My code is :
DataTable dtCurrentTable = (DataTable)ViewState["CurrentTable"];
                                    DataRow drCurrentRow = null;
                                    if (dtCurrentTable.Rows.Count > 0)
                                            TextBox txtlanguage = (TextBox)grvStudentDetails.Rows[rowIndex].Cells[1].FindControl("txtotherlanguage");
                                            drCurrentRow = dtCurrentTable.NewRow();
                                            drCurrentRow["RowNumber"] = j + 1;
                                           dtCurrentTable.Rows[j - 1]["Col1"] = (objDataSet.Tables[1].Rows[j - 1]["LanguagesKnown"]).ToString();
                                        txtlanguage.Text= dtCurrentTable.Rows[j - 1]["Col1"].ToString();

When i set breakpoint txtlanguage.Text consists of value "English"(from db) however same is not getting displayed. Suggest me.
Updated 13-Apr-13 3:16am
Member 9967500 13-Apr-13 9:17am
war gya bai -- manu ta koi samj nai llagdi pai
Member 9967500 13-Apr-13 9:18am
ma nu ta programming hi la bathi ha
... pta na wakht hi pa deta a.. programming ejad kr k

1 solution

Write in ItemDataBoud Event

If TypeOf e.Item Is GridDataItem Then
            Dim selectedItem As GridDataItem = CType(e.Item, GridDataItem)

Dim ctlMultiLineText As TextBox =
="Give data what ever you want"

End If

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900