Hi
I called the Customer Details Data in the Grid. The Grid is showing all the Data. I wrote the data source through need Data Source.. It is fine... When I Click the Edit mode that time i have enough to load the single Selected Data... But the edit mode once again called the need data source..the grid edit mode loading long time... Let me know how can i solve the this performance problem.... I wrote my code below please check and reply
<div class="searchgrid">
<telerik:RadGrid ID="griduniversal" AllowPaging="True"
OnNeedDataSource="griduniversal_NeedDataSource" OnEditCommand="griduniversal_EditCommand" AlternatingItemStyle-BackColor="ActiveBorder"
OnPreRender="griduniversal_PreRender" AutoGenerateColumns="False"
runat="server" GridLines="None" AllowSorting="True">
<HeaderContextMenu EnableTheming="True">
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
</HeaderContextMenu>
<ClientSettings>
<Selecting AllowRowSelect="true" />
</ClientSettings>
<MasterTableView CommandItemDisplay="Top" DataKeyNames="id,ContactTypeID">
<CommandItemTemplate>
<div class="deletelnk">
<asp:LinkButton ID="lnkContactDelete" OnClick="lnkContactDelete_OnClick" OnClientClick="javascript:return confirm('Would you like to delete the selected Contact(s)?')" runat="server" CausesValidation="false"><img style="border:0px;vertical-align:middle;" alt="" src="../../Images/Delete.png" /><asp:Literal ID="litDeleteArea" runat="server" Text="<%$ Resources:AdminResource, lnkDeleteContact%>"></asp:Literal></asp:LinkButton>
</div>
</CommandItemTemplate>
<Columns>
<telerik:GridTemplateColumn UniqueName="TemplateColumn">
<ItemTemplate>
<asp:CheckBox id="chkContactDelete" runat="server"></asp:CheckBox>
</ItemTemplate>
<HeaderStyle Width="10px"></HeaderStyle>
</telerik:GridTemplateColumn>
<telerik:GridEditCommandColumn UniqueName="EditCommandColumn">
<HeaderStyle Width="40px"></HeaderStyle>
</telerik:GridEditCommandColumn>
<telerik:GridBoundColumn UniqueName="ID" Visible="false" HeaderText="ID" DataField="ID">
<HeaderStyle Width="25%"></HeaderStyle>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName="FirstName" HeaderText="Name" DataField="FullName">
<HeaderStyle Width="25%"></HeaderStyle>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName="City" HeaderText="City" DataField='CityName'>
<HeaderStyle Width="20%"></HeaderStyle>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName="State" HeaderText="State" DataField="StateName">
<HeaderStyle Width="20%" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName="ContactTypeID" HeaderText="ContactType" DataField="ContactTypeName">
</telerik:GridBoundColumn>
</Columns>
<EditFormSettings EditFormType="WebUserControl">
<EditColumn>
</EditColumn>
</EditFormSettings>
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
</MasterTableView>
<FilterMenu EnableTheming="True">
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
</FilterMenu>
</telerik:RadGrid>
</div>
<!-- Ajax Manager-->
<telerik:RadAjaxManager ID="amanagerSearchGrid" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="griduniversal">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="griduniversal" LoadingPanelID="aloadingpanelSearchGrid"/>
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="cmbPersonalInfoCountry">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="cmbPersonalInfoState" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="cmbCreditCardAddressCountry">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="cmbCreditCardState" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="cmbUniversalSearchDestination">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="cmbUniversalSearchArea" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="cmbUniversalSearchArea">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="cmbUniversalSearchLocation" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="aloadingpanelSearchGrid" runat="server" Height="75px"
Width="75px">
<img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page,"Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' style="border: 0px;" />
</telerik:RadAjaxLoadingPanel>
in Cs Page
/// <summary>
/// Handling PreRender Event
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
///
protected void griduniversal_PreRender(object sender, System.EventArgs e)
{
if (!this.IsPostBack)
{
this.griduniversal.MasterTableView.Rebind();
}
}
/// <summary>
/// Loads the data source
/// </summary>
/// <param name="source"></param>
/// <param name="e"></param>
protected void griduniversal_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
{
if ((txtUniversalSearchFirstName.Text == string.Empty) && (txtUniversalSearchLastName.Text == string.Empty) && (txtUniversalSearchEmail.Text == string.Empty) && (txtUniversalSearchPostalZipCode.Text == string.Empty))
{
IList<ContactData> gridData = new List<ContactData>();
gridData = contactManager.GetContact();
this.griduniversal.DataSource = gridData;
}
else
{
SearchCriteria();
}
}
protected void griduniversal_EditCommand(object sourcem, GridCommandEventArgs e)
{
if (e.CommandName == RadGrid.EditCommandName)
{
GridDataItem item = (GridDataItem)e.Item;
string contactId = item.GetDataKeyValue("id").ToString();
JSSessionHandler.SetSessionValue("contactId", contactId);
switch (item.GetDataKeyValue("ContactTypeID").ToString())
{
case "1":
griduniversal.MasterTableView.EditFormSettings.UserControlName = "~/UserControl/Renter.ascx";
break;
case "2":
griduniversal.MasterTableView.EditFormSettings.UserControlName = "~/UserControl/PropertyOwner.ascx";
break;
}
Let me know how can i solve this problem
Regards
G. Manikandan
I called the Customer Details Data in the Grid. The Grid is showing all the Data. I wrote the data source through need Data Source.. It is fine... When I Click the Edit mode that time i have enough to load the single Selected Data... But the edit mode once again called the need data source..the grid edit mode loading long time... Let me know how can i solve the this performance problem.... I wrote my code below please check and reply
<div class="searchgrid">
<telerik:RadGrid ID="griduniversal" AllowPaging="True"
OnNeedDataSource="griduniversal_NeedDataSource" OnEditCommand="griduniversal_EditCommand" AlternatingItemStyle-BackColor="ActiveBorder"
OnPreRender="griduniversal_PreRender" AutoGenerateColumns="False"
runat="server" GridLines="None" AllowSorting="True">
<HeaderContextMenu EnableTheming="True">
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
</HeaderContextMenu>
<ClientSettings>
<Selecting AllowRowSelect="true" />
</ClientSettings>
<MasterTableView CommandItemDisplay="Top" DataKeyNames="id,ContactTypeID">
<CommandItemTemplate>
<div class="deletelnk">
<asp:LinkButton ID="lnkContactDelete" OnClick="lnkContactDelete_OnClick" OnClientClick="javascript:return confirm('Would you like to delete the selected Contact(s)?')" runat="server" CausesValidation="false"><img style="border:0px;vertical-align:middle;" alt="" src="../../Images/Delete.png" /><asp:Literal ID="litDeleteArea" runat="server" Text="<%$ Resources:AdminResource, lnkDeleteContact%>"></asp:Literal></asp:LinkButton>
</div>
</CommandItemTemplate>
<Columns>
<telerik:GridTemplateColumn UniqueName="TemplateColumn">
<ItemTemplate>
<asp:CheckBox id="chkContactDelete" runat="server"></asp:CheckBox>
</ItemTemplate>
<HeaderStyle Width="10px"></HeaderStyle>
</telerik:GridTemplateColumn>
<telerik:GridEditCommandColumn UniqueName="EditCommandColumn">
<HeaderStyle Width="40px"></HeaderStyle>
</telerik:GridEditCommandColumn>
<telerik:GridBoundColumn UniqueName="ID" Visible="false" HeaderText="ID" DataField="ID">
<HeaderStyle Width="25%"></HeaderStyle>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName="FirstName" HeaderText="Name" DataField="FullName">
<HeaderStyle Width="25%"></HeaderStyle>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName="City" HeaderText="City" DataField='CityName'>
<HeaderStyle Width="20%"></HeaderStyle>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName="State" HeaderText="State" DataField="StateName">
<HeaderStyle Width="20%" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName="ContactTypeID" HeaderText="ContactType" DataField="ContactTypeName">
</telerik:GridBoundColumn>
</Columns>
<EditFormSettings EditFormType="WebUserControl">
<EditColumn>
</EditColumn>
</EditFormSettings>
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
</MasterTableView>
<FilterMenu EnableTheming="True">
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
</FilterMenu>
</telerik:RadGrid>
</div>
<!-- Ajax Manager-->
<telerik:RadAjaxManager ID="amanagerSearchGrid" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="griduniversal">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="griduniversal" LoadingPanelID="aloadingpanelSearchGrid"/>
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="cmbPersonalInfoCountry">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="cmbPersonalInfoState" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="cmbCreditCardAddressCountry">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="cmbCreditCardState" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="cmbUniversalSearchDestination">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="cmbUniversalSearchArea" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="cmbUniversalSearchArea">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="cmbUniversalSearchLocation" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="aloadingpanelSearchGrid" runat="server" Height="75px"
Width="75px">
<img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page,"Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' style="border: 0px;" />
</telerik:RadAjaxLoadingPanel>
in Cs Page
/// <summary>
/// Handling PreRender Event
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
///
protected void griduniversal_PreRender(object sender, System.EventArgs e)
{
if (!this.IsPostBack)
{
this.griduniversal.MasterTableView.Rebind();
}
}
/// <summary>
/// Loads the data source
/// </summary>
/// <param name="source"></param>
/// <param name="e"></param>
protected void griduniversal_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
{
if ((txtUniversalSearchFirstName.Text == string.Empty) && (txtUniversalSearchLastName.Text == string.Empty) && (txtUniversalSearchEmail.Text == string.Empty) && (txtUniversalSearchPostalZipCode.Text == string.Empty))
{
IList<ContactData> gridData = new List<ContactData>();
gridData = contactManager.GetContact();
this.griduniversal.DataSource = gridData;
}
else
{
SearchCriteria();
}
}
protected void griduniversal_EditCommand(object sourcem, GridCommandEventArgs e)
{
if (e.CommandName == RadGrid.EditCommandName)
{
GridDataItem item = (GridDataItem)e.Item;
string contactId = item.GetDataKeyValue("id").ToString();
JSSessionHandler.SetSessionValue("contactId", contactId);
switch (item.GetDataKeyValue("ContactTypeID").ToString())
{
case "1":
griduniversal.MasterTableView.EditFormSettings.UserControlName = "~/UserControl/Renter.ascx";
break;
case "2":
griduniversal.MasterTableView.EditFormSettings.UserControlName = "~/UserControl/PropertyOwner.ascx";
break;
}
Let me know how can i solve this problem
Regards
G. Manikandan