<cc1:OGridView ID="grdGlobalContact" runat="server" AllowSorting="True" 
                                AutoGenerateColumns="False" BorderWidth="0px" CellPadding="0" CellSpacing="1" 
                                CssClass="gridtable1" DataKeyNames="GlobalContactID" GridLines="None" 
                                OnRowDataBound="grdGlobalContact_RowDataBound" 
                                OnRowDeleting="grdGlobalContact_RowDeleting" 
                                OnRowEditing="grdGlobalContact_RowEditing" OnSorting="grdGlobalContact_Sorting" 
                                Width="100%">
                                <Columns>
                                    <asp:TemplateField>
                                        <itemstyle CssClass="GridPadding" width="20px" />
                                        <ItemTemplate>
                                                <cc1:OImageButton ID="imgEdit" runat="server" 
                                                    CommandArgument='<%# Eval("GlobalContactID") %>' CommandName="Edit" 
                                                    ImageUrl="~/images/editicon.gif" Tooltip="Edit" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="GlobalContact ID" Visible="False">
                                        <itemstyle CssClass="GridPadding" />
                                        <itemtemplate>
                                            <cc1:OLabel ID="lblGlobalContactID" runat="server" 
                                                Text='<%# Bind("GlobalContactID") %>' Visible="False"></cc1:OLabel>
                                        </itemtemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="First Name" SortExpression="Company">
                                        <itemstyle CssClass="GridPadding" width="80px" />
                                        <headerstyle CssClass="GridPadding" font-underline="False" forecolor="Black" />
                                        <itemtemplate>
                                            <asp:Label ID="lblFirstNames" runat="server" Text='<%# Bind("FirstName") %>'></asp:Label>
                                        </itemtemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Last Name" SortExpression="ContactName">
                                        <itemstyle CssClass="GridPadding" />
                                        <headerstyle CssClass="GridPadding" font-underline="False" forecolor="Black" />
                                        <itemtemplate>
                                            <asp:Label ID="lblLastNames" runat="server" Text='<%# Bind("LastName") %>'></asp:Label>
                                        </itemtemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Address 1" SortExpression="Address1">
                                        <itemstyle CssClass="GridPadding" />
                                        <headerstyle CssClass="GridPadding" font-underline="False" forecolor="Black" />
                                        <itemtemplate>
                                            <asp:Label ID="lblAddress1" runat="server" Text='<%# Bind("Address1") %>'></asp:Label>
                                        </itemtemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Address 2" SortExpression="Address2">
                                        <itemstyle CssClass="GridPadding" />
                                        <headerstyle CssClass="GridPadding" font-underline="False" forecolor="Black" />                                        <itemtemplate>
                                            <asp:Label ID="lblAddress2" runat="server" Text='<%# Bind("Address2") %>'></asp:Label>
                                        </itemtemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="City" SortExpression="City">
                                        <itemstyle CssClass="GridPadding" width="60px" />
                                        <headerstyle CssClass="GridPadding" font-underline="False" forecolor="Black" />
                                        <itemtemplate>
                                            <asp:Label ID="lblCity" runat="server" Text='<%# Bind("City") %>'></asp:Label>
                                        </itemtemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="State" SortExpression="State">
                                        <itemstyle CssClass="GridPadding" width="45px" />
                                        <headerstyle CssClass="GridPadding" font-underline="False" forecolor="Black" />
                                        <itemtemplate>
                                            <asp:Label ID="lblState" runat="server" Text='<%# Bind("State") %>'></asp:Label>
                                        </itemtemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="State" Visible="False">
                                        <itemstyle CssClass="GridPadding" />
                                        <headerstyle font-underline="False" forecolor="Black" />
                                        <itemtemplate>
                                            <asp:Label ID="lblCountry" runat="server" Text='<%# Bind("State") %>' 
                                                Visible="False"></asp:Label>
                                        </itemtemplate>
                                    </asp:TemplateField>
                                    
                                    ....
                                </Columns>
                            </cc1:OGridView>上面书写的事件除了bind都不能触发 用了断点也不能进入事件 很怪异 请问各位老师 遇到过这样的事情吗?

解决方案 »

  1.   

    gridview省略的部分是隐藏列 思路是点击imgesbutten然后制定行上的label上的文本显示到下面的textbox上 但是现在点击任何的东西都没反应 此控件经过复写 
      

  2.   

    function ValidateClientContact()
    {
        var strMessage="";
        var strCommMessage="<%=Utility.GetMessage("Roles", 14) %>"+"\n\n";
        var returnVal = true;
        var ObjField 
        returnVal = CheckForEmpty(document.getElementById("<%= txtFirstName.ClientID %>"),"<%=Utility.GetMessage("Client", 22) %>",true); 
        if(returnVal==false)
          {
                ObjField=document.getElementById("<%= txtFirstName.ClientID %>")
                strMessage= "     - <%=Utility.GetMessage("Client", 46) %>"
          }
          returnVal = CheckForEmpty(document.getElementById("<%= txtLastName.ClientID %>"),"<%=Utility.GetMessage("Client", 23) %>",true);
          if(returnVal==false)
          { 
            if (strMessage=="")
                ObjField=document.getElementById("<%= txtLastName.ClientID %>")
                strMessage= strMessage+"\n"+ "     - <%=Utility.GetMessage("Client", 47) %>"
          }
         
          returnVal = CheckForEmpty(document.getElementById("<%= txtActiveDate.ClientID %>"),"<%=Utility.GetMessage("Client", 25) %>",true);
          if(returnVal==false)
          { 
            if (strMessage=="")
                ObjField=document.getElementById("<%= txtActiveDate.ClientID %>")
                strMessage= strMessage+"\n"+ "     - <%=Utility.GetMessage("Client", 49) %>"
          } 
        
              if(strMessage!="")
         {
           strCommMessage=strCommMessage+strMessage;
            alert(strCommMessage);
            ObjField.focus();
            returnVal=false;
        }
    if(returnVal)
            {
            returnVal = isDate(document.getElementById("<%= txtActiveDate.ClientID %>"),"<%=Utility.GetMessage("Client", 25) %>"); 
      
            } 
            if(returnVal)
            {
            returnVal = isDate(document.getElementById("<%= txtExpirationDate.ClientID %>"),"<%=Utility.GetMessage("Client", 26) %>"); 
      
            } 
        if(returnVal)
       {
        returnVal=doDateCheck(document.getElementById("<%= txtActiveDate.ClientID %>"),document.getElementById("<%=       txtExpirationDate.ClientID %>"),"<%=Utility.GetMessage("Client", 27) %>");
        document.getElementById("<%= txtExpirationDate.ClientID %>").focus()
        }
    return returnVal;
    }