Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Formview - System.NullReference Exception when using FindControlRecursive

Avatar of edbrinkm
edbrinkm asked on
C#ASP.NET
2 Comments1 Solution720 ViewsLast Modified:
I have a formview with an item template, edit item template, and insert item template.I have a dropdownlist that I want to populate with data via the code behind.  Below is the code and page markup.  I can set the value for the control in the item template.  However, the control is not found successfully in the edit item template.  I have tried the formview modechanged, formview item command, and mode changing events.  DdlCurrFacilityread works.  The ddlCurrFacility code does not work.  I am open to suggestions.

        DropDownList ddlCurrFacilityread = FindControlRecursive(FormView1, "ddlCurrFacilityread") as DropDownList;
        DropDownList ddlCurrFacility = FindControlRecursive(FormView1, "ddlCurrFacility") as DropDownList;
        ddlCurrFacilityread.SelectedValue = Master.FacilityName;
        ddlCurrFacility.SelectedValue = Master.FacilityName;

public static Control FindControlRecursive(Control root, string id)
    {
        if ((root.ID != null) && (root.ID == id)) return root;

        foreach (Control ctrl in root.Controls)
        {
            Control found = FindControlRecursive(ctrl, id);
            if (found != null) return found;
        }

        return null;
    }

    <asp:FormView ID="FormView1" runat="server" DataSourceID="SDetailsDataSource" OnItemInserted="FormView1_ItemInserted" OnItemUpdated="FormView_ItemUpdated" OnItemDeleted="FormView_ItemDeleted" DataKeyNames="RowNum,RowVersion"><ItemTemplate>
     <cc1:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0"
        Height="450px" Width="700px">
        <cc1:TabPanel runat="server" HeaderText="TabPanel1" ID="TabPanel1">
            <HeaderTemplate>
                General
            </HeaderTemplate>
            <ContentTemplate><table><tr><td>
                <asp:Label ID="Label1read" runat="server" Text="Current Facility:"></asp:Label></td><td>
                    <asp:DropDownList
                    ID="ddlCurrFacilityread" Enabled=false runat="server" Width="250px">
                    <asp:ListItem>Northwest Missouri Psychiatric Rehabilitation Center</asp:ListItem>
                            <asp:ListItem>Southeast Missouri Mental Health Center</asp:ListItem>
                            <asp:ListItem>St Louis Psychiatric Rehabilitation Center</asp:ListItem>
                            <asp:ListItem>Marshall Habilitation Center</asp:ListItem>
                            <asp:ListItem>Southeast Missouri Residential Services</asp:ListItem>
                            <asp:ListItem>Fulton State Hospital</asp:ListItem>
                </asp:DropDownList>
            </td><td>
                <asp:Label ID="Label41read" runat="server" Text="Substance Use At Time Of Crime:"></asp:Label></td><td>
                    <asp:RadioButtonList ID="rblSubstanceread" Enabled=false runat="server" Height="22px"
                    RepeatDirection="Horizontal"
                        SelectedIndex='<%# Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem) , "SubstanceUseAtTimeOfCrime")) %>'> <asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem>
                </asp:RadioButtonList>
                </td></tr><tr><td>
                <asp:Label ID="Label2read" runat="server" Text="Current Program:"></asp:Label></td><td>
                        <asp:DropDownList
                    ID="ddlProgramread" Enabled=false runat="server" Width="250px">
                </asp:DropDownList>
            </td><td>
                <asp:Label ID="Label3read" runat="server" Text="Current Security Level:"></asp:Label></td><td>
                        <asp:DropDownList
                    ID="ddlSecurityLevelRead" Enabled=false runat="server" Width="150px">
                    <asp:ListItem>Maximum</asp:ListItem>
                            <asp:ListItem>Intermediate</asp:ListItem>
                            <asp:ListItem>Minimum</asp:ListItem>
                            <asp:ListItem>Campus</asp:ListItem>
                            <asp:ListItem>Unknown</asp:ListItem>
                </asp:DropDownList>
            </td></tr><tr><td>
                <asp:Label ID="Label4read" runat="server" Text="Current Residence Area:"></asp:Label></td><td>
                        <asp:DropDownList
                    ID="ddlArearead" Enabled=false runat="server" Width="250px">
                </asp:DropDownList>
            </td><td>
                <asp:Label ID="Label42read" runat="server" Text="Recent Predictive Behavior:"></asp:Label></td><td>
                        <asp:DropDownList
                    ID="ddlBehaviorread" Enabled=false runat="server" Width="150px" DataSourceID="SqlDataSource3"
                            DataTextField="RiskRating" DataValueField="RiskRating" SelectedValue='<%# Bind("CurrentRiskRating") %>'>
                </asp:DropDownList>
            </td></tr></table></ContentTemplate>
        </cc1:TabPanel>
        <cc1:TabPanel ID="TabPanel2" runat="server" HeaderText="TabPanel2">
        <HeaderTemplate>Crime 1</HeaderTemplate>
        <ContentTemplate><table><tr><td class="style1">
            <asp:Label ID="Label5read" runat="server" Text="Index Crime 1:"></asp:Label></td>
            <td colspan=3><asp:DropDownList ID="ddlCrime1read" Enabled=false runat="server" Width="500px"
                    DataSourceID="SqlDataSource2" DataTextField="CHARGE"
                    DataValueField="CHARGE" SelectedValue='<%# Bind("IndexCrimeNum_1") %>' ></asp:DropDownList>
           
        </td></tr><tr><td>
            <asp:Label ID="Label43read" runat="server" Text="Adjudication Status:"></asp:Label></td><td>
                    <asp:DropDownList ID="ddlAdjudicationread" Enabled=false runat="server" Width="240px"
                    DataSourceID="SqlDataSource4" DataTextField="AdjudicationStatus"
                    DataValueField="AdjudicationStatus"
                        SelectedValue='<%# Bind("AdjudicationStatus") %>' ></asp:DropDownList></td><td>
                    <asp:Label ID="Label44read" runat="server" Text="Adjudication Date:"></asp:Label></td><td>
                        <asp:TextBox ID="txtAdjudDateread" ReadOnly=true runat="server" Text='<%# Bind("AdjudicationDate", "{0:d}") %>'></asp:TextBox></td></tr><tr><td class="style1"><asp:Label ID="Label6read" runat="server"
                    Text="Attempted Crime 1:" Height="22px"></asp:Label></td>
                <td><asp:RadioButtonList ID="rblAttempt1read" Enabled=false runat="server" Height="22px"
                    RepeatDirection="Horizontal"
                        SelectedIndex='<%# Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem) , "Attempted_Crime1")) %>'> <asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem>
                </asp:RadioButtonList>
                </td><td>
                    <asp:Label ID="Label13read" runat="server" Text="Sex Offense:"></asp:Label></td><td>
                    <asp:RadioButtonList ID="rblSex1read" Enabled=false runat="server" RepeatDirection=Horizontal
                        SelectedIndex='<%# Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem) , "SexOffense_Num1")) %>'> <asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem>
                                        </asp:RadioButtonList></td></tr><tr><td>
                    <asp:Label ID="Label7read" runat="server" Text="Associated Crimes"></asp:Label></td><td>
                        <asp:TextBox ID="txtAssocCrimes1read" Enabled=false runat="server" Text='<%# Bind("AssociatedCrimes_1") %>'></asp:TextBox></td><td>
                            <asp:Label ID="Label14read" runat="server" Text="Registerable Offense:"></asp:Label></td><td>
                    <asp:RadioButtonList ID="rblRegister1read" Enabled=false runat="server"
                        RepeatDirection=Horizontal
                        SelectedIndex='<%# Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem) , "RegisterableOffenseNum_1")) %>'> <asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem>
                                        </asp:RadioButtonList></td></tr><tr><td>
                            <asp:Label ID="Label8read" runat="server" Text="Date of Occurrence"></asp:Label></td><td>
                                <asp:TextBox ID="txtDateOccurrence1read" ReadOnly=true runat="server" Text='<%# Bind("DateOfOccurrence_1", "{0:d}") %>'></asp:TextBox></td><td>
                                    <asp:Label ID="Label15read" runat="server" Text="Committing Court:"></asp:Label></td><td>
                                        <asp:TextBox ID="txtCourt1read" Enabled=false runat="server" Text='<%# Bind("CommittingCourtNum_1") %>'></asp:TextBox></td></tr><tr><td>
                                    <asp:Label ID="Label9read" runat="server" Text="Major Crime:"></asp:Label></td><td>
                                        <asp:RadioButtonList ID="rblMajor1read" Enabled=false runat="server" RepeatDirection=Horizontal
                                            SelectedIndex='<%# Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem), "MajorCrimeNum_1")) %>'> <asp:ListItem Value="0">No</asp:ListItem>
                    <asp:ListItem Value="1">Yes</asp:ListItem>
                                        </asp:RadioButtonList>
                                    </td><td>
                                            <asp:Label ID="Label11read" runat="server" Text="Charge Classification:"></asp:Label></td><td>
                                                <asp:TextBox ID="txtClass1read" Enabled=false runat="server" Text='<%# Bind("ChargeClassificationNum_1") %>'></asp:TextBox></td></tr><tr><td>
                                        <asp:Label ID="Label10read" runat="server" Text="Felony:"></asp:Label></td><td>
                    <asp:RadioButtonList ID="rblFelony1read" Enabled=false runat="server" RepeatDirection=Horizontal
                        SelectedIndex='<%# Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem) , "FelonyNum_1")) %>'> <asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem>
                                        </asp:RadioButtonList></td><td>
                                                    <asp:Label ID="Label12read" runat="server" Text="Code:"></asp:Label></td><td>
                                                        <asp:TextBox ID="txtCode1read" ReadOnly=false runat="server" Text='<%# Bind("Code_Num1") %>'></asp:TextBox></td></tr><tr valign=top><td>
                                                            <asp:Label ID="Label16read" runat="server" Text="Narrative Description:"></asp:Label></td><td colspan=3>
                                                                <asp:TextBox ID="txtNarrative1read" ReadOnly=true runat="server" TextMode=MultiLine Width=500px MaxLength=1073741823
                                                                    Height="191px" Text='<%# Bind("NarrativeDescriptionNum_1") %>'></asp:TextBox></td></tr></table></ContentTemplate>
        </cc1:TabPanel>
        <cc1:TabPanel ID="TabPanel3" runat="server" HeaderText="TabPanel3">
        <HeaderTemplate>Crime 2</HeaderTemplate>
        <ContentTemplate><table><tr><td class="style1">
            <asp:Label ID="Label17read" runat="server" Text="Index Crime 2:"></asp:Label></td>
            <td colspan=3><asp:DropDownList ID="ddlCrime2read" Enabled=false runat="server" Width="500px"
                    DataSourceID="SqlDataSource2" DataTextField="CHARGE"
                    DataValueField="CHARGE" SelectedValue='<%# Bind("IndexCrimeNum_2") %>'></asp:DropDownList>
           
        </td></tr><tr><td>
            <asp:Label ID="Label45read" runat="server" Text="Adjudication Status:"></asp:Label></td><td>
                    <asp:DropDownList ID="ddlAdjudication2read" Enabled=false runat="server" Width="240px"
                    DataSourceID="SqlDataSource4" DataTextField="AdjudicationStatus"
                    DataValueField="AdjudicationStatus"
                        SelectedValue='<%# Bind("AdjudicationStatusNum_2") %>' ></asp:DropDownList></td><td>
                    <asp:Label ID="Label46read" runat="server" Text="Adjudication Date:"></asp:Label></td><td>
                        <asp:TextBox ID="txtAdjudDate2read" ReadOnly=true runat="server" Text='<%# Bind("AdjudicationDateNum_2", "{0:d}") %>'></asp:TextBox></td></tr><tr><td class="style1"><asp:Label ID="Label18read" runat="server"
                    Text="Attempted Crime 2:" Height="22px"></asp:Label></td>
                <td><asp:RadioButtonList ID="rblAttempted2read" Enabled=false runat="server" Height="22px"
                    RepeatDirection="Horizontal" SelectedIndex='<%#Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem) , "Attempted_Crime2"))%>'> <asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem>
                </asp:RadioButtonList>
                </td><td>
                    <asp:Label ID="Label19read" runat="server" Text="Sex Offense:"></asp:Label></td><td><asp:RadioButtonList ID="rblSex2read" Enabled=false runat="server" RepeatDirection=Horizontal SelectedIndex='<%#Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem) , "SexOffense_Num2"))%>'> <asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem>
                                        </asp:RadioButtonList></td></tr><tr><td>
                    <asp:Label ID="Label20read" runat="server" Text="Associated Crimes"></asp:Label></td><td>
                        <asp:TextBox ID="txtAssocCrime2read" ReadOnly=true runat="server" Text='<%# Bind("AssociatedCrimesNum_2") %>'></asp:TextBox></td><td>
                            <asp:Label ID="Label21read" runat="server" Text="Registerable Offense:"></asp:Label></td><td><asp:RadioButtonList ID="rblRegister2read" Enabled=false runat="server" RepeatDirection=Horizontal SelectedIndex='<%#Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem) , "RegisterableOffenseNum_2"))%>'> <asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem>
                                        </asp:RadioButtonList></td></tr><tr><td>
                            <asp:Label ID="Label22read" runat="server" Text="Date of Occurrence"></asp:Label></td><td>
                                <asp:TextBox ID="txtDateOccur2read" runat="server" Text='<%# Bind("DateOfOccurrenceNum_2", "{0:d}") %>'></asp:TextBox></td><td>
                                    <asp:Label ID="Label23read" runat="server" Text="Committing Court:"></asp:Label></td><td>
                                        <asp:TextBox ID="txtCourt2read" runat="server" Text='<%# Bind("CommittingCourtNum_2") %>'></asp:TextBox></td></tr><tr><td>
                                    <asp:Label ID="Label24read" runat="server" Text="Major Crime:"></asp:Label></td><td>
                                        <asp:RadioButtonList ID="rblMajor2read" Enabled=false runat="server" RepeatDirection=Horizontal SelectedIndex='<%#Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem) , "MajorCrimeNum_2"))%>'> <asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem>
                                        </asp:RadioButtonList>
                                    </td><td>
                                            <asp:Label ID="Label25read" runat="server" Text="Charge Classification:"></asp:Label></td><td>
                                                <asp:TextBox ID="txtClass2read" ReadOnly=true runat="server" Text='<%# Bind("ChargeClassificationNum_2") %>'></asp:TextBox></td></tr><tr><td>
                                        <asp:Label ID="Label26read" runat="server" Text="Felony:"></asp:Label></td><td><asp:RadioButtonList ID="rblFelony2read" Enabled=false runat="server" RepeatDirection=Horizontal SelectedIndex='<%#Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem) , "FelonyNum_2"))%>'> <asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem>
                                        </asp:RadioButtonList></td><td>
                                                    <asp:Label ID="Label27read" runat="server" Text="Code:"></asp:Label></td><td>
                                                        <asp:TextBox ID="txtCode2read" ReadOnly=true runat="server" Text='<%# Bind("Code_Num2") %>'></asp:TextBox></td></tr><tr valign=top><td>
                                                            <asp:Label ID="Label28read" runat="server" Text="Narrative Description:"></asp:Label></td><td colspan=3>
                                                                <asp:TextBox ID="txtNarrative2read" ReadOnly=true runat="server" TextMode=MultiLine Width=500px MaxLength=1073741823
                                                                    Height="193px" Text='<%# Bind("NarrativeDescriptionNum_2") %>'></asp:TextBox></td></tr></table></ContentTemplate>
        </cc1:TabPanel>
        <cc1:TabPanel ID="TabPanel4" runat="server" HeaderText="TabPanel4">
        <HeaderTemplate>Crime 3</HeaderTemplate>
        <ContentTemplate><table><tr><td class="style1">
            <asp:Label ID="Label29read" runat="server" Text="Index Crime 3:"></asp:Label></td>
            <td colspan=3><asp:DropDownList ID="ddlCrime3read" Enabled=false runat="server" Width="500px"
                    DataSourceID="SqlDataSource2" DataTextField="CHARGE"
                    DataValueField="CHARGE" SelectedValue='<%# Bind("IndexCrimeNum_3") %>'></asp:DropDownList>
           
        </td></tr><tr><td>
            <asp:Label ID="Label47read" runat="server" Text="Adjudication Status:"></asp:Label></td><td>
                    <asp:DropDownList ID="ddlAdjudication3read" Enabled=false runat="server" Width="240px"
                    DataSourceID="SqlDataSource4" DataTextField="AdjudicationStatus"
                    DataValueField="AdjudicationStatus"
                        SelectedValue='<%# Bind("AdjudicationStatusNum_3") %>' ></asp:DropDownList></td><td>
                    <asp:Label ID="Label48read" runat="server" Text="Adjudication Date:"></asp:Label></td><td>
                        <asp:TextBox ID="txtAdjudDate3read" ReadOnly=true runat="server" Text='<%# Bind("AdjudicationDateNum_3", "{0:d}") %>'></asp:TextBox></td></tr><tr><td class="style1"><asp:Label ID="Label30read" runat="server"
                    Text="Attempted Crime 3:" Height="22px"></asp:Label></td>
                <td><asp:RadioButtonList ID="rblAttempted3read" Enabled=false runat="server" Height="22px"
                    RepeatDirection="Horizontal" SelectedIndex='<%#Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem) , "Attempted_Crime3"))%>'> <asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem>
                </asp:RadioButtonList>
                </td><td>
                    <asp:Label ID="Label31read" runat="server" Text="Sex Offense:"></asp:Label></td><td><asp:RadioButtonList ID="rblSex3read" runat="server" RepeatDirection=Horizontal SelectedIndex='<%#Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem) , "SexOffense_Num3"))%>'> <asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem>
                                        </asp:RadioButtonList></td></tr><tr><td>
                    <asp:Label ID="Label32read" runat="server" Text="Associated Crimes"></asp:Label></td><td>
                        <asp:TextBox ID="txtAssocCrime3read" ReadOnly=true runat="server" Text='<%# Bind("AssociatedCrimesNum_3") %>'></asp:TextBox></td><td>
                            <asp:Label ID="Label33read" runat="server" Text="Registerable Offense:"></asp:Label></td><td><asp:RadioButtonList ID="rblRegister3read" Enabled=false runat="server" RepeatDirection=Horizontal SelectedIndex='<%#Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem) , "RegisterableOffenseNum_3"))%>'> <asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem>
                                        </asp:RadioButtonList></td></tr><tr><td>
                            <asp:Label ID="Label34read" runat="server" Text="Date of Occurrence"></asp:Label></td><td>
                                <asp:TextBox ID="txtDate3read" ReadOnly=true runat="server" Text='<%# Bind("DateOfOccurrenceNum_3", "{0:d}") %>'></asp:TextBox></td><td>
                                    <asp:Label ID="Label35read" runat="server" Text="Committing Court:"></asp:Label></td><td>
                                        <asp:TextBox ID="txtCourt3read" ReadOnly=true runat="server" Text='<%# Bind("CommittingCourtNum_3") %>'></asp:TextBox></td></tr><tr><td>
                                    <asp:Label ID="Label36read" runat="server" Text="Major Crime:"></asp:Label></td><td>
                                        <asp:RadioButtonList ID="rblMajor3read" Enabled=false runat="server" RepeatDirection=Horizontal SelectedIndex='<%#Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem) , "MajorCrimeNum_3"))%>'> <asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem>
                                        </asp:RadioButtonList>
                                    </td><td>
                                            <asp:Label ID="Label37read" runat="server" Text="Charge Classification:"></asp:Label></td><td>
                                                <asp:TextBox ID="txtClass3read" ReadOnly=true runat="server" Text='<%# Bind("ChargeClassificationNum_3") %>'></asp:TextBox></td></tr><tr><td>
                                        <asp:Label ID="Label38read" runat="server" Text="Felony:"></asp:Label></td><td><asp:RadioButtonList ID="rblFelony3read" Enabled=false runat="server" RepeatDirection=Horizontal SelectedIndex='<%#Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem) , "FelonyNum_3"))%>'> <asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem>
                                        </asp:RadioButtonList></td><td>
                                                    <asp:Label ID="Label39read" runat="server" Text="Code:"></asp:Label></td><td>
                                                        <asp:TextBox ID="txtCode3read" ReadOnly=true runat="server" Text='<%# Bind("Code_Num3") %>'></asp:TextBox></td></tr><tr valign=top><td>
                                                            <asp:Label ID="Label40read" runat="server" Text="Narrative Description:"></asp:Label></td><td colspan=3>
                                                                <asp:TextBox ID="txtNarrative3read" ReadOnly=true runat="server" TextMode=MultiLine Width=500px MaxLength=1073741823
                                                                    Height="186px" Text='<%# Bind("NarrativeDescriptionNum_3") %>'></asp:TextBox></td></tr></table></ContentTemplate>
        </cc1:TabPanel>
    </cc1:TabContainer><asp:Button ID="btnNew" runat="server" Text="New" CommandName="New" />
                                                <asp:Button ID="btnEdit" runat="server" Text="Edit" CommandName="Edit" /><asp:Button
                                                    ID="btnDelete" runat="server" Text="Delete" CommandName="Delete" /></ItemTemplate><EditItemTemplate> <cc1:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0"
        Height="417px" Width="700px">
        <cc1:TabPanel runat="server" HeaderText="TabPanel1" ID="TabPanel1">
            <HeaderTemplate>
                General
            </HeaderTemplate>
            <ContentTemplate><table><tr><td>
                <asp:Label ID="Label1" runat="server" Text="Current Facility:"></asp:Label></td><td>
                    <asp:DropDownList
                    ID="ddlCurrFacility" runat="server" Width="250px">
                    <asp:ListItem>Northwest Missouri Psychiatric Rehabilitation Center</asp:ListItem>
                            <asp:ListItem>Southeast Missouri Mental Health Center</asp:ListItem>
                            <asp:ListItem>St Louis Psychiatric Rehabilitation Center</asp:ListItem>
                            <asp:ListItem>Marshall Habilitation Center</asp:ListItem>
                            <asp:ListItem>Southeast Missouri Residential Services</asp:ListItem>
                            <asp:ListItem>Fulton State Hospital</asp:ListItem>
                </asp:DropDownList>
            </td><td>
                <asp:Label ID="Label41" runat="server" Text="Substance Use At Time Of Crime:"></asp:Label></td><td>
                    <asp:RadioButtonList ID="rblSubstance" runat="server" Height="22px"
                    RepeatDirection="Horizontal"
                        SelectedIndex='<%# Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem) , "SubstanceUseAtTimeOfCrime")) %>'> <asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem>
                </asp:RadioButtonList>
                </td></tr><tr><td>
                <asp:Label ID="Label2" runat="server" Text="Current Program:"></asp:Label></td><td>
                        <asp:DropDownList
                    ID="ddlProgram" runat="server" Width="250px">
                </asp:DropDownList>
            </td><td>
                <asp:Label ID="Label3" runat="server" Text="Current Security Level:"></asp:Label></td><td>
                        <asp:DropDownList
                    ID="ddlSecurityLevel" runat="server" Width="150px" Enabled=false>
                    <asp:ListItem>Maximum</asp:ListItem>
                            <asp:ListItem>Intermediate</asp:ListItem>
                            <asp:ListItem>Minimum</asp:ListItem>
                            <asp:ListItem>Campus</asp:ListItem>
                            <asp:ListItem>Unknown</asp:ListItem>
                </asp:DropDownList>
            </td></tr><tr><td>
                <asp:Label ID="Label4" runat="server" Text="Current Residence Area:"></asp:Label></td><td>
                        <asp:DropDownList
                    ID="ddlArea" runat="server" Width="250px">
                </asp:DropDownList>
            </td><td>
                <asp:Label ID="Label42" runat="server" Text="Recent Predictive Behavior:"></asp:Label></td><td>
                        <asp:DropDownList
                    ID="ddlBehavior" runat="server" Width="150px" DataSourceID="SqlDataSource3"
                            DataTextField="RiskRating" DataValueField="RiskRating" SelectedValue='<%# Bind("CurrentRiskRating") %>'>
                </asp:DropDownList>
            </td></tr></table></ContentTemplate>
        </cc1:TabPanel>
        <cc1:TabPanel ID="TabPanel2" runat="server" HeaderText="TabPanel2">
        <HeaderTemplate>Crime 1</HeaderTemplate>
        <ContentTemplate><table><tr><td class="style1">
            <asp:Label ID="Label5" runat="server" Text="Index Crime 1:"></asp:Label></td>
            <td colspan=3><asp:DropDownList ID="ddlCrime1" runat="server" Width="500px"
                    DataSourceID="SqlDataSource2" DataTextField="CHARGE"
                    DataValueField="CHARGE" SelectedValue='<%# Bind("IndexCrimeNum_1") %>' ></asp:DropDownList>
           
        </td></tr><tr><td>
            <asp:Label ID="Label43" runat="server" Text="Adjudication Status:"></asp:Label></td><td>
                    <asp:DropDownList ID="ddlAdjudication" runat="server" Width="240px"
                    DataSourceID="SqlDataSource4" DataTextField="AdjudicationStatus"
                    DataValueField="AdjudicationStatus"
                        SelectedValue='<%# Bind("AdjudicationStatus") %>' ></asp:DropDownList></td><td>
                    <asp:Label ID="Label44" runat="server" Text="Adjudication Date:"></asp:Label></td><td>
                        <asp:TextBox ID="txtAdjudDate" runat="server" Text='<%# Bind("AdjudicationDate", "{0:d}") %>'></asp:TextBox></td></tr><tr><td class="style1"><asp:Label ID="Label6" runat="server"
                    Text="Attempted Crime 1:" Height="22px"></asp:Label></td>
                <td><asp:RadioButtonList ID="rblAttempt1" runat="server" Height="22px"
                    RepeatDirection="Horizontal"
                        SelectedIndex='<%# Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem) , "Attempted_Crime1")) %>'> <asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem>
                </asp:RadioButtonList>
                </td><td>
                    <asp:Label ID="Label13" runat="server" Text="Sex Offense:"></asp:Label></td><td>
                    <asp:RadioButtonList ID="rblSex1" runat="server" RepeatDirection=Horizontal
                        SelectedIndex='<%# Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem) , "SexOffense_Num1")) %>'> <asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem>
                                        </asp:RadioButtonList></td></tr><tr><td>
                    <asp:Label ID="Label7" runat="server" Text="Associated Crimes"></asp:Label></td><td>
                        <asp:TextBox ID="txtAssocCrimes1" runat="server" Text='<%# Bind("AssociatedCrimes_1") %>'></asp:TextBox></td><td>
                            <asp:Label ID="Label14" runat="server" Text="Registerable Offense:"></asp:Label></td><td>
                    <asp:RadioButtonList ID="rblRegister1" runat="server"
                        RepeatDirection=Horizontal
                        SelectedIndex='<%# Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem) , "RegisterableOffenseNum_1")) %>'> <asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem>
                                        </asp:RadioButtonList></td></tr><tr><td>
                            <asp:Label ID="Label8" runat="server" Text="Date of Occurrence"></asp:Label></td><td>
                                <asp:TextBox ID="txtDateOccurrence1" runat="server" Text='<%# Bind("DateOfOccurrence_1", "{0:d}") %>'></asp:TextBox></td><td>
                                    <asp:Label ID="Label15" runat="server" Text="Committing Court:"></asp:Label></td><td>
                                        <asp:TextBox ID="txtCourt1" runat="server" Text='<%# Bind("CommittingCourtNum_1") %>'></asp:TextBox></td></tr><tr><td>
                                    <asp:Label ID="Label9" runat="server" Text="Major Crime:"></asp:Label></td><td>
                                        <asp:RadioButtonList ID="rblMajor1" runat="server" RepeatDirection=Horizontal
                                            SelectedIndex='<%# Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem), "MajorCrimeNum_1")) %>'> <asp:ListItem Value="0">No</asp:ListItem>
                    <asp:ListItem Value="1">Yes</asp:ListItem>
                                        </asp:RadioButtonList>
                                    </td><td>
                                            <asp:Label ID="Label11" runat="server" Text="Charge Classification:"></asp:Label></td><td>
                                                <asp:TextBox ID="txtClass1" runat="server" Text='<%# Bind("ChargeClassificationNum_1") %>'></asp:TextBox></td></tr><tr><td>
                                        <asp:Label ID="Label10" runat="server" Text="Felony:"></asp:Label></td><td>
                    <asp:RadioButtonList ID="rblFelony1" runat="server" RepeatDirection=Horizontal
                        SelectedIndex='<%# Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem) , "FelonyNum_1")) %>'> <asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem>
                                        </asp:RadioButtonList></td><td>
                                                    <asp:Label ID="Label12" runat="server" Text="Code:"></asp:Label></td><td>
                                                        <asp:TextBox ID="txtCode1" runat="server" Text='<%# Bind("Code_Num1") %>'></asp:TextBox></td></tr><tr valign=top><td>
                                                            <asp:Label ID="Label16" runat="server" Text="Narrative Description:"></asp:Label></td><td colspan=3>
                                                                <asp:TextBox ID="txtNarrative1" runat="server" TextMode=MultiLine Width=500px MaxLength=1073741823
                                                                    Height="191px" Text='<%# Bind("NarrativeDescriptionNum_1") %>'></asp:TextBox></td></tr></table></ContentTemplate>
        </cc1:TabPanel>
        <cc1:TabPanel ID="TabPanel3" runat="server" HeaderText="TabPanel3">
        <HeaderTemplate>Crime 2</HeaderTemplate>
        <ContentTemplate><table><tr><td class="style1">
            <asp:Label ID="Label17" runat="server" Text="Index Crime 2:"></asp:Label></td>
            <td colspan=3><asp:DropDownList ID="ddlCrime2" runat="server" Width="500px"
                    DataSourceID="SqlDataSource2" DataTextField="CHARGE"
                    DataValueField="CHARGE" SelectedValue='<%# Bind("IndexCrimeNum_2") %>'></asp:DropDownList>
           
        </td></tr><tr><td>
            <asp:Label ID="Label45" runat="server" Text="Adjudication Status:"></asp:Label></td><td>
                    <asp:DropDownList ID="ddlAdjudication2" runat="server" Width="240px"
                    DataSourceID="SqlDataSource4" DataTextField="AdjudicationStatus"
                    DataValueField="AdjudicationStatus"
                        SelectedValue='<%# Bind("AdjudicationStatusNum_2") %>' ></asp:DropDownList></td><td>
                    <asp:Label ID="Label46" runat="server" Text="Adjudication Date:"></asp:Label></td><td>
                        <asp:TextBox ID="txtAdjudDate2" runat="server" Text='<%# Bind("AdjudicationDateNum_2" , "{0:d}") %>'></asp:TextBox></td></tr><tr><td class="style1"><asp:Label ID="Label18" runat="server"
                    Text="Attempted Crime 2:" Height="22px"></asp:Label></td>
                <td><asp:RadioButtonList ID="rblAttempted2" runat="server" Height="22px"
                    RepeatDirection="Horizontal" SelectedIndex='<%#Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem) , "Attempted_Crime2"))%>'> <asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem>
                </asp:RadioButtonList>
                </td><td>
                    <asp:Label ID="Label19" runat="server" Text="Sex Offense:"></asp:Label></td><td><asp:RadioButtonList ID="rblSex2" runat="server" RepeatDirection=Horizontal SelectedIndex='<%#Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem) , "SexOffense_Num2"))%>'> <asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem>
                                        </asp:RadioButtonList></td></tr><tr><td>
                    <asp:Label ID="Label20" runat="server" Text="Associated Crimes"></asp:Label></td><td>
                        <asp:TextBox ID="txtAssocCrime2" runat="server" Text='<%# Bind("AssociatedCrimesNum_2") %>'></asp:TextBox></td><td>
                            <asp:Label ID="Label21" runat="server" Text="Registerable Offense:"></asp:Label></td><td><asp:RadioButtonList ID="rblRegister2" runat="server" RepeatDirection=Horizontal SelectedIndex='<%#Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem) , "RegisterableOffenseNum_2"))%>'> <asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem>
                                        </asp:RadioButtonList></td></tr><tr><td>
                            <asp:Label ID="Label22" runat="server" Text="Date of Occurrence"></asp:Label></td><td>
                                <asp:TextBox ID="txtDateOccur2" runat="server" Text='<%# Bind("DateOfOccurrenceNum_2", "{0:d}") %>'></asp:TextBox></td><td>
                                    <asp:Label ID="Label23" runat="server" Text="Committing Court:"></asp:Label></td><td>
                                        <asp:TextBox ID="txtCourt2" runat="server" Text='<%# Bind("CommittingCourtNum_2") %>'></asp:TextBox></td></tr><tr><td>
                                    <asp:Label ID="Label24" runat="server" Text="Major Crime:"></asp:Label></td><td>
                                        <asp:RadioButtonList ID="rblMajor2" runat="server" RepeatDirection=Horizontal SelectedIndex='<%#Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem) , "MajorCrimeNum_2"))%>'> <asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem>
                                        </asp:RadioButtonList>
                                    </td><td>
                                            <asp:Label ID="Label25" runat="server" Text="Charge Classification:"></asp:Label></td><td>
                                                <asp:TextBox ID="txtClass2" runat="server" Text='<%# Bind("ChargeClassificationNum_2") %>'></asp:TextBox></td></tr><tr><td>
                                        <asp:Label ID="Label26" runat="server" Text="Felony:"></asp:Label></td><td><asp:RadioButtonList ID="rblFelony2" runat="server" RepeatDirection=Horizontal SelectedIndex='<%#Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem) , "FelonyNum_2"))%>'> <asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem>
                                        </asp:RadioButtonList></td><td>
                                                    <asp:Label ID="Label27" runat="server" Text="Code:"></asp:Label></td><td>
                                                        <asp:TextBox ID="txtCode2" runat="server" Text='<%# Bind("Code_Num2") %>'></asp:TextBox></td></tr><tr valign=top><td>
                                                            <asp:Label ID="Label28" runat="server" Text="Narrative Description:"></asp:Label></td><td colspan=3>
                                                                <asp:TextBox ID="txtNarrative2" runat="server" TextMode=MultiLine Width=500px MaxLength=1073741823
                                                                    Height="193px" Text='<%# Bind("NarrativeDescriptionNum_2") %>'></asp:TextBox></td></tr></table></ContentTemplate>
        </cc1:TabPanel>
        <cc1:TabPanel ID="TabPanel4" runat="server" HeaderText="TabPanel4">
        <HeaderTemplate>Crime 3</HeaderTemplate>
        <ContentTemplate><table><tr><td class="style1">
            <asp:Label ID="Label29" runat="server" Text="Index Crime 3:"></asp:Label></td>
            <td colspan=3><asp:DropDownList ID="ddlCrime3" runat="server" Width="500px"
                    DataSourceID="SqlDataSource2" DataTextField="CHARGE"
                    DataValueField="CHARGE" SelectedValue='<%# Bind("IndexCrimeNum_3") %>'></asp:DropDownList>
           
        </td></tr><tr><td>
            <asp:Label ID="Label47" runat="server" Text="Adjudication Status:"></asp:Label></td><td>
                    <asp:DropDownList ID="ddlAdjudication3" runat="server" Width="240px"
                    DataSourceID="SqlDataSource4" DataTextField="AdjudicationStatus"
                    DataValueField="AdjudicationStatus"
                        SelectedValue='<%# Bind("AdjudicationStatusNum_3") %>' ></asp:DropDownList></td><td>
                    <asp:Label ID="Label48" runat="server" Text="Adjudication Date:"></asp:Label></td><td>
                        <asp:TextBox ID="txtAdjudDate3" runat="server" Text='<%# Bind("AdjudicationDateNum_3", "{0:d}") %>'></asp:TextBox></td></tr><tr><td class="style1"><asp:Label ID="Label30" runat="server"
                    Text="Attempted Crime 3:" Height="22px"></asp:Label></td>
                <td><asp:RadioButtonList ID="rblAttempted3" runat="server" Height="22px"
                    RepeatDirection="Horizontal" SelectedIndex='<%#Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem) , "Attempted_Crime3"))%>'> <asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem>
                </asp:RadioButtonList>
                </td><td>
                    <asp:Label ID="Label31" runat="server" Text="Sex Offense:"></asp:Label></td><td><asp:RadioButtonList ID="rblSex3" runat="server" RepeatDirection=Horizontal SelectedIndex='<%#Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem) , "SexOffense_Num3"))%>'> <asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem>
                                        </asp:RadioButtonList></td></tr><tr><td>
                    <asp:Label ID="Label32" runat="server" Text="Associated Crimes"></asp:Label></td><td>
                        <asp:TextBox ID="txtAssocCrime3" runat="server" Text='<%# Bind("AssociatedCrimesNum_3") %>'></asp:TextBox></td><td>
                            <asp:Label ID="Label33" runat="server" Text="Registerable Offense:"></asp:Label></td><td><asp:RadioButtonList ID="rblRegister3" runat="server" RepeatDirection=Horizontal SelectedIndex='<%#Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem) , "RegisterableOffenseNum_3"))%>'> <asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem>
                                        </asp:RadioButtonList></td></tr><tr><td>
                            <asp:Label ID="Label34" runat="server" Text="Date of Occurrence"></asp:Label></td><td>
                                <asp:TextBox ID="txtDate3" runat="server" Text='<%# Bind("DateOfOccurrenceNum_3", "{0:d}") %>'></asp:TextBox></td><td>
                                    <asp:Label ID="Label35" runat="server" Text="Committing Court:"></asp:Label></td><td>
                                        <asp:TextBox ID="txtCourt3" runat="server" Text='<%# Bind("CommittingCourtNum_3") %>'></asp:TextBox></td></tr><tr><td>
                                    <asp:Label ID="Label36" runat="server" Text="Major Crime:"></asp:Label></td><td>
                                        <asp:RadioButtonList ID="rblMajor3" runat="server" RepeatDirection=Horizontal SelectedIndex='<%#Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem) , "MajorCrimeNum_3"))%>'> <asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem>
                                        </asp:RadioButtonList>
                                    </td><td>
                                            <asp:Label ID="Label37" runat="server" Text="Charge Classification:"></asp:Label></td><td>
                                                <asp:TextBox ID="txtClass3" runat="server" Text='<%# Bind("ChargeClassificationNum_3") %>'></asp:TextBox></td></tr><tr><td>
                                        <asp:Label ID="Label38" runat="server" Text="Felony:"></asp:Label></td><td><asp:RadioButtonList ID="rblFelony3" runat="server" RepeatDirection=Horizontal SelectedIndex='<%#Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem) , "FelonyNum_3"))%>'> <asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem>
                                        </asp:RadioButtonList></td><td>
                                                    <asp:Label ID="Label39" runat="server" Text="Code:"></asp:Label></td><td>
                                                        <asp:TextBox ID="txtCode3" runat="server" Text='<%# Bind("Code_Num3") %>'></asp:TextBox></td></tr><tr valign=top><td>
                                                            <asp:Label ID="Label40" runat="server" Text="Narrative Description:"></asp:Label></td><td colspan=3>
                                                                <asp:TextBox ID="txtNarrative3" runat="server" TextMode=MultiLine Width=500px MaxLength=1073741823
                                                                    Height="186px" Text='<%# Bind("NarrativeDescriptionNum_3") %>'></asp:TextBox></td></tr></table></ContentTemplate>
        </cc1:TabPanel>
    </cc1:TabContainer><asp:Button ID="btnUpdate" runat="server" Text="Update" CommandName="Update" />
                                                    <asp:Button ID="btnCancel" runat="server" Text="Cancel" CommandName="Cancel" /></EditItemTemplate><InsertItemTemplate><cc1:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0"
        Height="417px" Width="700px">
        <cc1:TabPanel runat="server" HeaderText="TabPanel1" ID="TabPanel1">
            <HeaderTemplate>
                General
            </HeaderTemplate>
            <ContentTemplate><table><tr><td>
                <asp:Label ID="Label1i" runat="server" Text="Current Facility:"></asp:Label></td><td>
                    <asp:DropDownList
                    ID="ddlCurrFacilityi" runat="server" Width="250px">
                    <asp:ListItem>Northwest Missouri Psychiatric Rehabilitation Center</asp:ListItem>
                            <asp:ListItem>Southeast Missouri Mental Health Center</asp:ListItem>
                            <asp:ListItem>St Louis Psychiatric Rehabilitation Center</asp:ListItem>
                            <asp:ListItem>Marshall Habilitation Center</asp:ListItem>
                            <asp:ListItem>Southeast Missouri Residential Services</asp:ListItem>
                            <asp:ListItem>Fulton State Hospital</asp:ListItem>
                </asp:DropDownList>
            </td><td>
                <asp:Label ID="Label41i" runat="server" Text="Substance Use At Time Of Crime:"></asp:Label></td><td>
                    <asp:RadioButtonList ID="rblSubstancei" runat="server" Height="22px"
                    RepeatDirection="Horizontal"
                        SelectedIndex='<%# Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem) , "SubstanceUseAtTimeOfCrime")) %>'> <asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem>
                </asp:RadioButtonList>
                </td></tr><tr><td>
                <asp:Label ID="Label2i" runat="server" Text="Current Program:"></asp:Label></td><td>
                        <asp:DropDownList
                    ID="ddlProgrami" runat="server" Width="250px">
                </asp:DropDownList>
            </td><td>
                <asp:Label ID="Label3i" runat="server" Text="Current Security Level:"></asp:Label></td><td>
                        <asp:DropDownList
                    ID="ddlSecurityLeveli" runat="server" Width="150px" Enabled=false>
                    <asp:ListItem>Maximum</asp:ListItem>
                            <asp:ListItem>Intermediate</asp:ListItem>
                            <asp:ListItem>Minimum</asp:ListItem>
                            <asp:ListItem>Campus</asp:ListItem>
                            <asp:ListItem>Unknown</asp:ListItem>
                </asp:DropDownList>
            </td></tr><tr><td>
                <asp:Label ID="Label4i" runat="server" Text="Current Residence Area:"></asp:Label></td><td>
                        <asp:DropDownList
                    ID="ddlAreai" runat="server" Width="250px">
                </asp:DropDownList>
            </td><td>
                <asp:Label ID="Label42i" runat="server" Text="Recent Predictive Behavior:"></asp:Label></td><td>
                        <asp:DropDownList
                    ID="ddlBehaviori" runat="server" Width="150px" DataSourceID="SqlDataSource3"
                            DataTextField="RiskRating" DataValueField="RiskRating" SelectedValue='<%# Bind("CurrentRiskRating") %>'>
                </asp:DropDownList>
            </td></tr></table></ContentTemplate>
        </cc1:TabPanel>
        <cc1:TabPanel ID="TabPanel2" runat="server" HeaderText="TabPanel2">
        <HeaderTemplate>Crime 1</HeaderTemplate>
        <ContentTemplate><table><tr><td class="style1">
            <asp:Label ID="Label5i" runat="server" Text="Index Crime 1:"></asp:Label></td>
            <td colspan=3><asp:DropDownList ID="ddlCrime1i" runat="server" Width="500px"
                    DataSourceID="SqlDataSource2" DataTextField="CHARGE"
                    DataValueField="CHARGE" SelectedValue='<%# Bind("IndexCrimeNum_1") %>' ></asp:DropDownList>
           
        </td></tr><tr><td>
            <asp:Label ID="Label43i" runat="server" Text="Adjudication Status:"></asp:Label></td><td>
                    <asp:DropDownList ID="ddlAdjudicationi" runat="server" Width="240px"
                    DataSourceID="SqlDataSource4" DataTextField="AdjudicationStatus"
                    DataValueField="AdjudicationStatus"
                        SelectedValue='<%# Bind("AdjudicationStatus") %>' ></asp:DropDownList></td><td>
                    <asp:Label ID="Label44i" runat="server" Text="Adjudication Date:"></asp:Label></td><td>
                        <asp:TextBox ID="txtAdjudDatei" runat="server" Text='<%# Bind("AdjudicationDate", "{0:d}") %>'></asp:TextBox></td></tr><tr><td class="style1"><asp:Label ID="Label6i" runat="server"
                    Text="Attempted Crime 1:" Height="22px"></asp:Label></td>
                <td><asp:RadioButtonList ID="rblAttempt1i" runat="server" Height="22px"
                    RepeatDirection="Horizontal"
                        SelectedIndex='<%# Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem) , "Attempted_Crime1")) %>'> <asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem>
                </asp:RadioButtonList>
                </td><td>
                    <asp:Label ID="Label13i" runat="server" Text="Sex Offense:"></asp:Label></td><td>
                    <asp:RadioButtonList ID="rblSex1i" runat="server" RepeatDirection=Horizontal
                        SelectedIndex='<%# Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem) , "SexOffense_Num1")) %>'> <asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem>
                                        </asp:RadioButtonList></td></tr><tr><td>
                    <asp:Label ID="Label7i" runat="server" Text="Associated Crimes"></asp:Label></td><td>
                        <asp:TextBox ID="txtAssocCrimes1i" runat="server" Text='<%# Bind("AssociatedCrimes_1") %>'></asp:TextBox></td><td>
                            <asp:Label ID="Label14i" runat="server" Text="Registerable Offense:"></asp:Label></td><td>
                    <asp:RadioButtonList ID="rblRegister1i" runat="server"
                        RepeatDirection=Horizontal
                        SelectedIndex='<%# Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem) , "RegisterableOffenseNum_1")) %>'> <asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem>
                                        </asp:RadioButtonList></td></tr><tr><td>
                            <asp:Label ID="Label8i" runat="server" Text="Date of Occurrence"></asp:Label></td><td>
                                <asp:TextBox ID="txtDateOccurrence1i" runat="server" Text='<%# Bind("DateOfOccurrence_1", "{0:d}") %>'></asp:TextBox></td><td>
                                    <asp:Label ID="Label15i" runat="server" Text="Committing Court:"></asp:Label></td><td>
                                        <asp:TextBox ID="txtCourt1i" runat="server" Text='<%# Bind("CommittingCourtNum_1") %>'></asp:TextBox></td></tr><tr><td>
                                    <asp:Label ID="Label9i" runat="server" Text="Major Crime:"></asp:Label></td><td>
                                        <asp:RadioButtonList ID="rblMajor1i" runat="server" RepeatDirection=Horizontal
                                            SelectedIndex='<%# Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem), "MajorCrimeNum_1")) %>'> <asp:ListItem Value="0">No</asp:ListItem>
                    <asp:ListItem Value="1">Yes</asp:ListItem>
                                        </asp:RadioButtonList>
                                    </td><td>
                                            <asp:Label ID="Label11i" runat="server" Text="Charge Classification:"></asp:Label></td><td>
                                                <asp:TextBox ID="txtClass1i" runat="server" Text='<%# Bind("ChargeClassificationNum_1") %>'></asp:TextBox></td></tr><tr><td>
                                        <asp:Label ID="Label10i" runat="server" Text="Felony:"></asp:Label></td><td>
                    <asp:RadioButtonList ID="rblFelony1i" runat="server" RepeatDirection=Horizontal
                        SelectedIndex='<%# Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem) , "FelonyNum_1")) %>'> <asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem>
                                        </asp:RadioButtonList></td><td>
                                                    <asp:Label ID="Label12i" runat="server" Text="Code:"></asp:Label></td><td>
                                                        <asp:TextBox ID="txtCode1i" runat="server" Text='<%# Bind("Code_Num1") %>'></asp:TextBox></td></tr><tr valign=top><td>
                                                            <asp:Label ID="Label16i" runat="server" Text="Narrative Description:"></asp:Label></td><td colspan=3>
                                                                <asp:TextBox ID="txtNarrative1i" runat="server" TextMode=MultiLine Width=500px MaxLength=1073741823
                                                                    Height="191px" Text='<%# Bind("NarrativeDescriptionNum_1") %>'></asp:TextBox></td></tr></table></ContentTemplate>
        </cc1:TabPanel>
        <cc1:TabPanel ID="TabPanel3" runat="server" HeaderText="TabPanel3">
        <HeaderTemplate>Crime 2</HeaderTemplate>
        <ContentTemplate><table><tr><td class="style1">
            <asp:Label ID="Label17i" runat="server" Text="Index Crime 2:"></asp:Label></td>
            <td colspan=3><asp:DropDownList ID="ddlCrime2i" runat="server" Width="500px"
                    DataSourceID="SqlDataSource2" DataTextField="CHARGE"
                    DataValueField="CHARGE" SelectedValue='<%# Bind("IndexCrimeNum_2") %>'></asp:DropDownList>
           
        </td></tr><tr><td>
            <asp:Label ID="Label45i" runat="server" Text="Adjudication Status:"></asp:Label></td><td>
                    <asp:DropDownList ID="DropDownList1i" runat="server" Width="240px"
                    DataSourceID="SqlDataSource4" DataTextField="AdjudicationStatus"
                    DataValueField="AdjudicationStatus"
                        SelectedValue='<%# Bind("AdjudicationStatusNum_2") %>' ></asp:DropDownList></td><td>
                    <asp:Label ID="Label46i" runat="server" Text="Adjudication Date:"></asp:Label></td><td>
                        <asp:TextBox ID="TextBox1i" runat="server" Text='<%# Bind("AdjudicationDateNum_2", "{0:d}") %>'></asp:TextBox></td></tr><tr><td class="style1"><asp:Label ID="Label18i" runat="server"
                    Text="Attempted Crime 2:" Height="22px"></asp:Label></td>
                <td><asp:RadioButtonList ID="rblAttempted2i" runat="server" Height="22px"
                    RepeatDirection="Horizontal" SelectedIndex='<%#Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem) , "Attempted_Crime2"))%>'> <asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem>
                </asp:RadioButtonList>
                </td><td>
                    <asp:Label ID="Label19i" runat="server" Text="Sex Offense:"></asp:Label></td><td><asp:RadioButtonList ID="rblSex2i" runat="server" RepeatDirection=Horizontal SelectedIndex='<%#Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem) , "SexOffense_Num2"))%>'> <asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem>
                                        </asp:RadioButtonList></td></tr><tr><td>
                    <asp:Label ID="Label20i" runat="server" Text="Associated Crimes"></asp:Label></td><td>
                        <asp:TextBox ID="txtAssocCrime2i" runat="server" Text='<%# Bind("AssociatedCrimesNum_2") %>'></asp:TextBox></td><td>
                            <asp:Label ID="Label21i" runat="server" Text="Registerable Offense:"></asp:Label></td><td><asp:RadioButtonList ID="rblRegister2i" runat="server" RepeatDirection=Horizontal SelectedIndex='<%#Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem) , "RegisterableOffenseNum_2"))%>'> <asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem>
                                        </asp:RadioButtonList></td></tr><tr><td>
                            <asp:Label ID="Label22i" runat="server" Text="Date of Occurrence"></asp:Label></td><td>
                                <asp:TextBox ID="txtDateOccur2i" runat="server" Text='<%# Bind("DateOfOccurrenceNum_2", "{0:d}") %>'></asp:TextBox></td><td>
                                    <asp:Label ID="Label23i" runat="server" Text="Committing Court:"></asp:Label></td><td>
                                        <asp:TextBox ID="txtCourt2i" runat="server" Text='<%# Bind("CommittingCourtNum_2") %>'></asp:TextBox></td></tr><tr><td>
                                    <asp:Label ID="Label24i" runat="server" Text="Major Crime:"></asp:Label></td><td>
                                        <asp:RadioButtonList ID="rblMajor2i" runat="server" RepeatDirection=Horizontal SelectedIndex='<%#Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem) , "MajorCrimeNum_2"))%>'> <asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem>
                                        </asp:RadioButtonList>
                                    </td><td>
                                            <asp:Label ID="Label25i" runat="server" Text="Charge Classification:"></asp:Label></td><td>
                                                <asp:TextBox ID="txtClass2i" runat="server" Text='<%# Bind("ChargeClassificationNum_2") %>'></asp:TextBox></td></tr><tr><td>
                                        <asp:Label ID="Label26i" runat="server" Text="Felony:"></asp:Label></td><td><asp:RadioButtonList ID="rblFelony2i" runat="server" RepeatDirection=Horizontal SelectedIndex='<%#Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem) , "FelonyNum_2"))%>'> <asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem>
                                        </asp:RadioButtonList></td><td>
                                                    <asp:Label ID="Label27i" runat="server" Text="Code:"></asp:Label></td><td>
                                                        <asp:TextBox ID="txtCode2i" runat="server" Text='<%# Bind("Code_Num2") %>'></asp:TextBox></td></tr><tr valign=top><td>
                                                            <asp:Label ID="Label28i" runat="server" Text="Narrative Description:"></asp:Label></td><td colspan=3>
                                                                <asp:TextBox ID="txtNarrative2i" runat="server" TextMode=MultiLine Width=500px MaxLength=1073741823
                                                                    Height="193px" Text='<%# Bind("NarrativeDescriptionNum_2") %>'></asp:TextBox></td></tr></table></ContentTemplate>
        </cc1:TabPanel>
        <cc1:TabPanel ID="TabPanel4" runat="server" HeaderText="TabPanel4">
        <HeaderTemplate>Crime 3</HeaderTemplate>
        <ContentTemplate><table><tr><td class="style1">
            <asp:Label ID="Label29i" runat="server" Text="Index Crime 3:"></asp:Label></td>
            <td colspan=3><asp:DropDownList ID="ddlCrime3i" runat="server" Width="500px"
                    DataSourceID="SqlDataSource2" DataTextField="CHARGE"
                    DataValueField="CHARGE" SelectedValue='<%# Bind("IndexCrimeNum_3") %>'></asp:DropDownList>
           
        </td></tr><tr><td>
            <asp:Label ID="Label47i" runat="server" Text="Adjudication Status:"></asp:Label></td><td>
                    <asp:DropDownList ID="DropDownList2i" runat="server" Width="240px"
                    DataSourceID="SqlDataSource4" DataTextField="AdjudicationStatus"
                    DataValueField="AdjudicationStatus"
                        SelectedValue='<%# Bind("AdjudicationStatusNum_3") %>' ></asp:DropDownList></td><td>
                    <asp:Label ID="Label48i" runat="server" Text="Adjudication Date:"></asp:Label></td><td>
                        <asp:TextBox ID="TextBox2i" runat="server" Text='<%# Bind("AdjudicationDateNum_3", "{0:d}") %>'></asp:TextBox></td></tr><tr><td class="style1"><asp:Label ID="Label30i" runat="server"
                    Text="Attempted Crime 3:" Height="22px"></asp:Label></td>
                <td><asp:RadioButtonList ID="rblAttempted3i" runat="server" Height="22px"
                    RepeatDirection="Horizontal" SelectedIndex='<%#Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem) , "Attempted_Crime3"))%>'> <asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem>
                </asp:RadioButtonList>
                </td><td>
                    <asp:Label ID="Label31i" runat="server" Text="Sex Offense:"></asp:Label></td><td><asp:RadioButtonList ID="rblSex3i" runat="server" RepeatDirection=Horizontal SelectedIndex='<%#Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem) , "SexOffense_Num3"))%>'> <asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem>
                                        </asp:RadioButtonList></td></tr><tr><td>
                    <asp:Label ID="Label32i" runat="server" Text="Associated Crimes"></asp:Label></td><td>
                        <asp:TextBox ID="txtAssocCrime3i" runat="server" Text='<%# Bind("AssociatedCrimesNum_3") %>'></asp:TextBox></td><td>
                            <asp:Label ID="Label33i" runat="server" Text="Registerable Offense:"></asp:Label></td><td><asp:RadioButtonList ID="rblRegister3i" runat="server" RepeatDirection=Horizontal SelectedIndex='<%#Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem) , "RegisterableOffenseNum_3"))%>'> <asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem>
                                        </asp:RadioButtonList></td></tr><tr><td>
                            <asp:Label ID="Label34i" runat="server" Text="Date of Occurrence"></asp:Label></td><td>
                                <asp:TextBox ID="txtDate3i" runat="server" Text='<%# Bind("DateOfOccurrenceNum_3", "{0:d}") %>'></asp:TextBox></td><td>
                                    <asp:Label ID="Label35i" runat="server" Text="Committing Court:"></asp:Label></td><td>
                                        <asp:TextBox ID="txtCourt3i" runat="server" Text='<%# Bind("CommittingCourtNum_3") %>'></asp:TextBox></td></tr><tr><td>
                                    <asp:Label ID="Label36i" runat="server" Text="Major Crime:"></asp:Label></td><td>
                                        <asp:RadioButtonList ID="rblMajor3i" runat="server" RepeatDirection=Horizontal SelectedIndex='<%#Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem) , "MajorCrimeNum_3"))%>'> <asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem>
                                        </asp:RadioButtonList>
                                    </td><td>
                                            <asp:Label ID="Label37i" runat="server" Text="Charge Classification:"></asp:Label></td><td>
                                                <asp:TextBox ID="txtClass3i" runat="server" Text='<%# Bind("ChargeClassificationNum_3") %>'></asp:TextBox></td></tr><tr><td>
                                        <asp:Label ID="Label38i" runat="server" Text="Felony:"></asp:Label></td><td><asp:RadioButtonList ID="rblFelony3i" runat="server" RepeatDirection=Horizontal SelectedIndex='<%#Convert.ToInt32(DataBinder.Eval(((DataRowView)FormView1.DataItem) , "FelonyNum_3"))%>'> <asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem>
                                        </asp:RadioButtonList></td><td>
                                                    <asp:Label ID="Label39i" runat="server" Text="Code:"></asp:Label></td><td>
                                                        <asp:TextBox ID="txtCode3i" runat="server" Text='<%# Bind("Code_Num3") %>'></asp:TextBox></td></tr><tr valign=top><td>
                                                            <asp:Label ID="Label40i" runat="server" Text="Narrative Description:"></asp:Label></td><td colspan=3>
                                                                <asp:TextBox ID="txtNarrative3i" runat="server" TextMode=MultiLine Width=500px MaxLength=1073741823
                                                                    Height="186px" Text='<%# Bind("NarrativeDescriptionNum_3") %>'></asp:TextBox></td></tr></table></ContentTemplate>
        </cc1:TabPanel>
    </cc1:TabContainer><asp:Button ID="btnInsert" runat="server" Text="Insert" CommandName="Insert" />
                                                    <asp:Button ID="btnCanceli" runat="server" Text="Cancel" CommandName="Cancel" /></InsertItemTemplate>
    </asp:FormView>
ASKER CERTIFIED SOLUTION
Avatar of Robb Hill
Robb HillFlag of United States of America imageSenior .Net Full Stack Developer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answers