Datagrid template
-
hi i have a code in asp.net have the following problem ==> in the web page threr is a datagrid and have a datasource from oracle one of its column is a template and in the edit mode i convert it to dropdownlist control but i do not konw how to bind this drop down list with data from the database please HELP HELP HELP HELP ME ME ME ME :(( :confused:
-
hi i have a code in asp.net have the following problem ==> in the web page threr is a datagrid and have a datasource from oracle one of its column is a template and in the edit mode i convert it to dropdownlist control but i do not konw how to bind this drop down list with data from the database please HELP HELP HELP HELP ME ME ME ME :(( :confused:
what is the method you edit the grid with ??
When you get mad...THINK twice that the only advice Tamimi - Code
-
what is the method you edit the grid with ??
When you get mad...THINK twice that the only advice Tamimi - Code
unig bulid in function ==> Private Sub dg_find_result_EditCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dg_find_result.EditCommand
-
unig bulid in function ==> Private Sub dg_find_result_EditCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dg_find_result.EditCommand
so good.......... suppose that your column index is 2(i.e. the second column). then inside the dg_find_result_EditCommand, find your DropDownList, like this: Dim DDL As DropDownList = CType(grdItem.Cells(0).Controls(1), dropdownlist), then write the code to bind your DropDownList.
When you get mad...THINK twice that the only advice Tamimi - Code
-
so good.......... suppose that your column index is 2(i.e. the second column). then inside the dg_find_result_EditCommand, find your DropDownList, like this: Dim DDL As DropDownList = CType(grdItem.Cells(0).Controls(1), dropdownlist), then write the code to bind your DropDownList.
When you get mad...THINK twice that the only advice Tamimi - Code
when i write this code ==> Me.dg_find_result.EditItemIndex = e.Item.ItemIndex Dim DDL As DropDownList = CType(e.Item.FindControl("lst_temp_order_dir"), DropDownList) DDL.Items.Add("gggggg") Me.BindData() Catch ex As Exception Me.Literal1.Text = ex.Message End Try i get this error ==> Object reference not set to an instance of an object. ============================================================= and when i write this ==> Try Me.Literal1.Text = "" Me.dg_find_result.EditItemIndex = e.Item.ItemIndex Dim DDL As DropDownList = CType(e.Item.Controls(0), DropDownList) DDL.Items.Add("gggggg") Session("Edit_S") = e Me.BindData() Catch ex As Exception Me.Literal1.Text = ex.Message End Try i get this error ==> Specified cast is not valid =============================================== what is the problem and how i can solve it , please ?
-
when i write this code ==> Me.dg_find_result.EditItemIndex = e.Item.ItemIndex Dim DDL As DropDownList = CType(e.Item.FindControl("lst_temp_order_dir"), DropDownList) DDL.Items.Add("gggggg") Me.BindData() Catch ex As Exception Me.Literal1.Text = ex.Message End Try i get this error ==> Object reference not set to an instance of an object. ============================================================= and when i write this ==> Try Me.Literal1.Text = "" Me.dg_find_result.EditItemIndex = e.Item.ItemIndex Dim DDL As DropDownList = CType(e.Item.Controls(0), DropDownList) DDL.Items.Add("gggggg") Session("Edit_S") = e Me.BindData() Catch ex As Exception Me.Literal1.Text = ex.Message End Try i get this error ==> Specified cast is not valid =============================================== what is the problem and how i can solve it , please ?
try : Dim DDL As DropDownList = CType(e.Item.Controls(1), DropDownList)
When you get mad...THINK twice that the only advice Tamimi - Code
-
try : Dim DDL As DropDownList = CType(e.Item.Controls(1), DropDownList)
When you get mad...THINK twice that the only advice Tamimi - Code
it is also gove me this error ==> Specified cast is not valid in the datagrid the first column is the serial which is hidden and the second one i convert it to drop down list which i want to fill it with data .