Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

Validation on 3 checkboxes

$
0
0

Hi folks, my code works ok with 1 parameter, basically the code checks to see if the checkbox is empty or not.

 If empty do not show, if not empty show checkbox value with a £ sign. I would like to add another 2 checkboxes chkMOT, chkAirCon to the if statement not sure how to do this, any help much appreciated.

protected void GridView2_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                //Get the checkbox control
                CheckBox chkwheeltracking = (CheckBox)e.Row.FindControl("chkWheelTrac");
                //Check if checkbox text is empty or not
                if (chkwheeltracking.Text != "")
                {
                    //Add the symbol before checkbox control
                    chkwheeltracking.Text = "£" + chkwheeltracking.Text;
                }
                else
                {
                    //Hide the checkbox
                    chkwheeltracking.Visible = false;
                }

            }
        }



Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>