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

C

carlos perez

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_DataGridOnItemDataBound"
id="dgindicador" runat="server"
BorderColor="#999999" BorderStyle="None" BorderWidth="1px"
BackColor="White" CellPadding="3"
GridLines="Vertical" AutoGenerateColumns="False"
Font-Size="X-Small" Font-Names="Trebuchet MS">
<SelectedItemStyle Font-Bold="True" ForeColor="White"
BackColor="#008A8C"></SelectedItemStyle>
<AlternatingItemStyle BackColor="Gainsboro"></AlternatingItemStyle>
<ItemStyle ForeColor="Black" BackColor="#EEEEEE"></ItemStyle>
<HeaderStyle Font-Bold="True" ForeColor="White"
BackColor="#000084"></HeaderStyle>
<FooterStyle ForeColor="Black" BackColor="#CCCCCC"></FooterStyle>
<Columns>
<asp:BoundColumn DataField="Periodo" ReadOnly="True"
HeaderText="Periodo" DataFormatString="{0:MM-yyyy}"></asp:BoundColumn>
<asp:BoundColumn DataField="Meta_ppto" ReadOnly="True"
HeaderText="Meta"></asp:BoundColumn>
<asp:BoundColumn DataField="valor_real" ReadOnly="True"
HeaderText="Indicador"></asp:BoundColumn>
<asp:BoundColumn DataField="Estado" ReadOnly="True"
HeaderText="Estado"></asp:BoundColumn>
<asp:BoundColumn DataField="Explicacion" ReadOnly="True"
HeaderText="Explicacion"></asp:BoundColumn>
<asp:ButtonColumn Text="Ingresar Explicacion" HeaderText="Ingresar
Explicacion" CommandName="Ingresar"></asp:ButtonColumn>
</Columns>
<PagerStyle HorizontalAlign="Center" ForeColor="Black"
BackColor="#999999" Mode="NumericPages"></PagerStyle>
</asp:DataGrid>

This code Fills the Datagrid

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Introducir aquí el código de usuario para inicializar la página
Dim selectCMD As SqlCommand = New SqlCommand("select * from
cxc_nal order by periodo desc", SqlConnection1)
selectCMD.CommandTimeout = 30
Dim custDA As SqlDataAdapter = New SqlDataAdapter
custDA.SelectCommand = selectCMD
Dim custDS As DataSet = New DataSet
custDA.Fill(custDS, "cxc_nal")
dgindicador.DataSource = custDS.Tables("cxc_nal").DefaultView
dgindicador.DataBind()

End Sub





*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,835
Latest member
KetoRushACVBuy

Latest Threads

Top