473,607 Members | 2,674 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Bind fields to functions

Hi,

I am using gridview for the user to update rows. In a row, there sre
two columns, which need to be updated. When the gridview is to be
shown, the row should show the values from database. When user clicks
on edit link, should display the windows loginId in one column and in
second column, show the current datetime. When user clicks on update
link, should save these two column values to database as well as other
updated field values. I can't seem to find out how to set this up.

The Source doe is as follows:
<asp:GridView ID="gcEvidence " runat="server" AllowPaging="Tr ue"
AllowSorting="T rue"
AutoGenerateCol umns="False"
BackColor="Ligh tGoldenrodYello w" BorderColor="Ta n"
BorderWidth="1p x" CellPadding="2"
DataKeyNames="F rameworkEvidenc eId"
DataSourceID="D SFrameworkEvide nceSelectUpdate "
ForeColor="Blac k" GridLines="None " EmptyDataText=" Sorry, no
records found." Font-Italic="False" Font-Size="1.2em" Width="100%">
<FooterStyle BackColor="Tan" />
<Columns>
<asp:CommandFie ld ShowEditButton= "True" />
<asp:BoundFie ld DataField="Acti onMasterDisplay No"
HeaderText="Act ion No."
SortExpression= "ActionMasterDi splayNo"
ReadOnly="True" />
<asp:BoundFie ld DataField="Acti onMasterDesc"
HeaderText="Act ion" SortExpression= "ActionMasterDe sc" ReadOnly="True"
/>
<asp:BoundFie ld DataField="Fram eworkEvidenceId "
HeaderText="Fra meworkEvidenceI d"
InsertVisible=" False" ReadOnly="True"
SortExpression= "FrameworkEvide nceId" Visible="False" />
<asp:TemplateFi eld HeaderText="Evi dence Achieved"
SortExpression= "FrameworkEvide nceAchieved">
<EditItemTempla te>
<asp:DropDownLi st ID="cboAchieved "
runat="server" SelectedValue=' <%# Bind("Framework EvidenceAchieve d")
%>'>
<asp:ListItem
Value="-">--Select--</asp:ListItem>
<asp:ListItem
Value="yes">Yes </asp:ListItem>
<asp:ListItem Value="no">No</asp:ListItem>
<asp:ListItem Value="partial
progress">Parti al Progress</asp:ListItem>
<asp:ListItem Value="not applicable">Not
Applicable</asp:ListItem>
</asp:DropDownLis t>
</EditItemTemplat e>
<ItemTemplate >
<asp:Label ID="Label1" runat="server" Text='<%#
Bind("Framework EvidenceAchieve d") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateFie ld>
<asp:TemplateFi eld HeaderText="Evi dence Ref"
SortExpression= "FrameworkEvide nceRef">
<EditItemTempla te>
<asp:TextBox ID="txtEvidence Ref" runat="server"
MaxLength="150" Text='<%# Bind("Framework EvidenceRef")
%>'></asp:TextBox>
</EditItemTemplat e>
<ItemTemplate >
<asp:Label ID="Label2" runat="server" Text='<%#
Bind("Framework EvidenceRef") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateFie ld>
<asp:TemplateFi eld HeaderText="Evi dence Desc"
SortExpression= "FrameworkEvide nceDesc">
<EditItemTempla te>
<asp:TextBox ID="txtEvidence Desc"
runat="server" MaxLength="8000 " Text='<%# Bind("Framework EvidenceDesc")
%>'
TextMode="Multi Line"></asp:TextBox>
</EditItemTemplat e>
<ItemTemplate >
<asp:Label ID="Label3" runat="server" Text='<%#
Bind("Framework EvidenceDesc") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateFie ld>
<asp:TemplateFi eld HeaderText="Upd ated By"
SortExpression= "FrameworkEvide nceUpdatedBy">
<EditItemTempla te>
<asp:TextBox ID="txtUpdatedB y" runat="server"
MaxLength="10" Text='<%# GetLoggedInUser Id() %>'
</asp:TextBox></EditItemTemplat e>

<ItemTemplate > <asp:Label
ID="Label5" runat="server" Text='<%# Bind("Framework EvidenceUpdated By")
%>'></asp:Label>
</ItemTemplate>
</asp:TemplateFie ld>
<asp:TemplateFi eld HeaderText="Dat e"
SortExpression= "FrameworkEvide nceUpdatedDate" >
<EditItemTempla te>
<asp:TextBox ID="txtDate" runat="server"
ReadOnly="True" Text='<%#
getCurrentDateT ime(Eval("Frame workEvidenceUpd atedDate"))
%>'></asp:TextBox>
</EditItemTemplat e>
<ItemTemplate >
<asp:Label ID="Label4" runat="server" Text='<%#
Bind("Framework EvidenceUpdated Date") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateFie ld>
</Columns>
<SelectedRowSty le BackColor="Dark SlateBlue"
ForeColor="Ghos tWhite" />
<PagerStyle BackColor="Pale Goldenrod"
ForeColor="Dark SlateBlue" HorizontalAlign ="Center" />
<HeaderStyle BackColor="Tan" Font-Bold="True" />
<AlternatingRow Style BackColor="Pale Goldenrod" />
<EditRowStyle BackColor="#808 0FF" BorderColor="Bl ue"
Font-Size="1em" />
</asp:GridView>
<asp:SqlDataSou rce ID="DSFramework EvidenceSelectU pdate"
runat="server" ConnectionStrin g="<%$ ConnectionStrin gs:EqualitiesDb Conn
%>"
SelectCommand=" ProcFrameworkEv idenceSelectALL ByDeptId"
SelectCommandTy pe="StoredProce dure"
UpdateCommand=" ProcFrameworkEv idenceUpdate"
UpdateCommandTy pe="StoredProce dure">
<UpdateParamete rs>
<asp:Paramete r Name="Framework EvidenceId" />
<asp:Paramete r Name="Framework EvidenceDesc" />
<asp:Paramete r Name="Framework EvidenceRef" />
<asp:Paramete r Name="Framework EvidenceAchieve d" />
<asp:Paramete r Name="Framework EvidenceUpdated By" />
<asp:Paramete r Name="Framework EvidenceUpdated Date" />
</UpdateParameter s>
<SelectParamete rs>
<asp:Paramete r DefaultValue="3 " Name="dept_id"
Type="Int64" />
</SelectParameter s>
</asp:SqlDataSour ce>

Apr 19 '06 #1
0 1707

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

Similar topics

4
2723
by: Arturo Cuebas | last post by:
The program below contains a compile error. Following the program you will find the typical fix then my idea for a library that facilitates a more elegant fix. #include <boost\bind.hpp> using namespace boost; struct C {
2
5772
by: Smartin | last post by:
Using Access 97 I am trying to create a form that allows for user entry of search terms and displays a table of results. I thought I could accomplish this using a subform but it isn't quite doing what I want it to do. What I have so far: Fields to enter search terms Subform bound to a query
7
2555
by: Jed | last post by:
I have a web service method that returns an array of custom objects marked serializeable with fully described public properties. When I bind the results to a DataGrid I can access the properties in the ItemDataBound event of the codebehind but I can't access them declaratively in the HTML code? Here is the code to call the method. net.mysite.www.WSInterface proxy; proxy = new net.mysite.www.WSInterface();
1
1268
by: Luis Esteban Valencia | last post by:
Please everybody participate in this question. Hello my applicacion has many layers and classes and I think its well structured. PLease let me know if you disagree and why. 1. I have the user Interface (webforms) 2. I have a class Called Customer Class (it only has private fields, properties). Those properties connecto a Class called CustomerDALC (Customer Data Access Logic Component). this one must be the only responsible to access...
0
1065
by: Webbyz | last post by:
Here is my problem. I have 2 fields fSeason and rSeason in my database. These hold the String values of either Spring or Fall. I have a comboBox in my form that i am trying to bind on load to these fields. DB Table = referee DB Fields I am working with = fSeason / rSeason The values of Spring and Fall are manually entered into the collections
2
5090
by: darren.murray2 | last post by:
Hello all, I'm fairly new at this so I may be doing this the wrong way but I've got a FormView within a multiview that when it is updated in edit mode, will call on the update method associated with the objectdatasource that fills the formview. Problem: One of the fields is a textbox that when clicked has to open up a popup window with a listbox and when that popup closes, it sends the
1
1344
by: Peter Michaux | last post by:
Hi, I saw Brendan Eich in an online conference video say that in JavaScript 2 that they will lexically bind the "this" keyword of inner functions. He said that currently the execution-time resolution of "this" is considered a bug by some. I often take advantage of the fact that "this" is resolved during execution. Is JavaScript 2 going to break all my (our?) code? For example, one time, to save typing and download time, I automated
1
3365
by: adolph | last post by:
I wrote an access2000 database for a POS system. In it is a sales form with a a subform showing the items being purchased. The main form is unbound. It uses a class to hold the main form data and to read/write to the sales table. What I'm having trouble with is what to use as the 'Recordsource' for the subform (Items being sold). I do not want to bind the subform directly to the itemsSold table. What I would like to do is create a...
0
1367
by: dan | last post by:
Hi, I have a form that displays record fields. The record has a 'type' field. I'd like to use different controls for one of the fields based on the type. I initially thought of putting all possible controls (e.g. single line text box, multiline text box, check box, etc.) on the form and bind their 'Visible' attributes to expression like "GetType() == SomeType". The code-behind takes care of 'remembering' the current type. As a result...
0
8049
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
8469
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
8463
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...
1
8128
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8322
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...
1
5997
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...
1
2461
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
1
1574
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1316
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.