|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
DATAGRID DROPDOWN PROBLEM<asp:DropDownList 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:DropDownList> In my codebehind Public Function SelectMyIndex(ByVal indexno As Boolean) ideefixesatisc = CType(Page.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.. Savas,
This is at leaset the thirth time that you are asking about the same question, will you keep it to your original question. In this idea everybody is starting everytime again investigating your problem. I tested it, gave you the code, but you did not give any reply on that. The problem is probabably obvious. But I don't spread my answers over 10 messages so nobody understand anymore (by instance when searching this newsgroup) what I am answering. Cor Show quoteHide quote "Savas Ates" <in da club> schreef in bericht news:uqM0b%23JrGHA.3908@TK2MSFTNGP05.phx.gbl... > > It is in my <EditItemTemplate> Tag.. > > <asp:DropDownList 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:DropDownList> > > In my codebehind > > Public Function SelectMyIndex(ByVal indexno As Boolean) > > ideefixesatisc = CType(Page.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.. > > > > > > > > The problem is that It cant find the control
I changed the Page.findcontrol with Me.DataGrid1.FindControl They both give the same error.. ideefixesatisc = CType(Me.DataGrid1.FindControl("CIdeefixeSatis"), DropDownList) I have that hierarchie <asp:DataGrid id="DataGrid1" <Columns> <EditItemTemplate> <asp:DropDownList Runat=server ID="CIdeefixeSatis" How can i achieve to get my control to be finded with .Findcontrol Method. ? Error Message System.NullReferenceException: Object reference not set to an instance of an object. at DATAGRID.WebForm1.SelectMyIndex(Boolean indexno) in C:\Inetpub\wwwroot\DOTNETDENEME\DATAGRID\WebForm1.aspx.vb:line 40
Can I map the data received from a socket directly to a structure in VB.NET
Return vs Exit Sub Replacing a string inside of a PDF Can't delete VB.NET directories & files... Detecting when VB.net 2005 splash screen closing or closed Type.TypeOf doesn't work ? VB.net 2005 splash screen and main form problems Disappearing Listbox items... How do I validate the values entered for custom control properties? Extra Designer.vb file in Win Form causing problem |
|||||||||||||||||||||||