Hi
I am trying to reterive a value of hidden column (OrderDate) in details table from back end and the value I am getting is
Please note that I am using Telerik version 2016.1.225.45 and the below code is in my web.config
<
add
key
=
"BindGridInvisibleColumns"
value
=
"true"
/>
ASPX Code:
<
telerik:RadGrid
Skin
=
"Office2007"
ID
=
"RadGrid1"
runat
=
"server"
ShowStatusBar
=
"true"
AutoGenerateColumns
=
"False"
PageSize
=
"7"
AllowSorting
=
"True"
AllowMultiRowSelection
=
"False"
AllowPaging
=
"True"
CellPadding
=
"1"
OnDetailTableDataBind
=
"RadGrid1_DetailTableDataBind"
OnNeedDataSource
=
"RadGrid1_NeedDataSource"
OnItemCommand
=
"RadGrid1_ItemCommand"
OnPreRender
=
"RadGrid1_PreRender"
Style
=
"padding: 3px; margin: 3px;"
>
<
HeaderStyle
CssClass
=
"RadGridHeader"
/>
<
MasterTableView
Name
=
"master"
DataKeyNames
=
"CustomerID"
AutoGenerateColumns
=
"false"
NoMasterRecordsText
=
"No records meet the search criteria."
>
<
DetailTables
>
<
telerik:GridTableView
AllowPaging
=
"false"
DataMember
=
"OrderDrillDown"
DataKeyNames
=
"OrderID,CustomerID"
runat
=
"server"
Name
=
"Orders"
Width
=
"100%"
AllowMultiRowSelection
=
"false"
CommandItemDisplay
=
"Top"
NoDetailRecordsText
=
"No Exclusions."
>
<
Columns
>
<
telerik:GridBoundColumn
SortExpression
=
"OrderID"
HeaderText
=
"OrderID"
HeaderButtonType
=
"TextButton"
DataField
=
"OrderID"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
SortExpression
=
"OrderDate"
HeaderText
=
"Date Ordered"
HeaderButtonType
=
"TextButton"
DataField
=
"OrderDate"
UniqueName
=
"OrderDate"
DataFormatString
=
"{0:D}"
Visible
=
"false"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
SortExpression
=
"Freight"
HeaderText
=
"Freight"
HeaderButtonType
=
"TextButton"
DataField
=
"Freight"
UniqueName
=
"Freight"
>
</
telerik:GridBoundColumn
>
<
telerik:GridButtonColumn
ButtonType
=
"LinkButton"
UniqueName
=
"Delete"
Text
=
"Delete"
CommandName
=
"Delete"
>
<
ItemStyle
HorizontalAlign
=
"Center"
Width
=
"10%"
/>
</
telerik:GridButtonColumn
>
</
Columns
>
</
telerik:GridTableView
>
</
DetailTables
>
<
Columns
>
<
telerik:GridBoundColumn
SortExpression
=
"CustomerID"
HeaderText
=
"CustomerID"
HeaderButtonType
=
"TextButton"
DataField
=
"CustomerID"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
SortExpression
=
"ContactName"
HeaderText
=
"Contact Name"
HeaderButtonType
=
"TextButton"
DataField
=
"ContactName"
Visible
=
"false"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
SortExpression
=
"CompanyName"
HeaderText
=
"Company"
HeaderButtonType
=
"TextButton"
DataField
=
"CompanyName"
>
</
telerik:GridBoundColumn
>
<
telerik:GridButtonColumn
ButtonType
=
"LinkButton"
UniqueName
=
"DeleteHac"
Text
=
"Delete"
CommandName
=
"DeleteHac"
>
<
ItemStyle
HorizontalAlign
=
"Center"
Width
=
"10%"
/>
</
telerik:GridButtonColumn
>
</
Columns
>
</
MasterTableView
>
<
PagerStyle
Mode
=
"NextPrevAndNumeric"
/>
<
ClientSettings
EnableRowHoverStyle
=
"True"
EnablePostBackOnRowClick
=
"false"
>
<
Selecting
AllowRowSelect
=
"false"
/>
</
ClientSettings
>
</
telerik:RadGrid
>
Code behind:
protected
void
RadGrid1_ItemCommand(
object
sender, GridCommandEventArgs e)
{
GridDataItem selectedItem = (GridDataItem)e.Item;
if
(e.CommandName ==
"Delete"
)
{
var check = selectedItem[
"OrderDate"
].Text;
}
else
if
(e.CommandName ==
"DeleteHac"
)
{
var check1 = selectedItem[
"ContactName"
].Text;
}
}
When trying to get OrderDate value I am getting as value but I am getting the same value when the columns visiblity is set to true.
I can confirm this was working fine when the Telerik UI version was 2015.1.401.45
Also, I found a workaround for this by using Display instead of Visible, but do you think that is the only workaround or is this a known bug?
Thanks
Hazersha