473,699 Members | 2,417 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Fixed the problem

CW
I didn't have
If !Page.IsPostBac k
//bind data source

in the code

"CW" <a> wrote in message news:um******** ******@TK2MSFTN GP12.phx.gbl...
I am taking the Commerce Starter Kit sample from asp.net and trying to add a page that allows user to edit product categories.

I am doing so via the use of a datagrid. html portion related to the data
grid is as per follows:

<asp:datagrid id=dgProductCat egories runat="server"
AutoGenerateCol umns="False" DataSource="<%# DataSet11 %>" Width="275px"
BorderColor="#9 99999" BorderStyle="No ne" BackColor="Whit e" CellPadding="3"
GridLines="Vert ical" BorderWidth="1p x" DataKeyField="C ategoryID"
DataMember="CMR C_Categories">
<SelectedItemSt yle Font-Bold="True" ForeColor="Whit e"
BackColor="#008 A8C"></SelectedItemSty le>
<AlternatingIte mStyle
BackColor="Gain sboro"></AlternatingItem Style>
<ItemStyle ForeColor="Blac k" BackColor="#EEE EEE"></ItemStyle> <HeaderStyle Font-Bold="True" ForeColor="Whit e"
BackColor="#000 084"></HeaderStyle>
<FooterStyle ForeColor="Blac k"
BackColor="#CCC CCC"></FooterStyle>
<Columns>
<asp:BoundColum n DataField="Cate goryID"
SortExpression= "CategoryID " ReadOnly="True"
HeaderText="ID" ></asp:BoundColumn >
<asp:BoundColum n DataField="Cate goryName"
SortExpression= "CategoryNa me" HeaderText="Cat egory Name"></asp:BoundColumn > <asp:EditComman dColumn ButtonType="Lin kButton"
UpdateText="Upd ate" HeaderText="Edi t" CancelText="Can cel"
EditText="Edit" ></asp:EditCommand Column>
<asp:ButtonColu mn Text="Delete" HeaderText="Del ete"
CommandName="De lete"></asp:ButtonColum n>
</Columns>
<PagerStyle HorizontalAlign ="Center" ForeColor="Blac k"
BackColor="#999 999" Mode="NumericPa ges"></PagerStyle>
</asp:datagrid>

The code behind that handles the Update command is as per follows:

Private Sub dgProductCatego ries_UpdateComm and(ByVal source As Object, ByVal e As System.Web.UI.W ebControls.Data GridCommandEven tArgs) Handles
dgProductCatego ries.UpdateComm and
Dim dr As DataSet1.CMRC_C ategoriesRow
dr =
Me.DataSet11.CM RC_Categories.F indByCategoryID (CInt(Me.dgProd uctCategories.I t ems(e.Item.Item Index).Cells(0) .Text))
Dim tbProductCatego ry As System.Web.UI.W ebControls.Text Box =
CType(e.Item.Ce lls(1).Controls (0), System.Web.UI.W ebControls.Text Box)
dr.Item(1) = tbProductCatego ry.Text
Me.SqlDataAdapt er1.Update(Me.D ataSet11)
Me.dgProductCat egories.EditIte mIndex = -1
Me.dgProductCat egories.DataBin d()
End Sub

e.Item.Cells(1) .Controls(0) supposed to the be the textbox when datagrid is in edit mode. However, in debug mode, I could tell that the value in the
text box is the original value, rather than the edited value. Of course this means that the edit operation would have no effect.

I also tried using
Me.dgProductCat egories.Items(e .Item.ItemIndex ).Cells(1).Cont rols(0) instead of e.Item.Cells(1) .Controls(0) in the code. However, it made no difference.
Any idea what's happening there?

Thanks in advance

CW

Nov 18 '05 #1
0 907

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

Similar topics

26
9688
by: Adrian Parker | last post by:
I'm using the code below in my project. When I print all of these fixed length string variables, one per line, they strings in questions do not properly pad with 0s. strQuantity prints as " 4". Six spaces than the value of intQuantity. This is correct. But all the others end up being string objects of only 6 characters long (with the exception of strTotal). The left most positions of the string object are being padded with one...
179
44383
by: SoloCDM | last post by:
How do I keep my entire web page at a fixed width? ********************************************************************* Signed, SoloCDM
6
3631
by: Marie ALHOMME | last post by:
Hi everybody ! I'm new here, and I'm French, so pardon me for any and all grammar and typo mistakes ! I hope you'll understand everything anyway :) I'm working on my portfolio site, which I am completely rewriting in HTML 4. strict + CSS. In the Gallery part of the site, people can see thumbnails of my work and when they click on any work, it opens a popup (btw : I'm not here to
6
5407
by: Mason A. Clark | last post by:
Masters: On two or three-column layouts, one column often has a list of links. Scrolling the page hides them. I'm aware there's supposed to be the ability to fix the column (frame-like). I have some bits of such code but haven't yet made it work well. Question: Why have I never seen an example on the web? Not that I've seen everything, but I've seen numerous pages
9
4188
by: pout | last post by:
What are the purposes of fixed-point? When should it be used? I read: #define Int2Fixed(x) (((long)(short)x) << 16) and the fixed-point in 16.16 format. Does the 16 in the MACRO refer to integer or decimal part? For example, if in 8.24, should the macro be: #define Int2Fixed(x) (((long)(short)x) << 24)?
3
2224
by: Xavier Wargny | last post by:
Hi all and each! Since july, I'm working with dot NET technology. Confident with brand new tools it gave, I decided to use that new decimal type (related with the Database type...). After many 'plantages' (critical stops?) in the communication between my Calculation serveur and my Interface server, I discovered a problem with the serialization of decimals, because some values I use are below the Critical Number 0.0001m (I should blame...
4
11174
by: Otie | last post by:
Hello, I am using the MSFlexGrd Control in VB5. I have 1 fixed row and one fixed column. I am trying to do a sort when the user clicks a column in the FIXED ROW. But when I capture the row number in the click event I get row = 1 if I click on the FIXED row OR the actual row 1. How can I get the grid control to tell me when the user has clicked on the FIXED row and not on row 1 (since they both produce row = 1 and I cannot tell them apart...
1
9419
by: Rick Knospler | last post by:
I am trying to convert a vb6 project to vb.net. The conversion worked for the most part except for the fixed length strings and fixed length string arrays. Bascially the vb6 programmer stored all form data in a fixed length structure that is written direct to disk. I need to load the existing files, into a fixed length structure to initialize the form data within the project. I am running into problems with statements like the...
1
3263
by: tehweb | last post by:
Background: I have a fixed position div on the bottom om my page. I have then added a dialog-div into this fixed position one. When I bring up the dialog, everything works if the the scrollTop is 0. I can drag it around with no problem. Problem: If the page has scrolled, lets say 100px down (y-axis) and I try to drag the dialog around, a strange effect appair in non-ie browsers. The dialog is instantly moved 100px UP while dragging. as...
9
2570
by: Mr Prister | last post by:
I've tried to create a sidebar that uses the fixed positioning property. However after looking through various tutorials and how to's of the web I can't find a bugger wrong with my code. This is good i hear you say.... well no its not. The problem is that the frigging sidebar isn't fixed! You maybe able to tell but this is pissing me off to say the least. So i'm praying that someone with much superior CSS knowledge then I can solve the...
0
8613
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9172
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8880
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
7745
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
6532
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
5869
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
4626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3054
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2008
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.