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

ASP.NET

 
QuestionHow to validate the textbox Pin
Anjani Poornima20-Jul-09 1:13
Anjani Poornima20-Jul-09 1:13 
AnswerRe: How to validate the textbox Pin
sekannak20-Jul-09 1:21
sekannak20-Jul-09 1:21 
GeneralRe: How to validate the textbox Pin
Abhijit Jana20-Jul-09 1:43
professionalAbhijit Jana20-Jul-09 1:43 
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 
Insert a Grid View in item Template of ListView view below code

The code is tested .

<asp:ListView ID="ListView1" runat="server" 
                onitemdatabound="ListView1_ItemDataBound1">
                <LayoutTemplate>
                    <table border="0" cellpadding="3" cellspacing="0" width="97%">
                        <tr class="lstheader">
                            <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="lblDate" runat="server" Text='<%#Bind("DepartmentID") %>'></asp:Label>
                        </td>
                        <td>
                            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false">
                            <Columns>
                            <asp:BoundField HeaderText="Department" DataField="Department" />
                            </Columns>
                            </asp:GridView>
                        </td>
                    </tr>
                </ItemTemplate>
                <AlternatingItemTemplate>
                    <tr >
                       <td>
                            <asp:Label ID="lblDate" runat="server" Text='<%#Bind("DepartmentID") %>'></asp:Label>
                        </td>
                        <td>
                            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false">
                            <Columns>
                            <asp:BoundField HeaderText="Department" DataField="Department" />
                            </Columns>
                            </asp:GridView>
                        </td>
                    </tr>
                </AlternatingItemTemplate>
            </asp:ListView>



now firstly Bind the ListView Control as below

protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            fillgrid();
            clsDepartment dpt = new clsDepartment();
            ListView1.DataSource = dpt.SelectAll();
            ListView1.DataBind();
        }

    }


Implement the ItemDataBound event of ListView and Find The Gridview. After Finding bind it


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

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 
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 

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.