how to use Collapsible panel in update panel which is used in Usercontrol

N

nr.vinaya

Hi,

I have a EmployeesGridView in update panel which is in
Default.aspx page, on selection of row in EmployeesGridView it should
update the Usercontrol EmployeeInfo.ascx which is registered in
Default.aspx In EmployeeInfo.ascx i have a Collapsible panel which i
have put it in update panel.On selectedIndex Change event of
EmployeesGridView i will be updating the userControl by sending
EmployeeId

private void EmployeesGridView_SelectedIndexChanged(object sender,
EventArgs e)
{
if (EmployeesGridView.SelectedIndex != -1)
EmployeeInfo1.EmployeeId
=(int)EmployeesGridView.DataKeys[EmployeesGridView.SelectedIndex].Value;

EmployeeInfo1.Update();
}

in EmployeeInfo.ascx i will be binding the EmployeeDetails (selected
based on EmployeeId received from Default.aspx page ) to datagrid in
Collapsible panel .

as i am using ScriptManager for Collapsible panel in EmployeeInfo.ascx
page

<asp:UpdatePanel ChildrenAsTriggers="true"
ID="EmployeeInfoUpdatePanel" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div id="CollapseContent">
<asp:ScriptManager ID="MyScriptManager" runat="server" />
<asp:panel ID="ContentPanel" runat="server">
<asp:LinkButton ID="linkButton1" OnClick="linkButton1_Click"
runat="server">
<asp:Label ID="Label1" runat="server">Show1 Details..</
asp:Label>
</asp:LinkButton>

<asp:GridView ID="MyGridView" runat="server" CellPadding="4"
ForeColor="#333333" GridLines="None" >
<FooterStyle BackColor="#990000" Font-Bold="True"
ForeColor="White" />
<RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
<SelectedRowStyle BackColor="#FFCC66" Font-Bold="True"
ForeColor="Navy" />
<PagerStyle BackColor="#FFCC66" ForeColor="#333333"
HorizontalAlign="Center" />
<HeaderStyle BackColor="#990000" Font-Bold="True"
ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
<asp:Button ID="buttCollapase" Text="show" runat="server"/>
<asp:LinkButton ID="linkButton2" runat="server">
<asp:Label ID="Label2" runat="server">Show2 Details..</asp:Label>
</asp:LinkButton>
<asp:Button ID="Button1" Text="vinaya" runat="server" />
</asp:panel>
</div>
</ContentTemplate>
</asp:UpdatePanel>

and also I am using another script manager in Default.aspx page for
using updatepanel(Partial refreshment of page) ,the issue is i am not
able to do paging ,sorting and also no event is firing , is it because
i am using 2 script managers , if i am not able to use 2 script
manager how to resolve this issue.

<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server"
EnablePartialRendering="true"/>
<table>
<tr>
<td valign="top">
<asp:UpdatePanel ID="EmployeeListUpdatePanel"
ChildrenAsTriggers="true" runat="server">
<ContentTemplate>
<asp:GridView ID="EmployeesGridView" runat="server"
AllowSorting="true" AutoGenerateColumns="false" CellPadding="4"
DataKeyNames="EmployeeId" DataSourceID="EmployeesDataSource1"
ForeColor="#333333" GridLines="None" AllowPaging="true"
PageSize="5" >
<FooterStyle BackColor="#990000" Font-Bold="True"
ForeColor="White" />
<Columns>
<asp:CommandField ShowSelectButton="True">
<ItemStyle Width="50px" />
</asp:CommandField>
<asp:BoundField DataField="EmployeeId" HeaderText="EmployeeId"
SortExpression="EmployeeId">
<ItemStyle Width="120px" />
<HeaderStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="EmpName" HeaderText="EmpName"
SortExpression="EmpName">
<ItemStyle Width="100px" />
<HeaderStyle HorizontalAlign="Left" />
</asp:BoundField>
</Columns>
<RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
<SelectedRowStyle BackColor="#FFCC66" Font-Bold="True"
ForeColor="Navy" />
<PagerStyle BackColor="#FFCC66" ForeColor="#333333"
HorizontalAlign="Center" />
<HeaderStyle BackColor="#990000" Font-Bold="True"
ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
<asp:SqlDataSource ID="EmployeesDataSource1" runat="server"
ConnectionString="Data Source=BLRD2747;Initial
Catalog=master;Integrated Security=True"
SelectCommandType="StoredProcedure"
SelectCommand="sp_GetEmpList">
<SelectParameters>
<asp:QueryStringParameter
Name="EmployeeId"
QueryStringField="EmployeeId"
Type="Int32" />
</SelectParameters>

</asp:SqlDataSource>
</ContentTemplate>
</asp:UpdatePanel>
</td>
<td valign="top" align="right">

<uc1:EmployeeInfo ID="EmployeeInfo1" runat="server" />

</td>
</tr>

</table>
<br />
<br />
&nbsp;
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Button" />
<br />

</div>
</form>

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top