Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8382543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:57:06+00:00 2026-06-09T16:57:06+00:00

Hey all i am wondering if it was possible to evaluate the datafield each

  • 0

Hey all i am wondering if it was possible to evaluate the datafield each time it places a new record into a row?

my gridview code is this:

<asp:Panel ID="pnlGrid" runat="server">
    <div class="left_main_container" style="margin-bottom:20px;">
        <asp:GridView ID="grdView" runat="server" CssClass="GridViewStyle"
            AutoGenerateColumns="False" GridLines="None" Width="100%">
            <Columns>
                <asp:BoundField DataField="id" Visible="False" />
                <asp:BoundField DataField="theName" HeaderText="Name" />
                <asp:BoundField DataField="status" HeaderText="Status" />
            </Columns>
            <RowStyle CssClass="RowStyle" />
            <EmptyDataRowStyle CssClass="EmptyRowStyle" />
            <PagerStyle CssClass="PagerStyle" />
            <SelectedRowStyle CssClass="SelectedRowStyle" />
            <HeaderStyle CssClass="HeaderStyle" />
            <EditRowStyle CssClass="EditRowStyle" />
            <AlternatingRowStyle CssClass="AltRowStyle" />
        </asp:GridView>
    </div>
</asp:Panel>

The field i need to evaluate is status. I need to find out if the status is yes or if its no. If its no then i need to make it a link for the user to be able to change it to a yes.

The gridview is populated by this code:

    Dim objConn As MySqlConnection
    Dim objCmd As MySqlCommand

    objConn = New MySqlConnection(strConnString)
    objConn.Open()

    Dim strSQL As String
    strSQL = "SELECT id, status, " & _
                "CONCAT(' ', first_name, last_name) AS theName " & _
             "FROM(builder_requests) " & _
             "ORDER BY status, id DESC;"

    Dim dtReader As MySqlDataReader
    objCmd = New MySqlCommand(strSQL, objConn)
    dtReader = objCmd.ExecuteReader()

    grdView.DataSource = dtReader
    grdView.DataBind()

    dtReader.Close()
    dtReader = Nothing

    objConn.Close()
    objConn = Nothing

Any help would be great!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T16:57:07+00:00Added an answer on June 9, 2026 at 4:57 pm

    I like to use a TemplateField and a function in your code-behind to do this sort of thing.

    I am assuming your status field is a string field not boolean but if not let me know and I can adjust the example.

    Replace your BoundField with…

    Markup:

            <asp:TemplateField>
                <ItemTemplate>
                    <%# Eval("status")%>&nbsp;
                    <asp:LinkButton ID="cmdChangeStatus" runat="server" CommandName="ChangeStatusToYes" CommandArgument='<%# Eval("id") %>'
                        Visible='<%# SetChangeStatusVisibility(Eval("status")) %>'>Change to Yes</asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
    

    And add code behind function…

    Code:

    Protected Function SetChangeStatusVisibility(status As Object) As String
        Dim strStatus As String = status.ToString()
        If strStatus = "no" Then
            Return "True"
        Else
            Return "False"
        End If
    End Function
    

    Then you can handle the GridView.RowCommand event to change the status value based on the id value in CommandArgument 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hey all, I'm new to Java and was wondering if I define a method
Hey I was wondering if it was at all possible in VHDL to AND
Hey all, i'm just wondering if there was any way to condense this line
Hey all, I'm wondering if anyone has ever used a tool which will take
Hey all, just wondering what the best way to add this capability was. I
Hey, I have a question regarding code structure, and was wondering what the best
Hey guys, I was wondering if it were possible to translate audio without having
Hey all, I've got a question about IIS7 rewrite. I'm wondering if there is
Hey I was wondering if it was possible to maintain a changelog for a
Possible Duplicate: Cocoa: Hide one application Hey, I was wondering if it's possible to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.