...
<telerik:RibbonBarTab runat=
"server"
ID=
"tab1"
Text=
"Date"
>
<telerik:RibbonBarGroup runat=
"server"
ID=
"group1"
Text=
"Date"
>
<Items>
<telerik:RibbonBarTemplateItem>
<telerik:RadDateTimePicker runat=
"server"
ID=
"dtpDateFrom"
/>
</telerik:RibbonBarTemplateItem>
</Items>
</telerik:RibbonBarGroup>
</telerik:RibbonBarTab>
...
<
InsertItemTemplate
>
<
telerik:RadTextBox
ID
=
"RadtxtPrdNumber"
runat
=
"server"
Text
=
""
>
</
telerik:RadTextBox
>
</
InsertItemTemplate
>
DataTable purchaseOrder =
this
.PurchaseOrderData;
GridDataInsertItem item = (GridDataInsertItem)e.Item;
RadTextBox txtProductNumber = (RadTextBox)item.FindControl(
"RadtxtPrdNumber"
);
string
strProductNumbervalue = txtProductNumber.Text;
<
EditItemTemplate
>
<
telerik:RadTextBox
ID
=
"RadtxtPrdNumber"
runat
=
"server"
Text='<%# Eval("ProductNumber") %>'>
</
telerik:RadTextBox
>
</
EditItemTemplate
>
GridEditableItem editedItem = (GridEditableItem)e.Item;
string
value = editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex][
"ProductNumber"
].ToString();
DataTable ordersTable =
this
.OrderGridData;
//Locate the changed row in the DataSource
string
filter =
"ProductNumber = '"
+ value +
"'"
;
DataRow[] changedRows = ordersTable.Select(filter);
Hashtable newValues =
new
Hashtable();
//The GridTableView will fill the values from all editable columns in the hash
// in the below code newvalues is coming as empty
e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editedItem);
DataRow changedRow = changedRows[0];
changedRow.BeginEdit();
grdcostcategory.ExportSettings.ExportOnlyData =
False
grdcostcategory.ExportSettings.IgnorePaging =
False
grdcostcategory.ExportSettings.OpenInNewWindow =
True
grdcostcategory.MasterTableView.HierarchyDefaultExpanded =
False
grdcostcategory.MasterTableView.UseAllDataFields =
True
grdcostcategory.ExportSettings.FileName = TL_CF_Configuration.Constants.ExportCostCategory.ToString
grdcostcategory.MasterTableView.GetColumn(
"BtnEditImage"
).Visible =
False
grdcostcategory.MasterTableView.GetColumn(
"BtnNewClientLocationImage"
).Visible =
False
grdcostcategory.ExportSettings.HideStructureColumns =
True
grdcostcategory.GridLines = GridLines.Both
In the RadComboBox I wish to display two columns:
So in the layout page I've defined the RadComboBox like this:
<telerik:RadComboBox ID="radListBox" runat="server" OnSelectedIndexChanged="radListBox_SelectedIndexChanged">
<ItemTemplate>
<table>
<tr>
<td><%# DataBinder.Eval(Container.DataItem, "Description") %></td>
<td><%# GetPass_ContractLevel(Convert.ToInt32(Container.DataItem, "LevelIdx"))) %></td>
</tr>
</table>
</ItemTemplate>
</telerik:RadComboBox>
In my server-side code I'm populating the RadComboBox like this:
radList.DataSource = dataTable;
radList.DataTextField = "Description";
radList.DataValueField = "Master_Idx";
radList.DataBind();
for (int i = 0; i < radList.Items.Count; i++)
{
radList.Items[i].DataBind();
}
The problem is that the LevelIdx value being passed to the server-side method "GetPass_ContractLevel" is always zero. However, I've successfully implemented "helper" methods like this before which are called from the layout code. It doesn't seem to be working in this case though.
What am I doing wrong?
Robert
following somthing I have tried
var pageindex = 0;
var grid = $find("<%=rgdImportExport.ClientID %>");
var masterTable = grid.get_masterTableView();
var p = masterTable._data.PageSize * masterTable._data.PageCount;
// for (var i = 0; i < p; i++) {
// if (i == id) {
// pageindex = i / masterTable.get_pageSize()
// break;
// }
/ /}
masterTable.selectItem(id);
masterTable.set_currentPageIndex(3)
Protected
Sub
RadGrid1_NeedDataSource(
ByVal
source
As
Object
,
ByVal
e
As
Telerik.Web.UI.GridNeedDataSourceEventArgs)
Handles
RadGrid1.NeedDataSource
Dim
dtTaxatie
As
DataTable = (
New
RisicoTaxatieManager()).GetTaxatieOverzicht()
Dim
filterExpression
As
String
=
String
.Empty
Dim
columnIdent
As
String
=
String
.Empty
Dim
row
As
RisicoTaxatie.libPatientRow =
Nothing
If
(
Not
Page.IsPostBack)
Then
If
Not
Session(
"PatientRow"
)
Is
Nothing
Then
row =
DirectCast
(Session(
"PatientRow"
), RisicoTaxatie.libPatientRow)
If
Not
String
.IsNullOrEmpty(AppConfig.FilterColumn)
Then
Select
Case
AppConfig.FilterColumn
Case
"MITS"
filterExpression = IIf(
Not
row.IsMitsnummerNull(),
"(Mitsnummer='"
+ row.Mitsnummer.ToString().Trim() +
"')"
,
String
.Empty)
Case
"BSN"
filterExpression = IIf(
Not
row.IsBSNnummerNull(),
"(BSNnummer='"
+ row.BSNnummer.ToString().Trim() +
"')"
,
String
.Empty)
Case
"VIP"
filterExpression = IIf(
Not
row.IsVIPnummerNull(),
"(VIPnummer='"
+ row.VIPnummer.ToString().Trim() +
"')"
,
String
.Empty)
End
Select
End
If
End
If
End
If
If
AppConfig.FilterPatienten
And
String
.IsNullOrEmpty(filterExpression)
Then
Dim
dtPatienten
As
DataView = (
New
RisicoTaxatieManager()).GetMedewerkerPatienten(MedewerkerId)
dtPatienten.RowFilter =
"Gekoppeld=1"
Dim
filterPatientId
As
String
=
String
.Empty
For
Each
PatientRow
As
DataRowView
In
dtPatienten
filterPatientId += PatientRow(
"Id"
).ToString() +
","
Next
If
Not
String
.IsNullOrEmpty(filterPatientId)
Then
filterExpression =
String
.Format(
"PatientId IN ({0})"
, filterPatientId.Remove(filterPatientId.Length - 1, 1))
Else
filterExpression =
"PatientId IS NULL"
End
If
RadGrid1.DataSource = dtTaxatie.
Select
(filterExpression)
Else
If
String
.IsNullOrEmpty(filterExpression)
Then
RadGrid1.DataSource = dtTaxatie.DefaultView
Else
RadGrid1.DataSource = dtTaxatie.
Select
(filterExpression)
End
If
End
If
If
Not
String
.IsNullOrEmpty(filterExpression)
And
Not
row
Is
Nothing
Then
If
Not
String
.IsNullOrEmpty(AppConfig.FilterColumn)
Then
Select
Case
AppConfig.FilterColumn
Case
"MITS"
columnIdent =
"Mits"
Case
"BSN"
columnIdent =
"BSN"
Case
"VIP"
columnIdent =
"VIP"
End
Select
Else
columnIdent =
"Mits"
End
If
Dim
column
As
GridColumn = RadGrid1.MasterTableView.GetColumnSafe(columnIdent)
If
Not
column
Is
Nothing
Then
column.CurrentFilterFunction = GridKnownFunction.EqualTo
Select
Case
AppConfig.FilterColumn
Case
"MITS"
column.CurrentFilterValue = row.Mitsnummer.ToString()
Case
"BSN"
column.CurrentFilterValue = row.BSNnummer.ToString()
Case
"VIP"
column.CurrentFilterValue = row.VIPnummer.ToString()
End
Select
End
If
End
If
End
Sub
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="TaxatieOverzicht.aspx.vb"
Inherits="EFPRisicoTaxatie.TaxatieOverzicht" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
>Overzicht taxaties</
title
>
<
meta
http-equiv
=
"x-ua-compatible"
content
=
"IE=8"
/>
<
link
rel
=
"stylesheet"
href
=
"Css/RisicoTaxatie.css"
type
=
"text/css"
/>
<
script
language
=
"javascript"
type
=
"text/javascript"
>
// <!CDATA[
function RowSelected(sender, args) {
try {
var oWnd = GetRadWindow();
if (oWnd && (args.getDataKeyValue("ID") != '')) {
oWnd.close(args.getDataKeyValue("ID"))
}
} catch (err) { }
}
// ]]>
</
script
>
</
head
>
<
body
style
=
"background-color: #f0f0f0;"
>
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
>
<
Scripts
>
<
asp:ScriptReference
Path
=
"~/js/RisicoTaxatie.js"
></
asp:ScriptReference
>
</
Scripts
>
</
telerik:RadScriptManager
>
<
div
style
=
"background-color: #f0f0f0; padding: 0px; margin: 0px;"
>
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
AllowFilteringByColumn
=
"True"
AllowPaging
=
"True"
AutoGenerateColumns
=
"False"
AllowSorting
=
"True"
GridLines
=
"None"
Style="z-index: 100;
left: 0px; position: absolute; top: 0px;"
PageSize
=
"15"
Width
=
"850px"
Height
=
"454px"
EnableLinqExpressions
=
"False"
>
<
GroupingSettings
CaseSensitive
=
"false"
/>
<
MasterTableView
DataKeyNames
=
"ID"
ClientDataKeyNames
=
"ID"
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"Mitsnummer"
HeaderText
=
"Nummer"
UniqueName
=
"Mits"
AutoPostBackOnFilter
=
"true"
Visible
=
"false"
>
<
ItemStyle
Width
=
"75px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"BSNNummer"
HeaderText
=
"Nummer"
UniqueName
=
"BSN"
AutoPostBackOnFilter
=
"true"
Visible
=
"false"
>
<
ItemStyle
Width
=
"75px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"VIPNummer"
HeaderText
=
"Nummer"
UniqueName
=
"VIP"
AutoPostBackOnFilter
=
"true"
Visible
=
"false"
>
<
ItemStyle
Width
=
"75px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Referentie"
HeaderText
=
"Naam"
UniqueName
=
"Referentie"
AutoPostBackOnFilter
=
"true"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"TaxatieIdent"
HeaderText
=
"Taxatie"
UniqueName
=
"Taxatie"
AutoPostBackOnFilter
=
"true"
>
<
ItemStyle
Width
=
"90px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Datum"
HeaderText
=
"Tax.datum"
DataFormatString
=
"{0:dd-MM-yyyy}"
AllowFiltering
=
"False"
UniqueName
=
"TaxatieDatum"
>
<
ItemStyle
Width
=
"85px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"TypeIdent"
HeaderText
=
"Type"
AllowFiltering
=
"True"
UniqueName
=
"Type"
>
<
ItemStyle
Width
=
"60px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridTemplateColumn
HeaderText
=
"Kader"
AllowFiltering
=
"False"
UniqueName
=
"Kader"
>
<
ItemTemplate
>
<
asp:Label
ID
=
"lblKader"
runat
=
"server"
></
asp:Label
>
</
ItemTemplate
>
<
ItemStyle
Width
=
"120px"
/>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
HeaderText
=
"situatie"
AllowFiltering
=
"False"
UniqueName
=
"Situatie"
>
<
ItemTemplate
>
<
asp:Label
ID
=
"lblsituatie"
runat
=
"server"
></
asp:Label
>
</
ItemTemplate
>
<
ItemStyle
Width
=
"120px"
/>
</
telerik:GridTemplateColumn
>
</
Columns
>
</
MasterTableView
>
<
PagerStyle
Wrap
=
"False"
Mode
=
"NumericPages"
PagerTextFormat
=
"{4} Pagina {0} van {1}, rij {2} tot {3} van {5}"
/>
<
ClientSettings
EnablePostBackOnRowClick
=
"False"
>
<
Selecting
AllowRowSelect
=
"True"
/>
<
ClientEvents
OnRowDblClick
=
"RowSelected"
/>
</
ClientSettings
>
</
telerik:RadGrid
>
</
div
>
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
EnableAJAX
=
"true"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"RadGrid1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadGrid1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
</
form
>
</
body
>
</
html
>