Click here to Skip to main content
15,887,214 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionNew Pin
tsunamigang17-Dec-13 17:27
tsunamigang17-Dec-13 17:27 
AnswerRe: New Pin
thatraja17-Dec-13 23:35
professionalthatraja17-Dec-13 23:35 
QuestionUsing gridview onrowcommand on saving and displaying the data? Pin
Member 840570017-Dec-13 1:38
Member 840570017-Dec-13 1:38 
AnswerRe: Using gridview onrowcommand on saving and displaying the data? Pin
Tom Marvolo Riddle17-Dec-13 2:05
professionalTom Marvolo Riddle17-Dec-13 2:05 
GeneralRe: Using gridview onrowcommand on saving and displaying the data? Pin
Member 840570017-Dec-13 6:28
Member 840570017-Dec-13 6:28 
GeneralRe: Using gridview onrowcommand on saving and displaying the data? Pin
Tom Marvolo Riddle17-Dec-13 17:44
professionalTom Marvolo Riddle17-Dec-13 17:44 
GeneralRe: Using gridview onrowcommand on saving and displaying the data? Pin
Member 840570018-Dec-13 5:32
Member 840570018-Dec-13 5:32 
GeneralRe: Using gridview onrowcommand on saving and displaying the data? Pin
Tom Marvolo Riddle18-Dec-13 17:23
professionalTom Marvolo Riddle18-Dec-13 17:23 
I tried a similar one it works fine for me.
Try like this:
C#
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
        asp:GridView ID="gvParentGrid" runat="server" Width="395px"
AutoGenerateColumns="false"  GridLines="None" BorderStyle="Solid" BorderWidth="0px" 
            BorderColor="White" DataKeyNames="ID" onrowcommand="gvParentGrid_RowCommand"
            onrowdatabound="gvParentGrid_RowDataBound" >
 
<Columns>
<asp:TemplateField >
<ItemTemplate>
 
 <tr>
     <td id ="comment" class ="highlightab" style ="border-bottom :2px solid Blue;border-bottom-color :Gray; border-left :0px; border-left-color :White; border-right :0px; border-right-color :White; border-top :0px; border-top-color :White;background-color :White;border-bottom :2px solid Blue;border-bottom-color :Gray; border-left :0px; border-left-color :White; border-right :0px; border-right-color :White; border-top :0px; border-top-color :White;background-color :White; height :100px; width :395px; margin-bottom :5px">
              
               <asp:Image ID="Image1" runat="server" style="  margin-right :5px; background-image :url('Image/imagebackground.png');"  ImageAlign ="Left" Height ="60px" Width="60px" />
               <asp:Label ID ="ComID" runat ="server" style="display :none" Text =' <%#Eval("ID") %>' /> 
              <asp:Label ID="name" runat="server"  Font-Bold="True" Text='<%# Eval("Name")%>' ForeColor="Blue"></asp:Label>           
             <p id ="content" class="minimize" style =" border-radius: 4px 4px 4px 4px; max-width :395px; min-height :5px; margin-top :5px; margin-bottom :5px; margin-left :65px; display :block; background-color: #CCCCFF;"> <%# DataBinder.Eval(Container.DataItem,"Comments").ToString() %> </p> 
           <a href="JavaScript:divexpandcollapse('div<%# Eval("ID") %>');" style ="margin-left :65px; margin-top :1px" >
             <input id="btndiv<%# Eval("ID") %>" type="button" value="Reply" style ="border:0px; background-color :White; color :blue; cursor :pointer " />     
          </a> 
               
     </td>                     
 </tr>
                      
</ItemTemplate>
</asp:TemplateField>
 
<asp:TemplateField>
<ItemTemplate>
 
  <!--This is the child gridview -->
<div id="div<%# Eval("ID") %>" style="display: none; position:relative; left: 65px; overflow: auto; margin-top :1px">
 
<asp:GridView ID="gvChildGrid" runat="server" AutoGenerateColumns="false" BorderStyle="Double"  BorderColor="white" GridLines="None" Width="325px" onrowcommand="gvChildGrid_RowCommand" onrowdatabound="gvChildGrid_RowDataBound">
 
<Columns >
 
<asp:TemplateField >
<ItemTemplate >
<tr>
  <td style ="border-bottom :2px solid Blue;border-bottom-color :Gray; border-left :0px; border-left-color :White; border-right :0px; border-right-color :White; border-top :0px; border-top-color :White;background-color :White; height :100px; width :325px">
  
 <asp:Image ID="Image1" runat="server" style=" margin-right :5px; background-image :url('Image/imagebackground.png');"  ImageAlign ="Left" Height ="60px" Width="60px" />
 
 <asp:Label ID="name" runat="server"  Font-Bold="True" Text='<%# Eval("Name")%>' ForeColor="Blue"></asp:Label>           
 <p id ="content" class="minimize" style =" border-radius: 4px 4px 4px 4px; max-width :325px; min-height :5px; margin-top :5px; margin-left :65px; display :block; background-color: #CCCCFF;"> <%# DataBinder.Eval(Container.DataItem,"Replies").ToString() %> </p> 
    
  </td>
</tr>
</ItemTemplate>
</asp:TemplateField>
  
</Columns>
 
</asp:GridView>
 
<asp:Label ID="Label1" runat="server" Text="Name"></asp:Label>
   <br />
  <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
  <br />
  <asp:TextBox ID="TextBox2" Height ="200px" Width ="325px" TextMode ="MultiLine" runat="server"></asp:TextBox>
  <br />
  <asp:Button ID="Button1" runat="server" Text="Post Reply" onclick="Button1_Click" />         
 
</div>
 
</ItemTemplate>
</asp:TemplateField>
</Columns>
 
</asp:GridView
       </ContentTemplate>
        </asp:UpdatePanel>


To learn all there is to know. I know I'll be disappointed one day, but I've made a good start, and the eventual disappointment is likely to be brief.
-Roger Wright

Never doubt that a small group of thoughtful, committed people can change the world. Indeed, it is the only thing that ever has.-Margaret Mead

GeneralRe: Using gridview onrowcommand on saving and displaying the data? Pin
Member 840570019-Dec-13 4:44
Member 840570019-Dec-13 4:44 
GeneralCustomize MVC Help Pin
shki17-Dec-13 0:19
shki17-Dec-13 0:19 
GeneralRe: Customize MVC Help Pin
JV999917-Dec-13 0:23
professionalJV999917-Dec-13 0:23 
JokeRe: Customize MVC Help Pin
Kornfeld Eliyahu Peter17-Dec-13 0:28
professionalKornfeld Eliyahu Peter17-Dec-13 0:28 
GeneralRe: Customize MVC Help Pin
JV999917-Dec-13 0:31
professionalJV999917-Dec-13 0:31 
GeneralRe: Customize MVC Help Pin
OriginalGriff17-Dec-13 0:44
mveOriginalGriff17-Dec-13 0:44 
GeneralRe: Customize MVC Help Pin
devenv.exe17-Dec-13 0:35
professionaldevenv.exe17-Dec-13 0:35 
GeneralRe: Customize MVC Help PinPopular
Pete O'Hanlon17-Dec-13 0:44
mvePete O'Hanlon17-Dec-13 0:44 
GeneralRe: Customize MVC Help PinPopular
Chris Maunder17-Dec-13 2:11
cofounderChris Maunder17-Dec-13 2:11 
GeneralRe: Customize MVC Help Pin
Simon Lee Shugar17-Dec-13 1:40
Simon Lee Shugar17-Dec-13 1:40 
AnswerRe: Customize MVC Help Pin
Rahul Rajat Singh19-Dec-13 18:25
professionalRahul Rajat Singh19-Dec-13 18:25 
QuestionAllow / Deny IP Address via Web.config Pin
Member 947380916-Dec-13 23:05
Member 947380916-Dec-13 23:05 
AnswerRe: Allow / Deny IP Address via Web.config Pin
Richard Deeming16-Dec-13 23:28
mveRichard Deeming16-Dec-13 23:28 
AnswerRe: Allow / Deny IP Address via Web.config Pin
joginder-banger25-Dec-13 15:55
professionaljoginder-banger25-Dec-13 15:55 
QuestionWebsite appearance format Pin
Otekpo Emmanuel16-Dec-13 5:19
Otekpo Emmanuel16-Dec-13 5:19 
AnswerRe: Website appearance format Pin
jkirkerx17-Dec-13 12:31
professionaljkirkerx17-Dec-13 12:31 
QuestionValidateAntiForgeryToken is not been applied for Controller method calling JGrid get details Pin
Sreenath GVS16-Dec-13 5:05
Sreenath GVS16-Dec-13 5:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.