troubleshooting Question

gridview question and c#

Avatar of Saroj13
Saroj13 asked on
2 Comments1 Solution618 ViewsLast Modified:

I have gridview.  I am displaying ID, Title, Text in columns in gridview. On page load, text column is not displaying anything.

How to achieve if click on Title, will display the corresponding text in Text column in gridview.

Please see the picture and code:

<head runat="server">
      <script src="../scripts/jquery-1.6.1.js" type="text/javascript"></script>  
      <script src="../scripts/jquery.tablednd_0_5.js" type="text/javascript"></script>  



             -webkit-user-select: none;  

             -khtml-user-select: none;  

             -moz-user-select: none;  

             -o-user-select: none;  

             user-select: none;  

             cursor: move;  




             background-color: Lime;  


            height: 8px;
            height: 2px;

            height: 24px;
            height: 1px;


     <script type="text/javascript">  

var strorder;  

 $(document).ready(function() {



     onDrop: function(table, row) {  



              type: "POST",

              url: "ScriptOrder.aspx/GridViewReorders",

              data: '{"Reorder":"' + strorder + '"}',  

              contentType: "application/json; charset=utf-8",  

              dataType: "json",  

              async: true,  

              cache: false,  

              success: function (msg) {  

              alert("Successfully Save ReOrder");  








 function  reorder()  



     var totalid = $('#ScriptsGridView tr td input').length;  

     for(var i=0;i<totalid;i++)  


         strorder = strorder + $('#ScriptsGridView tr td input')[i].getAttribute("value") + "|";  




      <form id="frmOrderScript" runat="server">
                      <td class="style7">
            <td class="style3">
                <asp:GridView ID="ScriptsGridView" runat="server" 
                    HeaderStyle-CssClass="nodrag nodrop" AutoGenerateColumns="False" GridLines="Both"
                    ShowHeader="True" Width="100%" 
                    style="position: relative; top: -40px; left: 275px; height: 2px;" 
                    onrowdatabound="ScriptsGridView_RowDataBound" >
                      <asp:TemplateField ItemStyle-CssClass="noselect" HeaderText="ID">  


         <asp:Label ID="lblID" runat="server" Text='<%# Bind("ScriptID") %>'></asp:Label>  

        <asp:HiddenField ID="hdnid" runat="server" Visible="true" Value='<%# Bind("ScriptID") %>' />  



         <asp:TemplateField ItemStyle-CssClass="noselect" HeaderText="Script Name">  


          <asp:Label ID="lblName" runat="server" Text='<%# Bind("Title") %>'></asp:Label>  



      <asp:TemplateField HeaderText="Display Order" ItemStyle-CssClass="noselect">  


           <asp:Label ID="lblOrder" runat="server" Text='<%# Bind("DisplayOrder") %>'>  




          <asp:TemplateField HeaderText="Text" ItemStyle-CssClass="noselect"   >  
         <RowStyle BackColor="#ffffff" />
                    <AlternatingRowStyle BackColor="#ffffff" />

           <asp:Label ID="lbText" runat="server" Text='<%# Bind("Text") %>'>  





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

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros