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

Discussion in 'ASP .Net' started by carlos perez, Jun 8, 2004.

  1. carlos perez

    carlos perez Guest

    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!
    carlos perez, Jun 8, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hrvoje Vrbanc
    Replies:
    1
    Views:
    1,084
    Hrvoje Vrbanc
    Aug 27, 2003
  2. mark | r
    Replies:
    2
    Views:
    1,411
    mark | r
    Aug 1, 2003
  3. maximz2005
    Replies:
    1
    Views:
    525
    maximz2005
    Dec 13, 2008
  4. John Mackerras

    Template Column data depending on form data

    John Mackerras, Nov 15, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    134
    John Mackerras
    Nov 15, 2004
  5. Junkone
    Replies:
    2
    Views:
    207
    Jarmo Pertman
    Oct 27, 2010
Loading...

Share This Page