| function ToolbarItemClicked(sender, eventArgs) { |
| var toolbar = eventArgs.get_item().get_toolBar(); |
| var toolbarItem = eventArgs.get_item(); |
| var ctrlID = toolbar.get_attributes().getAttribute("TreeViewID"); |
| var treeview = $find(ctrlID); |
| var node = treeview.get_selected(); |
| } |
| myGrid.MasterTableView.Enabled = False |
| myGrid.MasterTableView.Enabled = False |
| myGrid.ClientSettings.AllowGroupExpandCollapse = True |
Hi,
I am working on a RadGrid that has worked perfectly up till now, I use the event below to translate the true/false returned from the database into yes/no, I have other situtions where the translation maybe more complex e.g. a specific string to another string like 'yes' = 'this item has been delivered!'
where my problem is, is that I have introduced grid paging, now the first page is formatted correctly and all subsequent pages dont have the translations in them.
void grdDelivery_ItemDataBound(object sender, GridItemEventArgs e) {
if (e.Item is GridDataItem) {
GridDataItem databounditem = e.Item as GridDataItem;
if (bool.Parse(databounditem["deliveryclosed"].Text) == false) {
databounditem[
"deliveryclosed"].Text = "No";
}
else {
databounditem[
"deliveryclosed"].Text = "Yes";
}
}
}
any help would be great.
<telerik:RadGrid ID="RadGridCompany" runat="server"
AllowFilteringByColumn="True" AutoGenerateColumns="False"
DataSourceID="EntityDataSourceCompany" GridLines="None" AllowPaging="true"
PageSize="100" onselectedindexchanged="RadGridCompany_SelectedIndexChanged"
onitemcommand="RadGridCompany_ItemCommand">
.
.
<MasterTableView DataSourceID="EntityDataSourceCompany"
FilterExpression = "(it.[OrganizationName] == 'Non Existent')">
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
<Columns>
<telerik:GridButtonColumn
CommandName="Select"
Text="Select"
UniqueName="Select">
<HeaderStyle Width="10%" />
</telerik:GridButtonColumn>
<telerik:GridBoundColumn DataField="OrganizationName" HeaderText="Company Name"
ReadOnly="True" SortExpression="OrganizationName" UniqueName="OrganizationName"
AutoPostBackOnFilter="true" CurrentFilterFunction="StartsWith" FilterControlWidth="250px" >
<HeaderStyle Width="90%" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="OrganizationID" Display="False"
HeaderText="Organization ID" ReadOnly="True" SortExpression="OrganizationID"
UniqueName="OrganizationID">
</telerik:GridBoundColumn>
</Columns>
</MasterTableView>
.
.
<asp:EntityDataSource ID="EntityDataSourceCompany" runat="server"
ConnectionString="name=LQDModel" DefaultContainerName="LQDModel"
EntitySetName="Organization" OrderBy="it.OrganizationName"
Select="it.[OrganizationName], it.[OrganizationID]">
</asp:EntityDataSource>