Hi All,
I am using following code, after loading grid data those record are displayed in grid, the real problem is that once i unchecked any record from first page(i.e. grid first page), and move to next page and again come back the first page, it will not display unchecked record, why?
<telerik:RadGrid ID="rgEventResult" Width="100%" runat="server" AllowFilteringByColumn="false"
AllowPaging="True" AllowSorting="True" GridLines="None" ShowGroupPanel="false"
AllowMultiRowSelection="true" AutoGenerateColumns="False" Height="370px" PageSize="10"
OnNeedDataSource="rgEventResult_NeedDataSource" OnItemCreated="rgEventResult_ItemCreated"
OnItemDataBound="rgEventResult_ItemDataBound">
<HeaderContextMenu EnableEmbeddedSkins="False" />
<ItemStyle Wrap="True" />
<PagerStyle AlwaysVisible="True" ShowPagerText="true" Mode="NextPrevAndNumeric" />
<MasterTableView DataKeyNames="Id" ItemStyle-Wrap="true" TableLayout="Auto">
<Columns>
<telerik:GridClientSelectColumn UniqueName="SelectColumn" HeaderStyle-Width="25px">
<HeaderStyle Width="25px"></HeaderStyle>
</telerik:GridClientSelectColumn>
<telerik:GridBoundColumn UniqueName="EventAttendeeId" HeaderText="Event Attendee Id"
DataField="EventAttendeeId" Display="false" />
<telerik:GridBoundColumn DataField="Email" HeaderText="Email" UniqueName="EventEmail" />
<telerik:GridBoundColumn DataField="FirstName" HeaderText="First Name" UniqueName="EventFirstName" />
<telerik:GridBoundColumn DataField="LastName" HeaderText="Last Name" UniqueName="EventLastName" />
<telerik:GridBoundColumn DataField="CompanyName" HeaderText="Company" UniqueName="EventCompanyName" />
<telerik:GridBoundColumn DataField="Status" HeaderText="Registration Status" UniqueName="EventStatus" />
<telerik:GridBoundColumn DataField="EventTitle" HeaderText="Event Title" UniqueName="EventTitle" />
</Columns>
</MasterTableView>
<ClientSettings AllowColumnHide="false" AllowColumnsReorder="false" AllowDragToGroup="false"
ReorderColumnsOnClient="false">
<Selecting AllowRowSelect="True" />
<Resizing ClipCellContentOnResize="false" AllowColumnResize="true" ResizeGridOnColumnResize="true" />
<Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="true" ScrollHeight="100%" />
</ClientSettings>
</telerik:RadGrid>
protected void rgEventResult_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
ContactListDetailService.ContactListDetailClient proxyDetail = new ContactListDetailService.ContactListDetailClient();
List<System.Guid> eventIds = new List<Guid>();
List<System.Guid> statusIds = new List<Guid>();
if (Session["EventIds"] != null)
{
eventIds = Session["EventIds"] as List<System.Guid>;
}
if (Session["StatusIds"] != null)
{
statusIds = Session["StatusIds"] as List<System.Guid>;
}
try
{
epp2ClientPL.ContactListDetailProperties[] details = proxyDetail.LoadByEventAndStatusIds(eventIds.ToArray(), statusIds.ToArray());
rgEventResult.DataSource = details; // proxyDetail.LoadByEventAndStatusIds(eventIds, statusIds);
lblTotal.Text = details.Count().ToString();
}
catch
{ }
finally
{
if (proxyDetail != null)
{
proxyDetail.Close();
proxyDetail = null;
}
}
}
protected void rgEventResult_ItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item is GridDataItem)
{
GridDataItem dataItem = (GridDataItem)e.Item;
dataItem.Selected = true;
}
}
waiting for reply
Thanks & Regards,
Dharmesh
I am using following code, after loading grid data those record are displayed in grid, the real problem is that once i unchecked any record from first page(i.e. grid first page), and move to next page and again come back the first page, it will not display unchecked record, why?
<telerik:RadGrid ID="rgEventResult" Width="100%" runat="server" AllowFilteringByColumn="false"
AllowPaging="True" AllowSorting="True" GridLines="None" ShowGroupPanel="false"
AllowMultiRowSelection="true" AutoGenerateColumns="False" Height="370px" PageSize="10"
OnNeedDataSource="rgEventResult_NeedDataSource" OnItemCreated="rgEventResult_ItemCreated"
OnItemDataBound="rgEventResult_ItemDataBound">
<HeaderContextMenu EnableEmbeddedSkins="False" />
<ItemStyle Wrap="True" />
<PagerStyle AlwaysVisible="True" ShowPagerText="true" Mode="NextPrevAndNumeric" />
<MasterTableView DataKeyNames="Id" ItemStyle-Wrap="true" TableLayout="Auto">
<Columns>
<telerik:GridClientSelectColumn UniqueName="SelectColumn" HeaderStyle-Width="25px">
<HeaderStyle Width="25px"></HeaderStyle>
</telerik:GridClientSelectColumn>
<telerik:GridBoundColumn UniqueName="EventAttendeeId" HeaderText="Event Attendee Id"
DataField="EventAttendeeId" Display="false" />
<telerik:GridBoundColumn DataField="Email" HeaderText="Email" UniqueName="EventEmail" />
<telerik:GridBoundColumn DataField="FirstName" HeaderText="First Name" UniqueName="EventFirstName" />
<telerik:GridBoundColumn DataField="LastName" HeaderText="Last Name" UniqueName="EventLastName" />
<telerik:GridBoundColumn DataField="CompanyName" HeaderText="Company" UniqueName="EventCompanyName" />
<telerik:GridBoundColumn DataField="Status" HeaderText="Registration Status" UniqueName="EventStatus" />
<telerik:GridBoundColumn DataField="EventTitle" HeaderText="Event Title" UniqueName="EventTitle" />
</Columns>
</MasterTableView>
<ClientSettings AllowColumnHide="false" AllowColumnsReorder="false" AllowDragToGroup="false"
ReorderColumnsOnClient="false">
<Selecting AllowRowSelect="True" />
<Resizing ClipCellContentOnResize="false" AllowColumnResize="true" ResizeGridOnColumnResize="true" />
<Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="true" ScrollHeight="100%" />
</ClientSettings>
</telerik:RadGrid>
protected void rgEventResult_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
ContactListDetailService.ContactListDetailClient proxyDetail = new ContactListDetailService.ContactListDetailClient();
List<System.Guid> eventIds = new List<Guid>();
List<System.Guid> statusIds = new List<Guid>();
if (Session["EventIds"] != null)
{
eventIds = Session["EventIds"] as List<System.Guid>;
}
if (Session["StatusIds"] != null)
{
statusIds = Session["StatusIds"] as List<System.Guid>;
}
try
{
epp2ClientPL.ContactListDetailProperties[] details = proxyDetail.LoadByEventAndStatusIds(eventIds.ToArray(), statusIds.ToArray());
rgEventResult.DataSource = details; // proxyDetail.LoadByEventAndStatusIds(eventIds, statusIds);
lblTotal.Text = details.Count().ToString();
}
catch
{ }
finally
{
if (proxyDetail != null)
{
proxyDetail.Close();
proxyDetail = null;
}
}
}
protected void rgEventResult_ItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item is GridDataItem)
{
GridDataItem dataItem = (GridDataItem)e.Item;
dataItem.Selected = true;
}
}
waiting for reply
Thanks & Regards,
Dharmesh