Hi,
I have bound five columns to a telerik grid and the last column is in "InPlace" edit mode.
I have also enabled paging (GridPagerMode.NextPrevAndNumeric).
When the grid is loaded for the first time, the last column is displayed in edit mode.
But when I click on 2nd page, last column is also displayed in non-editable mode like other columns.
How can I make sure the last column is always displayed in edit mode (InPlace) ? Please suggest.
Your help is very much appreciated.
I have bound five columns to a telerik grid and the last column is in "InPlace" edit mode.
I have also enabled paging (GridPagerMode.NextPrevAndNumeric).
When the grid is loaded for the first time, the last column is displayed in edit mode.
But when I click on 2nd page, last column is also displayed in non-editable mode like other columns.
How can I make sure the last column is always displayed in edit mode (InPlace) ? Please suggest.
Your help is very much appreciated.
//Here is my grid configuration method
private
void
ConfigureGrid()
{
OrderTypeRankingGrid.AddNeedDataSourceEventHandler(NeedDataSource);
OrderTypeRankingGrid.AddGridCommandEventHandler(DataGrid_ItemCommand);
OrderTypeRankingGrid.AllowColumnsReorder =
false
;
OrderTypeRankingGrid.GridHeaderText =
"Order Type Ranking"
;
var masterView = OrderTypeRankingGrid.ConfigureMasterTableView(
"vDivisionOrderTypeRanking"
,
new
string
[] {
"DivisionOrderTypeRankId"
,
"CategoryCode"
,
"PurposeCode"
,
"ReasonCode"
,
"ReasonDescription"
});
masterView.AllowFilteringByColumn =
true
;
masterView.AllowSorting =
true
;
masterView.FullEditMode =
true
;
masterView.EditMode = GridEditMode.InPlace;
masterView.EnableShowHideColumns =
true
;
masterView.SetPaging(GridPagerMode.NextPrevAndNumeric);
masterView.GridTableView.ShowHeader =
true
;
masterView.ShowHeader =
true
;
masterView.ShowFooter =
true
;
masterView.ShowHeadersWhenNoRecords =
true
;
masterView.AllowPaging =
true
;
masterView.AddNgmCommandButton(NgmButtonType.Save,
"btnSave"
,
null
,
null
,
null
, Unit.Pixel(50));
masterView.AddNgmCommandButton(NgmButtonType.Cancel,
null
,
null
,
null
,
null
, Unit.Pixel(50));
masterView.CommandItemDisplay = GridCommandItemDisplay.Bottom;
if
(!IsPostBack)
//must check for postback; otherwise, columns will be duplicated
{
masterView.AddBoundColumn(
"CategoryCode"
,
"Category Code"
,
"CategoryCode"
,
true
,
false
,
true
, Unit.Percentage(7.0));
masterView.AddBoundColumn(
"PurposeCode"
,
"Purpose Code"
,
"PurposeCode"
,
true
,
false
,
true
, Unit.Percentage(7.0));
masterView.AddBoundColumn(
"ReasonCode"
,
"Reason Code"
,
"ReasonCode"
,
true
,
false
,
true
, Unit.Percentage(7.0));
masterView.AddBoundColumn(
"ReasonDescription"
,
"Reason Description"
,
"ReasonDescription"
,
true
,
false
,
true
, Unit.Percentage(7.0));
masterView.AddBoundColumn(
"OrderTypeRank"
,
"Rank"
,
"OrderTypeRank"
,
false
,
false
,
true
, Unit.Percentage(7.0));
}
}
//Here is the NeedDataSource method
protected
void
NeedDataSource(
object
source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
if
(IsPostBack)
{
if
(!e.IsFromDetailTable && (
this
.productDivision == 1 ||
this
.productDivision == 2))
{
IDivisionOrderTypeRankService divisionOrderTypeRankServiceAgent =
null
;
divisionOrderTypeRankServiceAgent = (IDivisionOrderTypeRankService)ContextRegistry.GetContext().GetObject(
"DivisionOrderTypeRankServiceAgent"
);
IList<DivisionOrderTypeRankDTO> divisionOrderTypeRankDTOs = divisionOrderTypeRankServiceAgent.GetDivisionOrderTypeRankByDivision(productDivision);
OrderTypeRankingGrid.DataSource = divisionOrderTypeRankDTOs;
}
}
}