473,383 Members | 1,789 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,383 software developers and data experts.

Datagrid readonly or non visible data not passed back

Hi all,

I have a problem in that in my datagrid any datakeys which are not
visible and editable in the datagrid (if the column visibility is set
to false or readonly is set to true) do not seem to be passed back to
the script and are unavailable as parameters for my updatecommand.

I have tried with and without OldValuesParameterFormatString and
ConflictDetection in the sqlSatasource. Any ideas.? Source below.

Thanks

<%@ Page Language="VB" ContentType="text/html"
ResponseEncoding="iso-8859-1" Debug="true" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
..grid {width:550px; border:1px solid;}
..grid td {vertical-align: top; }
..grid th {background-color:#0099FF; color:#FFFFFF;}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>

<asp:GridView ID="grdOrders" AutoGenerateColumns="false"
runat="server" DataKeyIds="OrderID,AmazonID" DataSourceId="srcOrders"
CssClass="grid" autogenerateeditbutton="true" GridLines="Horizontal">

<Columns>

<asp:Boundfield DataField = "OrderID" HeaderText="OrderID"
readonly="true"/>

<asp:TemplateField HeaderText="IT Buy Address">
<ItemTemplate>
<%# Eval("add1") & "<br/>" & Eval("add2") & "<br/>" & Eval("add3")
& "<br/>" & Eval("city") & "<br/><strong>" & Eval("postcode") & "</
strong>" %>
</ItemTemplate>
</asp:TemplateField>

<asp:TemplateField HeaderText="Amazon Address">
<ItemTemplate>
<%# Eval("AOshipadd1") & "<br/>" & Eval("AOshipadd2") & "<br/>" &
Eval("AOshipadd3") & "<br/>" & Eval("AOshipcity") & "<br/><strong>" &
Eval("AOshippostcode") & "</strong>" %>
</ItemTemplate>

<edititemtemplate>

<asp:TextBox
id="AOshipadd1"
text='<%# Bind("AOshipadd1")%>'
runat="server" />
<asp:TextBox
id="AOshipadd2"
text='<%# Bind("AOshipadd2")%>'
runat="server" />
<asp:TextBox
id="AOshipadd3"
text='<%# Bind("AOshipadd3")%>'
runat="server" />
<asp:TextBox
id="AOshipcity"
text='<%# Bind("AOshipcity")%>'
runat="server" />
<asp:TextBox
id="AOshippostcode"
text='<%# Bind("AOshippostcode")%>'
runat="server" />

</edititemtemplate>

</asp:TemplateField>

<asp:Boundfield DataField = "ParcelNum" HeaderText="City Link
ID" /
</Columns>

</asp:GridView>

<asp:SqlDataSource
id="srcOrders"
ConnectionString="MYConnString"

SelectCommand="Select * from Orders"
UpdateCommand="UPDATE ORders SET ParcelNum = @Parcelnum Where (OrderID
= @OrderID); UPDATE OTHER_ORDER_REPORT Set [ship-address-1] =
@AOshipadd1 Where [order-id] = @AmazonID"
Runat="server" />
</div>
</form>

</body>
</html>

May 16 '07 #1
0 1145

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

Similar topics

3
by: PeterZ | last post by:
G'day, After doing much searching and pinching bits of ideas from here there and everywhere I came up with a fairly 'clean' solution of including a comboBox into a dataGrid column. You can...
3
by: Newbie | last post by:
I am using a Datagrid to show the contents of a DataTable. But it seems like the Datagrid is not getting the contents of the Datatable when the button ( btnAddAnotherLaborCategory) is clicked. ...
1
by: tfs | last post by:
I am reading into a datagrid and can't seem to get the "execution time" column (the 3rd column) to move to the right. My problem is that the last character in the 2nd column is right up against...
1
by: jason | last post by:
The guts of the below asp.net vb code was pieced together from another thread - all due credit to it's original author. Thank you! I've modified it to maintain a small local Microsoft 2000...
2
by: jason | last post by:
Pardon my ignorance on this. The below code works, except, when I edit a record and update the two drop downs take the first entry in the dropdownlist if not selected. I'd also like the dropdown to...
5
by: tshad | last post by:
Is there a way to carry data that I have already read from the datagrid from page to page? I am looking at my Datagrid that I page through and when the user says get the next page, I have to go...
1
by: Gunjan Garg | last post by:
Hello All, I am working to create a generic datagrid which accepts a datasource(ListData - This is our own datatype) and depending on the calling program customizes itself for sorting,...
1
by: jimb | last post by:
I can get the dropdownlist into the datagrid, and I can populate it, but I can't read it. Anybody have a working example of a dropdownlist in an editable grid? Thanks. -- .....
6
by: Doug Bell | last post by:
Hi I have a DataGrid with some hidden columns and also some read Only and some ComboBox Columns. Sandard Tabbing through the Datagrid sees the focus go to the hidden columns requiring further...
7
by: RolfHerbert | last post by:
Hi all, Source code below. I am using an sqldatasorce to populate a datagrid. I am using datakeyIds. I am interested in two keys which I have added to the datakeyids, however if either of the...
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...
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: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...

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.