473,385 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

EDITITEMTEMPLATE FINDCONTROL PROBLEM

My aim is showing product availability in a dropdown by checking the
database issues and let user to change its value...

The Error :
ideefixesatisc.DataTextField = "Stokta Yok"
Object reference not set to an instance of an object.
In my edit item template i have a dropdown like that

//////////////////////////////

My function

Public Function SelectMyIndex(ByVal indexno As Boolean)

Dim ideefixesatisc As New DropDownList

If indexno = True Then

ideefixesatisc = CType(Page.FindControl("CIdeefixesatis"), DropDownList)

ideefixesatisc.DataTextField = "Stokta Var"

ideefixesatisc.SelectedIndex =
ideefixesatisc.Items.IndexOf(ideefixesatisc.Items. FindByValue(True))

End If

If indexno = False Then

ideefixesatisc = CType(Page.FindControl("CIdeefixesatis"), DropDownList)

ideefixesatisc.DataTextField = "Stokta Yok"

ideefixesatisc.SelectedIndex =
ideefixesatisc.Items.IndexOf(ideefixesatisc.Items. FindByValue(False))

End If

End Function

<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>
///////////////
Jul 20 '06 #1
3 4020
Savas,

Did you try it with the same cases for "CIdeefixeSatis". Identifiers as
strings are not a real part of the VBNet code and therefore (mostly) case
sensetive,

By the way, why did you sent this message to the newsgroup languages.csharp,
I don't see any C# code.

Cor

"Savas Ates" <in da clubschreef in bericht
news:er**************@TK2MSFTNGP02.phx.gbl...
My aim is showing product availability in a dropdown by checking the
database issues and let user to change its value...

The Error :
ideefixesatisc.DataTextField = "Stokta Yok"
Object reference not set to an instance of an object.
In my edit item template i have a dropdown like that

//////////////////////////////

My function

Public Function SelectMyIndex(ByVal indexno As Boolean)

Dim ideefixesatisc As New DropDownList

If indexno = True Then

ideefixesatisc = CType(Page.FindControl("CIdeefixesatis"), DropDownList)

ideefixesatisc.DataTextField = "Stokta Var"

ideefixesatisc.SelectedIndex =
ideefixesatisc.Items.IndexOf(ideefixesatisc.Items. FindByValue(True))

End If

If indexno = False Then

ideefixesatisc = CType(Page.FindControl("CIdeefixesatis"), DropDownList)

ideefixesatisc.DataTextField = "Stokta Yok"

ideefixesatisc.SelectedIndex =
ideefixesatisc.Items.IndexOf(ideefixesatisc.Items. FindByValue(False))

End If

End Function

<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>
///////////////

Jul 20 '06 #2
Savas,

You use Uper and Lower cases in that identifier mixed up.

Cor

"Savas Ates" <in da clubschreef in bericht
news:uy**************@TK2MSFTNGP02.phx.gbl...
>I didnt understand what you meant ? What you meant by saying
"CIdeefixeSatis" case ? How can i solve that problem ?
"Cor Ligthert [MVP]" <no************@planet.nl>, haber iletisinde şunları
yazdı:u2**************@TK2MSFTNGP05.phx.gbl...
>Savas,

Did you try it with the same cases for "CIdeefixeSatis". Identifiers as
strings are not a real part of the VBNet code and therefore (mostly) case
sensetive,

By the way, why did you sent this message to the newsgroup
languages.csharp, I don't see any C# code.

Cor

"Savas Ates" <in da clubschreef in bericht
news:er**************@TK2MSFTNGP02.phx.gbl...
>>My aim is showing product availability in a dropdown by checking the
database issues and let user to change its value...

The Error :
ideefixesatisc.DataTextField = "Stokta Yok"
Object reference not set to an instance of an object.
In my edit item template i have a dropdown like that

//////////////////////////////

My function

Public Function SelectMyIndex(ByVal indexno As Boolean)

Dim ideefixesatisc As New DropDownList

If indexno = True Then

ideefixesatisc = CType(Page.FindControl("CIdeefixesatis"), DropDownList)

ideefixesatisc.DataTextField = "Stokta Var"

ideefixesatisc.SelectedIndex =
ideefixesatisc.Items.IndexOf(ideefixesatisc.Item s.FindByValue(True))

End If

If indexno = False Then

ideefixesatisc = CType(Page.FindControl("CIdeefixesatis"), DropDownList)

ideefixesatisc.DataTextField = "Stokta Yok"

ideefixesatisc.SelectedIndex =
ideefixesatisc.Items.IndexOf(ideefixesatisc.Item s.FindByValue(False))

End If

End Function

<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>
///////////////



Jul 20 '06 #3
I didnt understand what you meant ? What you meant by saying
"CIdeefixeSatis" case ? How can i solve that problem ?
"Cor Ligthert [MVP]" <no************@planet.nl>, haber iletisinde şunları
yazdı:u2**************@TK2MSFTNGP05.phx.gbl...
Savas,

Did you try it with the same cases for "CIdeefixeSatis". Identifiers as
strings are not a real part of the VBNet code and therefore (mostly) case
sensetive,

By the way, why did you sent this message to the newsgroup
languages.csharp, I don't see any C# code.

Cor

"Savas Ates" <in da clubschreef in bericht
news:er**************@TK2MSFTNGP02.phx.gbl...
>My aim is showing product availability in a dropdown by checking the
database issues and let user to change its value...

The Error :
ideefixesatisc.DataTextField = "Stokta Yok"
Object reference not set to an instance of an object.
In my edit item template i have a dropdown like that

//////////////////////////////

My function

Public Function SelectMyIndex(ByVal indexno As Boolean)

Dim ideefixesatisc As New DropDownList

If indexno = True Then

ideefixesatisc = CType(Page.FindControl("CIdeefixesatis"), DropDownList)

ideefixesatisc.DataTextField = "Stokta Var"

ideefixesatisc.SelectedIndex =
ideefixesatisc.Items.IndexOf(ideefixesatisc.Items .FindByValue(True))

End If

If indexno = False Then

ideefixesatisc = CType(Page.FindControl("CIdeefixesatis"), DropDownList)

ideefixesatisc.DataTextField = "Stokta Yok"

ideefixesatisc.SelectedIndex =
ideefixesatisc.Items.IndexOf(ideefixesatisc.Items .FindByValue(False))

End If

End Function

<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>
///////////////


Jul 20 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Gene McCrory | last post by:
Is it possible to have a CustomValidator against two controls in an EditItemTemplate on a DataGrid? Case: Have a business rule that states if ATextBox starts with "ACertainValue" then BTextBox...
2
by: VB Programmer | last post by:
I have a datagrid with a dropdownlist in it. As I understand it, the ItemTemplate section represents the cell when not in edit mode and the EditItemTemplate section represents the cell when in...
1
by: yamne | last post by:
I have a problem. When I click in edit datagrid button I show two listbox and two button. I use two button to move data between two listbox. My problem is that I can't call the listbox in the...
1
by: George Durzi | last post by:
When my datagrid is in edit mode, one of my columns is edited using a drop down list. I'm able to bind the DropDownList to a DataSource when in edit mode. HOWEVER, I can't preset the...
15
by: NH | last post by:
How can I only display the textbox I have in an EditItemTemplate based on the value in another cell in the row? i.e I only want users to edit one of the cells based on the value in another...
2
by: srini.venkatesan | last post by:
I am trying to access a control from edititemtemplate in itemdatabound event, but I get a run time null reference exception. Class file : In Datagrid_update I am able to access with no issues....
2
by: Steve Hershoff | last post by:
Hi everyone, I have a DataGrid with several TemplateColumns. One of these columns has an EditItemTemplate that contains an ASP.Net DropDownList. I'm catching this DropDownList's...
0
dotneto
by: dotneto | last post by:
Hi, I have a gridview with some templatecolumns, I need to retrieve the value from a textbos inside a edititemtemplate in the rowupdating event. I can get other controls using findcontrol method in...
1
by: vineetbindal | last post by:
HI All, I have a details view in which i have a template column which contains a item template which contains a label(lblUser). i am displaying some values on the label using ...
4
by: pankajsingh5k | last post by:
Hi guys, These question is for all the experts... Please help me before my brain explodes The problem is again with the formview control.. I have a formview and i have to use it that...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.