I have client-side grid inherited from RadGrid. It was fully functional, but after upgrade to the newest Telerik version it stopped working properly.
For instance, I have a custom pager: it's RadCombobox created like this:
This event is fired twice as we all know :) and before it was not a problem, but now after I select value in the pager and SelectedIndexChanged event happens - the values in the combobox are duplicated on page reload! No matter if I turn viewstate on or off, for combobox itself or the grid in common...
More code I previously had to write to make custom paging work:
and it was called by using this:
Autopostback property of combo is set to false, so this event fires only.
For instance, I have a custom pager: it's RadCombobox created like this:
protected
override
void
OnItemEvent(GridItemEventArgs e)
{
if
(e.EventInfo
is
GridInitializePagerItem && e.Item
is
GridPagerItem)
{
e.Canceled =
true
;
B4GridClientPager =
new
B4GridClientPager((e.EventInfo
as
GridInitializePagerItem).PagingManager, e.Item.OwnerTableView, Page, MaxNumberOfRows);
(e.Item
as
GridPagerItem).PagerContentCell.Controls.Add(B4GridClientPager);
}
}
This event is fired twice as we all know :) and before it was not a problem, but now after I select value in the pager and SelectedIndexChanged event happens - the values in the combobox are duplicated on page reload! No matter if I turn viewstate on or off, for combobox itself or the grid in common...
More code I previously had to write to make custom paging work:
private
void
RadGridDebriefitClientPager_Init(
object
sender, EventArgs e)
{
var radComboBox = sender
as
RadComboBox;
if
(Page.IsPostBack)
{
if
(HttpContext.Current.Request.Params[
"__EVENTTARGET"
] !=
null
&&
HttpContext.Current.Request.Params[
"__EVENTTARGET"
] == radComboBox.ClientID)
{
int
pageSize;
if
(
int
.TryParse(HttpContext.Current.Request.Params[
"__EVENTARGUMENT"
],
out
pageSize))
{
if
(pageSize > 0)
{
_tableView.PageSize = pageSize;
_tableView.OwnerGrid.PageSize = pageSize;
_tableView.CurrentPageIndex = 0;
_tableView.OwnerGrid.CurrentPageIndex = 0;
//tableView.Rebind();
}
}
}
}
}
and it was called by using this:
function
RadGridDebriefitClientPager_SelectedIndexChanged(sender, eventArgs) {
__doPostBack(sender.get_id(), sender.get_value());
}
Autopostback property of combo is set to false, so this event fires only.