473,796 Members | 2,455 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Activa or not activate a button column depending if another data column has data or not

Two thins There is a field called explanation. I need to detect if the
field is empty the buttoncolumn must be active for that row if its
already filled the user cant join more data.

I have another column called STATUS, there are 3 statrus, maximum,
minimu, average, if that column is MAXIMUM I must put another color to
that field

The code of the datagird is the following

<asp:DataGrid OnItemDataBound ="dgindicador_D ataGridOnItemDa taBound"
id="dgindicador " runat="server"
BorderColor="#9 99999" BorderStyle="No ne" BorderWidth="1p x"
BackColor="Whit e" CellPadding="3"
GridLines="Vert ical" AutoGenerateCol umns="False"
Font-Size="X-Small" Font-Names="Trebuche t MS">
<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="Peri odo" ReadOnly="True"
HeaderText="Per iodo" DataFormatStrin g="{0:MM-yyyy}"></asp:BoundColumn >
<asp:BoundColum n DataField="Meta _ppto" ReadOnly="True"
HeaderText="Met a"></asp:BoundColumn >
<asp:BoundColum n DataField="valo r_real" ReadOnly="True"
HeaderText="Ind icador"></asp:BoundColumn >
<asp:BoundColum n DataField="Esta do" ReadOnly="True"
HeaderText="Est ado"></asp:BoundColumn >
<asp:BoundColum n DataField="Expl icacion" ReadOnly="True"
HeaderText="Exp licacion"></asp:BoundColumn >
<asp:ButtonColu mn Text="Ingresar Explicacion" HeaderText="Ing resar
Explicacion" CommandName="In gresar"></asp:ButtonColum n>
</Columns>
<PagerStyle HorizontalAlign ="Center" ForeColor="Blac k"
BackColor="#999 999" Mode="NumericPa ges"></PagerStyle>
</asp:DataGrid>

This code Fills the Datagrid

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
'Introducir aquí el código de usuario para inicializar la página
Dim selectCMD As SqlCommand = New SqlCommand("sel ect * from
cxc_nal order by periodo desc", SqlConnection1)
selectCMD.Comma ndTimeout = 30
Dim custDA As SqlDataAdapter = New SqlDataAdapter
custDA.SelectCo mmand = selectCMD
Dim custDS As DataSet = New DataSet
custDA.Fill(cus tDS, "cxc_nal")
dgindicador.Dat aSource = custDS.Tables(" cxc_nal").Defau ltView
dgindicador.Dat aBind()

End Sub

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #1
0 1204

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

Similar topics

15
2560
by: JR | last post by:
Hi. I hope someone out there who is more versed with JavaScript than I can help me with the following annoying problem. Here's the problem. I have a form with the following layout: Column A Column B Column C data 4 radio buttons more data .... ... ... .... ... ...
1
390
by: Darren Clark | last post by:
I have a link button that i would like to be used if the value of the text is NOT 0... So the code below will always make a linkbutton.... However if the value of "DataBinder.Eval(Container,"DataItem."+ JR.Core.Data.JobseekerData.FLD_SEARCH_MATCHES) " is 0 i do not want the the 0 to become a link.... I simply want to display it as text. How can i do this? <asp:LinkButton CommandArgument='<%# DataBinder.Eval(Container,"DataItem."+...
2
1285
by: Chris | last post by:
I need to add a button column to my datagrid. I need to be able to do this at runtime. I can not have the tag <columns></columns> in my aspx page. This is where I am at Private Function CreateProjectDataSource(ByVal projectds As DataSet, ByVal dg As DataGrid) As ICollection Try Dim btn As System.Web.UI.WebControls.Button Dim dt As DataTable
1
20163
by: reidarT | last post by:
I have entered a BindingNavigator toolbar in a bound form and can manage to browse records and I am able to enter data in a new record. I am ot able to save the data and therefore I have entered the save-button. How do I code this button to save a new record? reidarT
1
2719
by: keithb | last post by:
I have a GridView control that has a delete button (hyperlink) in one column. The datasource table contains a column that has a true/false indicator showing whether or not the record can be deleted. How can I enable/disable the delete button depending on the value of the indicator? Ideally, I would like to make the button invisible where a record cannot be deleted. Thanks, Keith
3
2181
by: gilbert3b2g | last post by:
I'm new to Python, and programming in general. What I'm trying to do here is to load a list of accounts from a file on my harddrive into a string of Buttons in Tkinter, and when I press one of the Buttons, which has one of my account name, it will load that account into a new window. But I don't understand how to code the proccess that would tell the program what account is selected. Any help with this would be very appreciated. Thanks in...
6
2727
by: sgottenyc | last post by:
Hello, If you could assist me with the following situation, I would be very grateful. I have a table of data retrieved from database displayed on screen. To each row of data, I have added action buttons, such as "Edit", "Add", and "Comment". Since I do not know how many rows of data will be retrieved - and therefore how many buttons I need - I am using button arrays for each button, like so: echo "<input type=\"submit\"...
0
2249
by: JRough | last post by:
Hi, I have a page with a form that is included into a php page. It has some php variables which are headers based on the user choices. In the form I will send some mysql data columns but right now I'm just formatting the form inside the tables. I added the table with the form yesterday and a button. After the data comes from php server I want the user to be able to click the Excel button at the bottom and the form output will go to...
6
2946
by: insirawali | last post by:
Hi all, I have this problem, i need to know is there a way i cn use the data adapter's update method in this scenario. i have 3 tables as below create table table1{ id1 int identity(1,1) Constraint pk_table1 Primary Key,
0
9680
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
9528
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
10455
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
10006
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
9052
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
7547
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
5441
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...
0
5573
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2925
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.