Wednesday, March 24, 2010

How to pupulate web user control inside gridview

Grid view with user control

asp:GridView ID="grdItems" runat="server" AutoGenerateColumns="False" CellPadding="0"
                            ShowHeader="False" GridLines="None">
                            Columns>
                                asp:TemplateField>
                                    ItemTemplate>
                                        uc2:Qa_Test2 ID="Qa_Test3" runat="server" VenderName='%# Eval("VenderName") %>'
                                            VenderNo='%# Eval("VenderNo") %>' SkuNumber='%# Eval("SkuNumber") %>' ItemName='%# Eval("ItemName") %>'
                                            ParentName='%# Eval("ParentItem") %>' ParentNo='%# Eval("ParentSkuNum") %>'
                                            Source='%# Eval("Source") %>' ProfiledDate='%# Eval("Profiled") %>' TDFIssued='%# Eval("TDFIssued") %>'
                                            ReqIssuedVr='%# Eval("ReqIssuedVR") %>' ReqIssuedQa='%# Eval("ReqIssuedQA") %>'
                                            SentToLab='%# Eval("SentLab") %>' TestsCompleted='%# Eval("Completed") %>'
                                            ComponentHeading='%# Eval("ItemType") %>' OutSideUsTest='%# Eval("OutSideUsTest") %>'
                                            ShowOtherFormButtons="%# ShowOtherFormBtnAtQaTestLevel %>" QuoteApproved='%#Eval("QuoteApproved") %>'
                                            QuoteReceived='%#Eval("QuoteReceived") %>' IntendUser='%# Eval("IntendUser") %>'
                                            ItemPhotograph='%# Eval("ItemPhotographed") %>' NoProfileReason='%# Eval("NoProfileReason") %>'
                                            InvoiceApprove='%# Eval("InvoiceApproved") %>' InvoiceReceived='%# Eval("InvoiceReceived") %>' Comments='%# Eval("Comments") %>'/>
                                    /ItemTemplate>
                                /asp:TemplateField>
                            /Columns>
                        /asp:GridView>

*****Important

You are setting a property value using a databinding expression.
As such, the property will get set in the user control during the databinding event. If your code is trying to consume the data during the Page_Load event of your control it will not work as the Page Load fires before the Databinding event.
If this is the case you could create a separate method in your control's code an call it from the RowDataBound event of your GridView.

Bind data to gridview

 grdItems.DataSource = BusItem.LowestItemsIdLakeshore(ItemName, Oset, Source);
            grdItems.DataBind();

Grid View row databound event


protected void grdItems_RowDataBound(object sender, GridViewRowEventArgs e)
    {
       
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            controls_Qa_Test1 ctl = (controls_Qa_Test1)e.Row.FindControl("Qa_Test3");
            ctl.BindToVariable();       
            if (ctl != null)
            {
                ctl.ShowParent();

            }
        }
    }



User control

%@ Control Language="C#" AutoEventWireup="true" CodeFile="Qa_Test.ascx.cs" Inherits="controls_Qa_Test" %>
table border="0" cellpadding="0" cellspacing="0" class="labelTable" width="956" >
    tr>
        td>/td>
        td class="label subtitle" visible="false" id="compHeading" runat="server">
            parent:
        /td>
        td id="subTitle" class="labelInfo subtitle" runat="server">
            732BE • SET OF 3 BUTTERFLY ERASERS
        /td>
        td colspan="2" style="width: 478px; text-align: right;">
            div style="float: left; margin-left: 15px;">
                asp:CheckBox ID="chkItmPhoto" runat="server" Text="item photographed" />/div>
            %-- b>outside U.S.:/b>input type="radio" name="export" id="optOutSideUsTest" runat="server" value="true"
                    style="vertical-align: middle;" onclick='outSideUsTests(true);'>Y
                input type="radio" name="exportNo" id="optOutSideUsTest1" value="false" style="vertical-align: middle;" runat="server" onclick='outSideUsTests(false);'>N--%>
            b>outside U.S.:/b>asp:RadioButton ID="opt0" GroupName="outSideUsTest" runat="server"
                Text="Y" />
            asp:RadioButton ID="opt1" GroupName="outSideUsTest" runat="server" Text="N" />
        /td>
    /tr>
    tr runat="server" visible="false" id="parentRow">
        td>/td>
        td class="label subtitle" visible="false" id="ParentHeadings">
            component:
        /td>
        td id="parentTd" class="labelInfo subtitle" runat="server">
            732BE • SET OF 3 BUTTERFLY ERASERS
        /td>
        td>
        /td>
        td>
        /td>
    /tr>
    tr runat="server" id="venderRow">
        td class="label">
            vendor:
        /td>
        td class="labelInfo" runat="server" id="venderName">
            venderName Here
        /td>
        td class="label">
            vendor #:
        /td>
        td class="labelInfo" runat="server" id="venderNo">
            Vender No Here
        /td>
    /tr>
    tr>
     td class="label">
        /td>
      td  runat="server" id="VendComments" style="color:Green; width:920;"   colspan="3" >
         
      /td>
    /tr>
    tr runat="server" id="venderHr">
        td colspan="4">
            hr />
        /td>
    /tr>
    tr>
        td class="label">
            tested age:
        /td>
        td class="labelInfo">
            asp:DropDownList runat="server" ID="ddlTestedAge"   DataSourceID="ageGradData" DataTextField="agerangetext"
                DataValueField="id" AppendDataBoundItems="true">
                asp:ListItem Value="">select tested age/asp:ListItem>
            /asp:DropDownList>
            b>+/b>
        /td>
        td class="label">
            labeled age:
        /td>
        td class="labelInfo">
            asp:DropDownList runat="server" ID="ddlAge" DataSourceID="ageGradData" DataTextField="agerangetext"
                DataValueField="id" AppendDataBoundItems="true">
                asp:ListItem Value="">select labeled age/asp:ListItem>
            /asp:DropDownList>
            b>+/b>
            asp:SqlDataSource ID="ageGradData" runat="server" ConnectionString="%$ ConnectionStrings:lena %>"
                SelectCommand=" SELECT id,agerangetext FROM lakeshore.dbo.age_range where Convert(FLOAT,agerangevalue) =10 order by Convert(FLOAT,agerangevalue) ">
            /asp:SqlDataSource>
        /td>
    /tr>
    tr>
        td colspan="4">
            hr />
        /td>
    /tr>
    tr>
        td class="label">
            no profile:
        /td>
        td colspan="3">
            asp:DropDownList ID="ddlNoProfile" runat="server" DataSourceID="sdaGetReason" DataTextField="reason_desc"
                DataValueField="reason_id" AppendDataBoundItems="true">
                asp:ListItem Value="">select no profile reason/asp:ListItem>
            /asp:DropDownList>
            asp:SqlDataSource ID="sdaGetReason" runat="server" ConnectionString="%$ ConnectionStrings:lena %>"
                SelectCommand="SELECT  reason_id,[reason_desc] FROM [qa_no_profile_reason] with (nolock) ">
            /asp:SqlDataSource>
        /td>
    /tr>
    tr>
        td colspan="4">
            hr />
        /td>
    /tr>
    asp:Panel ID="pnRDWL" runat="server">
    tr>
        td>/td>
        td colspan="3">
            a href = "javascript:void(0)" onclick = "RDWarnings('0', this, '%=ClientID %>')" id = "%=ClientID %>show">show RD warning labels/a>
            a href = "javascript:void(0)" onclick = "RDWarnings('1', this, '%=ClientID %>')" id = "%=ClientID %>hide" style="display: none">hide RD warning labels/a>
     
 div id = "%=ClientID %>rdwarningsDiv" style="display:none">
   
 
            asp:Label ID="lblRDWL" runat="server">/asp:Label>
    /div>
        /td>
    /tr>
  /asp:Panel>
    tr>
        td class="label">
            warning labels:
        /td>
        td class="labelInfo" colspan="2">
            asp:CheckBoxList ID="chkWarnings" runat="server" RepeatColumns="4" RepeatDirection="Horizontal"
                Width="382px" OnDataBound="chkWarnings_DataBound">
            /asp:CheckBoxList>br />
             a href="javascript:void(0)" onclick="OtherWarnings('0',this,'%= ClientID%>')" id="%= ClientID%>act1" style="display: none">hide other warning labels:/a>

            a href="javascript:void(1)" onclick="OtherWarnings('1',this,'%= ClientID%>')" id="%= ClientID%>act0" >show other warning labels:/a>
            div id="%= ClientID%>otherwrngsDiv" style="display: none">
                asp:CheckBoxList ID="chkOtherWarnings" runat="server" RepeatColumns="4" RepeatDirection="Horizontal"
                    Width="540px" OnDataBound="chkWarnings_DataBound">
                /asp:CheckBoxList>
            /div>
        /td>
        td>
        table border="0" cellpadding="0" cellspacing="0">
           tr>
                td class="label">
                    Warning Comments:
                   br />
                    asp:Label ID="lblCommentError" runat="server" Text="" EnableViewState="false" ForeColor="red">/asp:Label>
                /td>
                td colspan="3">
                    asp:DropDownList ID="ddlWarningComments" runat="server" DataTextField="comment_name"
                        DataValueField="warninglabel_comment_id" >
                    /asp:DropDownList>
                   div>
                       asp:TextBox ID="tbxTbxWarningComment" runat="server" Columns="50" TextMode="MultiLine" Height="70px">/asp:TextBox>
                   /div>
                /td>
            /tr>
            /table>
        /td>
    /tr>
    tr>
        td colspan="4">
            div id="%= ClientID%>cbxWarningDescription" style="position: absolute; padding: 10px 10px 10px 10px;
                background-color: White; display: none; text-align: left; width: 300px; height: 100px;
                overflow: visible; border: solid 1px blue;">
            /div>
        /td>
    /tr>
    tr>
        td colspan="4">
            hr />
        /td>
    /tr>
    tr>
        td class="label">
            Intended use:
        /td>
        td colspan="3">
            asp:RadioButtonList ID="lstIntendUsers" runat="server" DataTextField="intended_user_name"
                DataValueField="intended_user_id" RepeatColumns="3" RepeatDirection="Horizontal"
                Width="860px">
            /asp:RadioButtonList>
        /td>
    /tr>
    tr>
        td class="label">Comment:/td>
        td colspan="3">
       
         asp:TextBox runat="server" ID="txtComment" TextMode="MultiLine" Columns="170" Rows="5">/asp:TextBox>
           
        /td>
    /tr>
    tr id="Tr1">
        td colspan="4">
            hr />
        /td>
    /tr>
    tbody id="allTestCats" runat="server">
        tr runat="server" id="catsRow">
            td class="label">
                category:
            /td>
            td colspan="3">
                asp:CheckBoxList ID="chkCatalog" runat="server" EnableViewState="true" RepeatColumns="5"
                    Width="860px" RepeatDirection="Horizontal" OnDataBound="chkCatalog_DataBound">
                /asp:CheckBoxList>
            /td>
        /tr>
        tr runat="server" id="catsHr">
            td colspan="4" style="height: 24px">
                hr />
            /td>
        /tr>
          tr>
        td class="label">Who to test:/td>
        td>
        asp:DropDownList ID="ddWhoToTest" AppendDataBoundItems="true" runat="server">
       asp:ListItem Text="Please Select" Value="-1">/asp:ListItem>
        /asp:DropDownList>
        /td>
        /tr>
        tr>
            td class="label">
                US tests:
            /td>
            td colspan="3">
                asp:CheckBoxList ID="chkUsTests" runat="server" EnableViewState="true" RepeatColumns="3"
                    Width="860px" RepeatDirection="Horizontal" OnDataBound="chkUsTests_DataBound">
                /asp:CheckBoxList>
            /td>
        /tr>
        tr>
            td class="label">
                outside U.S. tests:
            /td>
            td colspan="3">
                asp:CheckBoxList ID="chkExportTests" runat="server" RepeatColumns="3" EnableViewState="true"
                    Width="860px" RepeatDirection="Horizontal" OnDataBound="chkExportTests_DataBound">
                /asp:CheckBoxList>
            /td>
        /tr>
        tr>
            td colspan="4" style="height: 24px">
                hr />
            /td>
        /tr>
        tr>
            td class="label">
                additional tests:
            /td>
            td colspan="3">
                asp:CheckBoxList ID="chkAdditionalTestsSelected" runat="server" RepeatColumns="3"
                    RepeatDirection="Horizontal" Width="860px" OnDataBound="chkAdditionalTestsSelected_DataBound">
                /asp:CheckBoxList>
                div id="%= ClientID%>showTestsLink" style="display: block">
                    a href="javascript:void(0);" onclick="javascript:showItems('%= ClientID%>');">font
                        color="#003399">show additional tests/font>/a>asp:Label ID="lbAdditionalTestInfo"
                            runat="server">/asp:Label>/div>
                div id="%= ClientID%>additionalTests" style="display: none;">
                    div>
                        a href="javascript:hideItems('%= ClientID%>');">font color="#003399">hide additional
                            tests/font>/a>/div>
                    asp:CheckBoxList ID="chkAdditionalTests" runat="server" RepeatColumns="3" RepeatDirection="Horizontal"
                        Width="860px" OnDataBound="chkAdditionalTests_DataBound">
                    /asp:CheckBoxList>
                /div>
            /td>
        /tr>
        tr>
            td colspan="4">
                hr style="margin-top: 12px;" />
            /td>
        /tr>
    /tbody>
    tr>
        td class="label">
            status:
        /td>
        td colspan="3">
            table width="860" cellpadding="0" cellspacing="0" border="0">
                tr>
                    td style="text-align: right; padding-right: 4px;">
                        profiled:
                    /td>
                    td runat="server" id="profileDate" style="width: 65px;">
                    /td>
                    td style="text-align: right; padding-right: 4px;">
                        req issued - VR/PP/RD:
                    /td>
                    td runat="server" id="reqIssuedVr" style="width: 65px;">
                    /td>
                    td style="text-align: right; padding-right: 4px;">
                        quote received:
                    /td>
                    td runat="server" id="qouteRecived" style="width: 65px;">
                    /td>
                    td style="text-align: right; padding-right: 4px;">
                        Invoice received:
                    /td>
                    td runat="server" id="InvoiceRecived" style="width: 70px;">
                    /td>
                    td style="text-align: right; padding-right: 4px;">
                        sent to lab:
                    /td>
                    td runat="server" id="sentToLab" style="width: 65px;">
                    /td>
                /tr>
                tr>
                    td style="text-align: right; padding-right: 4px;">
                        TDF issued:
                    /td>
                    td runat="server" id="TDFDate" style="width: 65px;">
                  
                    /td>
                    td style="text-align: right; padding-right: 4px;">
                        req issued - QA:
                    /td>
                    td runat="server" id="reqIssuedQa" style="width: 65px;">
                    /td>
                    td style="text-align: right; padding-right: 4px;">
                        quote approved:
                    /td>
                    td runat="server" id="qouteApproved" style="width: 65px;">
                    /td>
                    td style="text-align: right; padding-right: 4px;">
                        Invoice approved:
                    /td>
                    td runat="server" id="InvoiceApproved" style="width: 65px;">
                    /td>
                    td style="text-align: right; padding-right: 4px;">
                        tests completed:
                    /td>
                    td runat="server" id="testsCompleted" style="width: 65px;">
                    /td>
                /tr>
            /table>
        /td>
    /tr>
    tr>
        td colspan="4">
            hr />
        /td>
    /tr>
    tr>
        td colspan="4">
            div id="testButtons" class="wrapper" runat="server">
                a class="button" href="javascript:void(0);" onclick="SaveAll();">span>save/span>/a>
                div id="%= ClientID%>FormButtons" name="FormButtons" style="display: %= string.IsNullOrEmpty(ProfiledDate)?"none":"block"%>;">
                    a class="button" href="tdf.aspx?item=%=SkuNumber%>">span>test documentation form/span>/a>
                    a class="button" href="RequisitionForm.aspx?item=%=SkuNumber%>">span>issue requisition/span>/a>
                    %--a class="button" href="ViewCoverLetters.aspx?item=%=SkuNumber%>">span>view requisition/span>/a>--%>
                /div>
                br />
                br />
                div id="divIsetFormButtons" runat="server" visible="false">
                    div id="%= ClientID%>FormButtons1" name="FormButtons" style="display: %= string.IsNullOrEmpty(ProfiledDate)?"none":"block"%>;">
                       %-- a class="button" href="tdf.aspx?item=%=SkuNumber%>">span>test documentation form
                            - all items/span>/a> a class="button" href="testreq.aspx?item=%=SkuNumber%>">span>
                                issue requisition - all items/span>/a>--%>
                    /div>
                /div>
            /div>
        /td>
    /tr>
/table>

User control data handling method


 public void BindToVariable()
    {

     
                if (Session["sku_number"] != null)
                    System.Diagnostics.Debug.WriteLine(Session["sku_number"].ToString());
                Session["compJP"] = null;
                BindWhoToTestCombo();
                ds = BusQaProfile.GetItemCategory(SkuNumber);

                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    tests.Add(dr[0].ToString(), "");
                }
                if (selectedTests == null)
                {
                    selectedTests = BusQaProfile.GetUsTests(SkuNumber);
                }
                if (selectedTests.Tables[0].Rows.Count > 0)
                    IsFromDataBase = true;

                DataTable dt = new DataTable();
                dt = Tests.Tables[0].Copy();

                DataView dvu = dt.DefaultView;
                dvu.RowFilter = "us_test='Y'";

                dvu.Sort = "sort_num";
                //UsTests = dv;
                chkUsTests.DataSource = dvu;
                chkUsTests.DataTextField = "test_name";
                chkUsTests.DataValueField = "test_name_id";
                chkUsTests.DataBind();


                DataTable dte = new DataTable();
                dte = Tests.Tables[0].Copy();
                DataView dve = dte.DefaultView;
                dve.RowFilter = "export_test='Y'";
                // UsTests = dv;
                chkExportTests.DataSource = dve;
                chkExportTests.DataTextField = "test_name";
                chkExportTests.DataValueField = "test_name_id";
                chkExportTests.DataBind();

                DataTable dta = new DataTable();
                dta = Tests.Tables[0].Copy();
                DataView dva = dta.DefaultView;
                dva.RowFilter = "addition_test='Y'";
                // UsTests = dv;
                chkAdditionalTests.DataSource = dva;
                chkAdditionalTests.DataTextField = "test_name";
                chkAdditionalTests.DataValueField = "test_name_id";
                chkAdditionalTests.DataBind();


                SetTestByCats(chkUsTests);
                SetTestByCats(chkExportTests);
                SetTestByCats(chkAdditionalTests);

                chkCatalog.DataSource = ds;
                chkCatalog.DataTextField = "category_name";
                chkCatalog.DataValueField = "category_id";

                string strRDWL = @"select case when isnull(Copy_Request_SPW_Flag, '') <> '' then Copy_Request_SPW_Flag + ',' else '' end + case when isnull(Copy_Request_Adult_Assembly_Needed, '') <> '' then Copy_Request_Adult_Assembly_Needed + ',' else '' end + case when isnull(Copy_Request_Foam_Choking_Warning, '') <> '' then Copy_Request_Foam_Choking_Warning + ',' else '' end as rdwl from ella_complete..v_full_ella_record where item_rd_number = '" + SkuNumber + "' and (isnull(Copy_Request_SPW_Flag,'') > '' or isnull(Copy_Request_Adult_Assembly_Needed,'') > '' or isnull(Copy_Request_Foam_Choking_Warning,'') > '')";
                DataSet tmpRDWLDs = BusQaProfile.RunSQLString(strRDWL);
                if (tmpRDWLDs != null && tmpRDWLDs.Tables.Count > 0 && tmpRDWLDs.Tables[0].Rows.Count > 0)
                {
                    DataRow aRDWLRow = tmpRDWLDs.Tables[0].Rows[0];
                    lblRDWL.Text = aRDWLRow["rdwl"].ToString().Substring(0, aRDWLRow["rdwl"].ToString().Length - 1);
                }
                else
                {
                    pnRDWL.Visible = false;
                }

                chkCatalog.DataBind();
                otherWrngData = BusQaProfile.GetWarnings(SkuNumber);
                DataTable otherWrngt = new DataTable();
                otherWrngt = otherWrngData.Tables[0].Copy();
                DataView otherWrng = otherWrngt.DefaultView;//.RunSQLString("Select label_id,label_name,Isnull(is_main,'N')is_main from qa_warning_labels order by label_id").Tables[0].DefaultView;
                otherWrng.RowFilter = "is_main='y' or is_main='Y'";
                chkWarnings.DataSource = otherWrng;//BusQaProfile.RunSQLString("Select label_id,label_name from qa_warning_labels order by label_id");
                chkWarnings.DataTextField = "label_name";
                chkWarnings.DataValueField = "label_id";
                chkWarnings.DataBind();

                DataTable otherWrngs = new DataTable();
                otherWrngs = otherWrngData.Tables[0].Copy();
                DataView OtherWarnings = otherWrngs.DefaultView;


                OtherWarnings.RowFilter = "is_main<>'y' or is_main<>'Y'";

                chkOtherWarnings.DataSource = OtherWarnings;
                chkOtherWarnings.DataTextField = "label_name";
                chkOtherWarnings.DataValueField = "label_id";
                chkOtherWarnings.DataBind();



                //Get warning label comments
                string sqlWarningCommentBind = " SELECT [warninglabel_comment_id],[comment_name] FROM [qa_warninglabel_comment_list] with (nolock) order by comment_name ";

                DataSet tmpWarningCommentBindDs = BusQaProfile.RunSQLString(sqlWarningCommentBind);
                ddlWarningComments.DataSource = tmpWarningCommentBindDs;
                ddlWarningComments.DataBind();
                ddlWarningComments.Items.Insert(0, new ListItem("select comment", "-1"));


                string sqlWarningLabelComments4 = " SELECT top 1 isnull(warninglabel_comment_id,-1) as warninglabel_comment_id, isnull(comments,'') as comments  FROM qa_warninglabel_comments with (nolock) where sku_number = '" + SkuNumber + "' order by create_date desc";
                DataSet tmpWarningCommentDs = BusQaProfile.RunSQLString(sqlWarningLabelComments4);
                if (tmpWarningCommentDs != null && tmpWarningCommentDs.Tables.Count > 0 && tmpWarningCommentDs.Tables[0].Rows.Count > 0)
                {
                    DataRow aNewCommentRow = tmpWarningCommentDs.Tables[0].Rows[0];
                    int tmpCommentId = int.Parse(aNewCommentRow["warninglabel_comment_id"].ToString());
                    string tmpComment = (string)(aNewCommentRow["comments"]);
                    ListItem aFoundItem = ddlWarningComments.Items.FindByValue(tmpCommentId.ToString());
                    if (aFoundItem != null)
                    {
                        aFoundItem.Selected = true;
                    }
                    tbxTbxWarningComment.Text = tmpComment;
                }

                DataSet pComment = BusQaProfile.GetProfileComment(SkuNumber);
                if (pComment != null && pComment.Tables.Count > 0 && pComment.Tables[0].Rows.Count > 0)
                {
                    DataRow rpComment = pComment.Tables[0].Rows[0];
                    txtComment.Text = rpComment["comment"].ToString();
                }

                DataSet extraStatus = BusQaProfile.GetExtraStatusFields(SkuNumber);
                if (extraStatus.Tables[0].Rows.Count > 0)
                {
                    DataRow dr = extraStatus.Tables[0].Rows[0];
                    if (dr["tested_age_range_id"] != null)
                        ddlTestedAge.SelectedValue = dr["tested_age_range_id"].ToString();
                    if (dr["labeled_age_range_id"] != null)
                        ddlAge.SelectedValue = dr["labeled_age_range_id"].ToString();

                    if (dr["who_to_test_id"] != null)
                    {
                        ListItem li = ddWhoToTest.Items.FindByValue(dr["who_to_test_id"].ToString());
                        ////ddWhoToTest.ClearSelection();
                        if (li != null)
                        {
                            ddWhoToTest.SelectedValue = dr["who_to_test_id"].ToString();
                        }

                        //  ddWhoToTest.SelectedValue = dr["who_to_test_id"].ToString();
                    }
                }
                ddlNoProfile.Attributes.Add("onchange", string.Format("javascript:noProfile(this,'{0}')", allTestCats.ClientID));

                ddlWarningComments.Attributes.Add("onchange", string.Format("javascript:" + this.ClientID + "warningCommentTbxChged('{0}','{1}','{2}')", tbxTbxWarningComment.ClientID, ddlWarningComments.ClientID, lblCommentError.ClientID));

                tbxTbxWarningComment.Attributes.Add("onkeypress", string.Format("javascript:" + this.ClientID + "warningCommentTbxChged('{0}','{1}','{2}')", tbxTbxWarningComment.ClientID, ddlWarningComments.ClientID, lblCommentError.ClientID));

                tbxTbxWarningComment.Attributes.Add("onblur", string.Format("javascript:" + this.ClientID + "warningCommentTbxChged('{0}','{1}','{2}')", tbxTbxWarningComment.ClientID, ddlWarningComments.ClientID, lblCommentError.ClientID));

                tbxTbxWarningComment.Attributes.Add("onFocus", "javascript:this.select()");


                lstIntendUsers.DataSource = IntendUsersList;
                lstIntendUsers.DataBind();
                if (!string.IsNullOrEmpty(selectedIntendUser))
                {
                    try { lstIntendUsers.SelectedValue = selectedIntendUser; }
                    catch { }
                }
                if (ParentItem)
                {
                    opt0.Attributes.Add("onclick", "outSideUsTests('" + chkExportTests.ClientID + "',true);");
                    opt1.Attributes.Add("onclick", "outSideUsTests('" + chkExportTests.ClientID + "',false);");
                }
                else
                {
                    opt0.Attributes.Add("onclick", "checkoutSideUsTests('" + chkExportTests.ClientID + "',true)");
                    opt1.Attributes.Add("onclick", "checkoutSideUsTests('" + chkExportTests.ClientID + "',false)");
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "scriptYesNo" + ClientID, string.Format("\r\nyesBtns= yesBtns+( yesBtns==''?'':'|')+'{0}';noBtns=noBtns+ (noBtns==''?'':'|')+'{1}';", new string[] { opt0.ClientID, opt1.ClientID }), true);
                }

                //added: 2/18/2008
                this.divIsetFormButtons.Visible = (StructureId == 3);//for iset show this div
                if (!string.IsNullOrEmpty(NoProfileReason))
                    allTestCats.Style.Add(HtmlTextWriterStyle.Display, "none");
 
    }

1 comment:

  1. Hi,There are so many versions on the market that vary in complexity with Web Design Cochin from extremely technical to basic WYSIWYG-type software (i.e. What-You-See-Is-What-You-Get, meaning it's more of a drag-and-drop product requiring very little to no programming knowledge).Thanks....

    ReplyDelete