![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
ropDownList>
#2
| |||
| |||
|
|
It is in my <EditItemTemplate> Tag.. asp ropDownList Runat=server ID="CIdeefixeSatis" SelectedIndex='<%#SelectMyIndex(DataBinder.Eval(Container, "DataItem.ideefixesatis")) %>' asp:ListItem Value="True">Stokta Var</asp:ListItem asp:ListItem Value="False">Stokta Yok</asp:ListItem /asp ropDownListIn my codebehind Public Function SelectMyIndex(ByVal indexno As Boolean) ideefixesatisc = CType(Datagrid1.FindControl("CIdeefixeSatis"), DropDownList) Response.Write(ideefixesatisc) End Function There is no problem with that code.. However When i try to reach ideefixesatisc. (properties of ideefixesatisc object for example ideefixesatisc.DataTextField = "OK" ) It returns Object reference not set to an instance of an object. ideefixesatisc.DataTextField = "OK" What can be the problem. . Any idea will be appreciated.. |
#3
| |||
| |||
|
#4
| |||
| |||
|
#5
| |||
| |||
|
|
I changed My function with that but it doesnt work again Public Function SelectMyIndex(ByVal indexno As Boolean) Try ideefixesatisc = CType(DataGrid1.Items(DataGrid1.EditItemIndex).Fin dControl("CIdeefixeSatis"), DropDownList) ideefixesatisc.DataTextField = "Stokta Yok" Catch ex As Exception Response.Write(ex) Response.End() End Try Error System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index at System.Collections.ArrayList.get_Item(Int32 index) at System.Web.UI.WebControls.DataGridItemCollection.g et_Item(Int32 index) at DATAGRID.WebForm1.SelectMyIndex(Boolean indexno) in C:\Inetpub\wwwroot\DOTNETDENEME\DATAGRID\WebForm1. aspx.vb:line 42 |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |