Click here to Skip to main content
15,890,741 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: How to validate the textbox Pin
DoctorMick20-Jul-09 3:51
DoctorMick20-Jul-09 3:51 
QuestionGridview inside ListView Control Pin
megivimal20-Jul-09 0:40
megivimal20-Jul-09 0:40 
AnswerRe: Gridview inside ListView Control Pin
sekannak20-Jul-09 1:14
sekannak20-Jul-09 1:14 
GeneralRe: Gridview inside ListView Control Pin
megivimal20-Jul-09 1:22
megivimal20-Jul-09 1:22 
AnswerRe: Gridview inside ListView Control Pin
Zafar A khan 20-Jul-09 1:35
professionalZafar A khan 20-Jul-09 1:35 
GeneralRe: Gridview inside ListView Control Pin
megivimal20-Jul-09 2:00
megivimal20-Jul-09 2:00 
GeneralRe: Gridview inside ListView Control Pin
megivimal20-Jul-09 2:04
megivimal20-Jul-09 2:04 
GeneralRe: Gridview inside ListView Control Pin
Zafar A khan 20-Jul-09 18:47
professionalZafar A khan 20-Jul-09 18:47 
You Can Use "CollapsiblePanelExtender" inside Listview for expand and collapse

Below code.



<asp:ListView ID="ListView1" runat="server"
              onitemdatabound="ListView1_ItemDataBound1">
              <LayoutTemplate>
                  <table border="0" cellpadding="3" cellspacing="0" width="97%">
                      <tr >
                          <td width="15%">
                              Col one</td>
                          <td width="15%">
                              Grid Column</td>

                      </tr>
                      <asp:PlaceHolder ID="itemPlaceholder" runat="server"></asp:PlaceHolder>
                  </table>
              </LayoutTemplate>
              <ItemTemplate>
              <tr >
              <td>
                   <asp:Label ID="lblDepartmentID" runat="server" Text='<%# Bind("DepartmentID") %>'></asp:Label>
              </td>
              <td>
                      <asp:LinkButton CausesValidation="false" ID="lnkexp" runat="server">+</asp:LinkButton>
                      <asp:LinkButton CausesValidation="false" ID="lnkCol" runat="server">-</asp:LinkButton>
                      <asp:Label ID="Label3" runat="server" Text="panel"></asp:Label>
                   <asp:Panel ID="pnl1" runat="server" >
                          <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false">
                          <Columns>
                          <asp:BoundField HeaderText="Department" DataField="Department" />
                          </Columns>
                          </asp:GridView>
                  </asp:Panel>
                  <cc1:CollapsiblePanelExtender ExpandControlID="lnkexp" CollapseControlID="lnkCol" TargetControlID="pnl1" ID="CollapsiblePanelExtender2" runat="server" TextLabelID="Label3" ExpandedText="collapse" CollapsedText="expand" SuppressPostBack="True" Collapsed="True">
                  </cc1:CollapsiblePanelExtender>

                  </td>
                 </tr>

              </ItemTemplate>
              <AlternatingItemTemplate>
                   <tr >
              <td>
                  <asp:Label ID="lblDepartmentID" runat="server" Text='<%# Bind("DepartmentID") %>'></asp:Label>
              </td>
              <td>

                      <asp:LinkButton CausesValidation="false" ID="lnkexp" runat="server">+</asp:LinkButton>
                      <asp:LinkButton CausesValidation="false" ID="lnkCol" runat="server">-</asp:LinkButton>
                      <asp:Label ID="Label3" runat="server" Text="panel"></asp:Label>
                     <asp:Panel ID="pnl1" runat="server" >
                          <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false">
                          <Columns>
                          <asp:BoundField HeaderText="Department" DataField="Department" />
                          </Columns>
                          </asp:GridView>
                      </asp:Panel>
                  <cc1:CollapsiblePanelExtender ExpandControlID="lnkexp" CollapseControlID="lnkCol" TargetControlID="pnl1" ID="CollapsiblePanelExtender2" runat="server" TextLabelID="Label3" ExpandedText="collapse" CollapsedText="expand" SuppressPostBack="True" Collapsed="True">
                  </cc1:CollapsiblePanelExtender>

                  </td>
                 </tr>
              </AlternatingItemTemplate>
          </asp:ListView>



And change to item databound will be as follow


protected void ListView1_ItemDataBound1(object sender, ListViewItemEventArgs e)
    {
       
        if (e.Item.ItemType == ListViewItemType.DataItem)
        {
           
            Panel pnl = (Panel)e.Item.FindControl("pnl1");
            if (pnl != null)
            {
                GridView Grd = pnl.FindControl("GridView1") as GridView;
                if (Grd != null)
                {
                    clsDepartment dpt = new clsDepartment();
                    Grd.DataSource = dpt.SelectAll();
                    Grd.DataBind();
                }
            }
        }
    }


Now Apply Images and Styles yourself Smile | :)
GeneralRe: Gridview inside ListView Control Pin
megivimal20-Jul-09 20:33
megivimal20-Jul-09 20:33 
QuestionTo get the value into the textbox when when particular item is selected in dropdown list Pin
Anjani Poornima20-Jul-09 0:19
Anjani Poornima20-Jul-09 0:19 
AnswerRe: To get the value into the textbox when when particular item is selected in dropdown list Pin
Baran M20-Jul-09 0:37
Baran M20-Jul-09 0:37 
QuestionAjax Passwordstrength Pin
m_krishna19-Jul-09 23:33
m_krishna19-Jul-09 23:33 
AnswerRe: Ajax Passwordstrength Pin
Blue_Boy19-Jul-09 23:55
Blue_Boy19-Jul-09 23:55 
AnswerRe: Ajax Passwordstrength Pin
Zafar A khan 20-Jul-09 0:16
professionalZafar A khan 20-Jul-09 0:16 
GeneralRe: Ajax Passwordstrength Pin
m_krishna20-Jul-09 2:08
m_krishna20-Jul-09 2:08 
AnswerRe: Ajax Passwordstrength Pin
Baran M20-Jul-09 0:23
Baran M20-Jul-09 0:23 
Questionhow to update a multiple tables in a gridview Pin
haleemasher19-Jul-09 22:50
haleemasher19-Jul-09 22:50 
AnswerRe: how to update a multiple tables in a gridview Pin
Manas Bhardwaj19-Jul-09 22:54
professionalManas Bhardwaj19-Jul-09 22:54 
GeneralRe: how to update a multiple tables in a gridview Pin
haleemasher19-Jul-09 23:00
haleemasher19-Jul-09 23:00 
AnswerRe: how to update a multiple tables in a gridview Pin
Abhijit Jana19-Jul-09 22:57
professionalAbhijit Jana19-Jul-09 22:57 
GeneralRe: how to update a multiple tables in a gridview Pin
haleemasher19-Jul-09 23:38
haleemasher19-Jul-09 23:38 
AnswerRe: how to update a multiple tables in a gridview Pin
Vimalsoft(Pty) Ltd19-Jul-09 23:33
professionalVimalsoft(Pty) Ltd19-Jul-09 23:33 
Questioni want to display value Pin
Rajee Maharjan19-Jul-09 20:36
Rajee Maharjan19-Jul-09 20:36 
AnswerRe: i want to display value Pin
Abhijit Jana19-Jul-09 20:45
professionalAbhijit Jana19-Jul-09 20:45 
AnswerRe: i want to display value Pin
N a v a n e e t h19-Jul-09 20:46
N a v a n e e t h19-Jul-09 20:46 

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.