Hi guys,
I've come across an issue and I was hopnig you could let me know if I'm doing something wrong or if there is a problem here.
I have a radgrid all set-up correctly. In a javascript function I need to obtain the values of the selected row, this works fine for all columns except for a column which isn't visible.
Is there a different way to retrieve values from columns where the visibility is set to false?
Grid
Javascript
The alert of the pagetitle returns the object fine where as the seachvalue always returns null.
Thanks.
I've come across an issue and I was hopnig you could let me know if I'm doing something wrong or if there is a problem here.
I have a radgrid all set-up correctly. In a javascript function I need to obtain the values of the selected row, this works fine for all columns except for a column which isn't visible.
Is there a different way to retrieve values from columns where the visibility is set to false?
Grid
<
telerik:RadGrid
runat
=
"server"
ID
=
"rgLzHits"
AutoGenerateColumns
=
"False"
>
<
MasterTableView
PagerStyle-Mode
=
"NumericPages"
EditMode
=
"EditForms"
DataKeyNames
=
"displayid"
>
<
PagerStyle
Mode
=
"NextPrevAndNumeric"
></
PagerStyle
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"displayid"
HeaderText
=
"displayid"
UniqueName
=
"displayid"
visible
=
"False"
ReadOnly
=
"true"
ItemStyle
Width
=
"300px"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"displayname"
HeaderText
=
"Landing Zone"
UniqueName
=
"displayname"
visible
=
"True"
ReadOnly
=
"true"
ItemStyle-Width
=
"300px"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"totalhits"
HeaderText
=
"Total"
UniqueName
=
"totalhits"
visible
=
"True"
ReadOnly
=
"true"
ItemStyle-Width
=
"300px"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"distincthit"
HeaderText
=
"Distinct"
UniqueName
=
"distincthit"
visible
=
"True"
ReadOnly
=
"true"
ItemStyle-Width
=
"50px"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"distinctpercent"
HeaderText
=
"Distinct %"
UniqueName
=
"distinctpercent"
visible
=
"True"
ReadOnly
=
"true"
ItemStyle-Width
=
"50px"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"AvgRating"
HeaderText
=
"Avg Rating"
UniqueName
=
"AvgRating"
visible
=
"True"
ReadOnly
=
"true"
ItemStyle-Width
=
"100px"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"CatName"
HeaderText
=
"Category Name"
UniqueName
=
"CatName"
visible
=
"True"
ReadOnly
=
"true"
ItemStyle-Width
=
"100px"
>
</
telerik:GridBoundColumn
>
</
Columns
>
<
DetailTables
>
<
telerik:GridTableView
runat
=
"server"
Name
=
"LZHitsContacts"
AutoGenerateColumns
=
"false"
NoDetailRecordsText
=
"No results exist for this contact"
>
<
PagerStyle
Mode
=
"NextPrevAndNumeric"
></
PagerStyle
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"Firstname"
HeaderText
=
"First Name"
UniqueName
=
"Firstname"
visible
=
"True"
ReadOnly
=
"true"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Lastname"
HeaderText
=
"Last Name"
UniqueName
=
"Lastname"
visible
=
"True"
ReadOnly
=
"true"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"EmailLogin"
HeaderText
=
"Email Address"
UniqueName
=
"EmailLogin"
visible
=
"True"
ReadOnly
=
"true"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"eventdate"
HeaderText
=
"Event Date"
UniqueName
=
"eventdate"
visible
=
"True"
ReadOnly
=
"true"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"contactrating"
HeaderText
=
"Contact Rating"
UniqueName
=
"eventdate"
visible
=
"True"
ReadOnly
=
"true"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"SocialMedia"
HeaderText
=
"Social Share"
UniqueName
=
"SocialMedia"
visible
=
"True"
ReadOnly
=
"true"
>
</
telerik:GridBoundColumn
>
</
Columns
>
</
telerik:GridTableView
>
</
DetailTables
>
</
MasterTableView
>
<
ClientSettings
EnableRowHoverStyle
=
"True"
>
<
Selecting
AllowRowSelect
=
"True"
></
Selecting
>
</
ClientSettings
>
</
telerik:RadGrid
>
Javascript
var grid = $find("<%=rgLzHits.ClientID %>");
var MasterTable = grid.get_masterTableView();
var selectedRows = MasterTable.get_selectedItems();
if(selectedRows != -1)
{
for (var i = 0; i < selectedRows.length; i++) {
var row = selectedRows[i];
var SearchValue = MasterTable.getCellByColumnUniqueName(row, "displayid");
var PageTitle = MasterTable.getCellByColumnUniqueName(row, "displayname");
}
alert(SearchValue);
alert(PageTitle);
The alert of the pagetitle returns the object fine where as the seachvalue always returns null.
Thanks.