hi ,,
I am using rad grid at webpart , using NestedItem at Grid but after Add Events Fixup Ajax working fine at all grid but i faced 2 issues please help me to find a soultion on them ...
1- the collapse buttom didn't work ( the grid post back and then the nested item didn't collapsed).
2- I can't expand more than 1 nested item at , if i trying to open nested item and it was one else opened the previous one collapsed and the new one expanded ,
here is rad grid code
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" Skin="WebBlue" |
AllowFilteringByColumn="true" dir="rtl" GridLines="None" AllowPaging="True" AllowSorting="True" |
PageSize="15"> |
<PagerStyle Mode="NumericPages" HorizontalAlign="Center" Font-Bold="true" VerticalAlign="Middle"> |
</PagerStyle> |
<GroupingSettings CaseSensitive="false" /> |
<ItemStyle HorizontalAlign="Right" /> |
<FilterItemStyle HorizontalAlign="Right" /> |
<CommandItemStyle HorizontalAlign="Left" /> |
<AlternatingItemStyle HorizontalAlign="Right" /> |
<HeaderStyle HorizontalAlign="Right" /> |
<MasterTableView DataKeyNames="STUDENTNO" GridLines="None" DataSourceID="ObjectDataSource1" |
CommandItemDisplay="Top"> |
<NoRecordsTemplate> |
</NoRecordsTemplate> |
<ExpandCollapseColumn Visible="True"> |
</ExpandCollapseColumn> |
<CommandItemTemplate> |
<asp:LinkButton ID="clearFilter" runat="server" Text="مسح كل البحث" ToolTip="الغاء البحث" |
OnClick="ClearFilter_Click" Font-Bold="true" Font-Size="14px"></asp:LinkButton> |
</CommandItemTemplate> |
<Columns> |
... SOME COLUMNS ... |
</Columns> |
<NestedViewTemplate> |
<table> |
... NESTED TEMPATE GOES HERE ... |
</table> |
</NestedViewTemplate> |
</MasterTableView> |
<ClientSettings> |
<Selecting AllowRowSelect="true" /> |
</ClientSettings> |
</telerik:RadGrid> |
there no important code behind to grid to be diaplay just some binding code ..
i used Event Fixup like the demp here is it
#region Events & Fixers |
protected override void OnInit(EventArgs e) |
{ |
base.OnInit(e); |
ScriptManager scriptManager = ScriptManager.GetCurrent(this.Page); |
if (scriptManager == null) |
{ |
scriptManager = new ScriptManager(); |
scriptManager.ID = "ScriptManager1"; |
this.Page.Form.Controls.AddAt(0, scriptManager); |
} |
RadAjaxManager ram = RadAjaxManager.GetCurrent(this.Page); |
if (ram == null) |
{ |
ram = new RadAjaxManager(); |
ram.ID = "RadAjaxManager1"; |
Page.Form.Controls.Add(ram); |
Page.Items.Add(ram.GetType(), ram); |
} |
EnsureChildControls(); |
} |
protected override void OnPreRender(EventArgs e) |
{ |
base.OnPreRender(e); |
RadAjaxManager manager = RadAjaxManager.GetCurrent(Page); |
if (manager != null) |
{ |
manager.DefaultLoadingPanelID = this.EmployeesListUserControl.AjaxLoadingPanel.ID; |
manager.AjaxSettings.AddAjaxSetting(this.EmployeesListUserControl.GridRootDep, this.EmployeesListUserControl.GridRootDep); |
} |
} |
private void EnsureUpdatePanelFixups() |
{ |
if (this.Page.Form != null) |
{ |
string formOnSubmitAtt = this.Page.Form.Attributes["onsubmit"]; |
if (formOnSubmitAtt == "return _spFormOnSubmitWrapper();") |
{ |
this.Page.Form.Attributes["onsubmit"] = "_spFormOnSubmitWrapper();"; |
} |
} |
ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "UpdatePanelFixup", "_spOriginalFormAction = document.forms[0].action; _spSuppressFormOnSubmitWrapper=true;", true); |
} |
protected override void Render(HtmlTextWriter writer) |
{ |
EnsureUpdatePanelFixups(); |
base.Render(writer); |
} |
#endregion |
please help me ..