473,324 Members | 2,400 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,324 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 4019
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
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.