473,763 Members | 1,320 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

strange text appearing in gridview dropdownlist

this text keeps showing up in my gridview dropdownlist

"System.Data.Da taRowView"

How do I prevent this problem ?
Jan 18 '07 #1
3 1646
Can you post the code you use for databinding? You are probably missing
something there.

"Jon Paal" <Jon[ nospam ]Paal @ everywhere dot comwrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
this text keeps showing up in my gridview dropdownlist

"System.Data.Da taRowView"

How do I prevent this problem ?

Jan 18 '07 #2


....asp:SqlData Source
SelectCommand=" SELECT userid, status FROM aspnet_Users, UserData WHERE userid = userdataid AND Len(userid ) 2 "
UpdateCommand=" UPDATE UserData SET status = @status WHERE userid = @userid ">
<UpdateParamete rs>
<asp:Paramete r Name="userid " Type="String" />
</UpdateParameter s>

....asp:GridVie w
DataKeyNames="u serid"

....
<asp:TemplateFi eld HeaderText="Sta tus">
<ItemTemplate >
<asp:Label id="label1" runat="server" Text='<%# Eval("Status") %>' />
</ItemTemplate>
<EditItemTempla te>
<asp:DropDownLi st runat="server" ID="ddlStatus"
AppendDataBound Items="true"
SelectedValue=' <%# Bind("status") %>'
DataSourceID= "SqlDataSource1 "
AutoPostBack="F alse" >
<asp:ListItem Text="Open" Value="Open"></asp:ListItem>
<asp:ListItem Text="Closed" Value="Closed"> </asp:ListItem>
</asp:DropDownLis t>
</EditItemTemplat e>
</asp:TemplateFie ld>


"Kevin Goff" <ke********@nos pam.nospamwrote in message news:eF******** ******@TK2MSFTN GP02.phx.gbl...
Can you post the code you use for databinding? You are probably missing something there.

"Jon Paal" <Jon[ nospam ]Paal @ everywhere dot comwrote in message news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
>this text keeps showing up in my gridview dropdownlist

"System.Data.D ataRowView"

How do I prevent this problem ?


Jan 18 '07 #3
The list of options is not drawn from the database. The list is a fixed set of choices and the selected value is matched to that
retrieved from the database.

I'm getting the correct outcome and everything works as expected except there are those strange items added to my fixed list of
options in the DDL. I have no idea what is causing them to appear....

"Milosz Skalecki [MCAD]" <mi*****@REMOVE ITwp.plwrote in message news:CA******** *************** ***********@mic rosoft.com...
Howdy,

You didn't specify which field should be mapped to text and which to value
(DataValueField ="userid" DataTextField=" status"):

SelectCommand=" SELECT userid, status FROM aspnet_Users, UserData WHERE
userid = userdataid AND Len(userid ) 2 "
UpdateCommand=" UPDATE UserData SET status = @status WHERE userid = @userid ">
<UpdateParamete rs>
<asp:Paramete r Name="userid " Type="String" />
</UpdateParameter s>

....asp:GridVie w
DataKeyNames="u serid"

....
<asp:TemplateFi eld HeaderText="Sta tus">
<ItemTemplate >
<asp:Label id="label1" runat="server" Text='<%# Eval("Status") %>' />
</ItemTemplate>
<EditItemTempla te>
<asp:DropDownLi st runat="server" ID="ddlStatus"
AppendDataBound Items="true"
DataValueField= "userid" DataTextField=" status"
SelectedValue=' <%# Bind("status") %>'
DataSourceID= "SqlDataSource1 "
AutoPostBack="F alse" >
<asp:ListItem Text="Open" Value="Open"></asp:ListItem>
<asp:ListItem Text="Closed" Value="Closed"> </asp:ListItem>
</asp:DropDownLis t>
</EditItemTemplat e>
</asp:TemplateFie ld>

--
Milosz
"Jon Paal" wrote:
>>

....asp:SqlDat aSource
SelectCommand= "SELECT userid, status FROM aspnet_Users, UserData WHERE userid = userdataid AND Len(userid ) 2 "
UpdateCommand= "UPDATE UserData SET status = @status WHERE userid = @userid ">
<UpdateParamete rs>
<asp:Paramete r Name="userid " Type="String" />
</UpdateParameter s>

....asp:GridVi ew
DataKeyNames=" userid"

....
<asp:TemplateF ield HeaderText="Sta tus">
<ItemTemplate >
<asp:Label id="label1" runat="server" Text='<%# Eval("Status") %>' />
</ItemTemplate>
<EditItemTempla te>
<asp:DropDownLi st runat="server" ID="ddlStatus"
AppendDataBound Items="true"
SelectedValue=' <%# Bind("status") %>'
DataSourceID= "SqlDataSource1 "
AutoPostBack="F alse" >
<asp:ListItem Text="Open" Value="Open"></asp:ListItem>
<asp:ListItem Text="Closed" Value="Closed"> </asp:ListItem>
</asp:DropDownLis t>
</EditItemTemplat e>
</asp:TemplateFie ld>


"Kevin Goff" <ke********@nos pam.nospamwrote in message news:eF******** ******@TK2MSFTN GP02.phx.gbl...
Can you post the code you use for databinding? You are probably missing something there.

"Jon Paal" <Jon[ nospam ]Paal @ everywhere dot comwrote in message news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
this text keeps showing up in my gridview dropdownlist

"System.Data.D ataRowView"

How do I prevent this problem ?



Jan 18 '07 #4

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

Similar topics

1
4410
by: mimo | last post by:
Hello, I have seen several examples with a dropdownlist filtering the results in a gridview. Is there a way to have information typed in a text box used to filter a gridview? I would like to for example search on a persons first name and any first name that contains the contents of my text box appear in the gridview list.
3
6995
by: mateo | last post by:
Hello, I have a GridView inside which i want to show 3 dropdownList (one for each Column). So i've created 3 TemplateField Continent Country City
1
14314
by: CorporateCoder | last post by:
Hi, I am trying to bind the selected value of a databound dropdown box in a databound gridview control to the value being displayed in the template column the dropdown box has been added to. Both the grid and the dropdown box are retrieving and displaying data fine, I just cant bind the two together. I followed the instructions in the help document called 'Walkthrough: Displaying a Drop-Down List While Editing in the GridView Web...
0
2138
by: dawg1998 | last post by:
I am able to populate a DropDownList control within multiple rows of a GridView with the following code: `````````````````````````````````````````````````````` <asp:GridView id="gvGridView" runat="server" AutoGenerateColumns="False" DataKeyNames="idRecordID"> <Columns> <asp:TemplateField> <ItemTemplate>
0
1620
by: Ben | last post by:
Hi, It's about a database containing (for simplifying) three fields: 'placenr' (primary key), 'place' and 'color'. The records are updatable (Edit/Update button) in a gridview. For updating the field 'color', the selectedvalue of a dropdownlist must be used, containing all possible colors (red, blue ...), so the field 'color' is ReadOnly in the gridview. Everything works, but i still have 2 problems: 1)the new color in the field is...
2
3819
by: VB Programmer | last post by:
I have a gridview control with several data fields. When the user clicks 'edit' for the row I want the user to be able to edit a particular text field. Under that 'edit' textbox is a button. When they click on the button it fills in the textbox with some standard text. Question: In the code for the button how do I reference the textbox 'FreeTextBox1' (for the current edit row)? Here's the gridview layout...
0
2436
by: landesjoe | last post by:
Hi, here's my problem in short: Text boxes in gridview don't seem to hold their value if the column's .Visible property is changed back and forth. I've got a form with a gridview populated from a data view (which in turn is loaded from a manually setup DataTable for testing purposes). One of the columns in the grid is a checkbox that's tied to an event handler that'll change the .Visible property of a column with a text box. That text...
3
13980
by: Brian VanDyke | last post by:
I have to display a table with customer data (GridView). However, I want to be able to show DropDownList controls inside one of the columns, not just textbox controls. Is this possible? Is it possible to have all of the controls active so that a simple click of the Submit button updates all customer records with the data in those DropDownLists? I was able to do this with classic ASP, but with a GridView control (perhaps I need a...
4
6052
by: pablorp80 | last post by:
Hello, Here is what I need: I need the focus and the cursor set to a textbox named txtGT, every time no matter if it is the first page load or whether it is a postback. Here is the problem: I am using AJAX and MasterPages as well as an update panel, the textbox is in a panel. I have tried to do it using different java scripts but I can't get it to work because I am not using asp forms, instead I am using Containers. Here is my code:...
0
9563
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9998
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9822
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8822
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7366
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5270
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
3523
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2793
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.