or
protected
void
SomeButton_Click(
object
sender, EventArgs e)
{
int Questionnumber = 100// this number is actually pass through method parameter .
RadGrid1.Allowpaging = false;
RadGrid1.ReBind();
foreach
(GridDataItem item
in
grid1.Items)
{
RadioButton btn = (RadioButton)item.FindControl(
"radiobutton1"
);
string
value = item.GetDataKeyValue(
"Questionnumber
"
).ToString();
if( Convert.ToInt32(value) == Questionnumber
)RadGrid1
.CuurentPageIndex = Questionnumber
;// here I need to set something like that the selected RadioButton Corresponding
}RadGrid1.Allowpaging = true ;
RadGrid1.PageSize = 20; // If I make this Size my selected Radio button is Not Showing in DataGrid
//and if I make it 100 or above then it is Showing .
RadGrid.ReBind(); //If I make it ReBind then it is my radio button is not showing selected row in RadGrid .
}
This is very important , other wise my telerik control becomes unused. See in aspx page I don't set any
AllowPaging = true .
Pl give me any suggestion pl
One Solution may be , though the grid may have thousands of records getting from database , so see the paging where the selected row is existing , suppose radiobutton.selected row is in page 5 so start paging and load grid data from 5th page and there is option previous and next paging...something like that , how can I do
<
EditItemTemplate
>
<
telerik:RadDatePicker
ID
=
"StartDate"
runat
=
"server"
>
</
telerik:RadDatePicker
>
<
asp:CustomValidator
ControlToValidate
=
"StartDate"
ID
=
"CustomValidator2"
runat
=
"server"
ErrorMessage
=
"Please select"
OnServerValidate
=
"CustomValidator2_ServerValidate"
> </
asp:CustomValidator
>
<
EditItemTemplate
>
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; BRI/2; InfoPath.2; .NET CLR 1.1.4322; .NET4.0E; MALC)
Timestamp: Mon, 16 Apr 2012 17:03:09 UTC
Message: Object doesn't support this property or method
Line: 1765
Char: 1
Code: 0
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ComboBoxProblem.aspx.cs"
Inherits="TestBed.ComboBoxProblem" %>
<!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
></
title
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
ID
=
"rsmMain"
runat
=
"server"
>
<
Scripts
>
</
Scripts
>
</
telerik:RadScriptManager
>
<
telerik:RadScriptBlock
ID
=
"rsbMain"
runat
=
"server"
>
</
telerik:RadScriptBlock
>
<
div
>
<
telerik:RadComboBox
ID
=
"rcbTest"
runat
=
"server"
AllowCustomText
=
"false"
ChangeTextOnKeyBoardNavigation
=
"false"
EnableTextSelection
=
"true"
MarkFirstMatch
=
"true"
EmptyMessage
=
"Select..."
CloseDropDownOnBlur
=
"true"
CollapseAnimation-Type
=
"None"
ExpandAnimation-Type
=
"None"
MaxHeight
=
"200px"
>
<
Items
>
<
telerik:RadComboBoxItem
Text
=
"Apples"
Value
=
"1"
/>
<
telerik:RadComboBoxItem
Text
=
"Oranges"
Value
=
"2"
/>
<
telerik:RadComboBoxItem
Text
=
"Pears"
Value
=
"3"
/>
<
telerik:RadComboBoxItem
Text
=
"Strawberries"
Value
=
"4"
/>
<
telerik:RadComboBoxItem
Text
=
"Wild Cherries"
Value
=
"5"
/>
</
Items
>
</
telerik:RadComboBox
>
</
div
>
</
form
>
</
body
>
</
html
>
_onKeyDown:
function
(k) {
var
j = k.keyCode || k.which;
if
(j == a.Keys.Escape) {
k.preventDefault();
}
if
($telerik.isIE && j != a.Keys.Down && j != a.Keys.Up) {
this
._updateFilterText =
true
;
}
if
(!
this
._fireEvents ||
this
._ajaxRequest) {
return
;
}
if
($telerik.isIE9 && (j == 8 || j == 127)) {
this
._compensateValuePropertyChangeEvent =
true
;
}
if
(!k) {
k = event;
}
this
.raise_onClientKeyPressing(k);
this
._lastKeyCode = j;
if
(j == a.Keys.Escape &&
this
.get_dropDownVisible()) {
this
._hideDropDown(k);
return
;
}
else
{
if
(j === a.Keys.Enter) {
if
(
this
.get_dropDownVisible()) {
this
._hideDropDown(k);
}
var
g =
this
.findItemByText(
this
.get_text());
if
(
this
.get_allowCustomText() && !
this
.get_markFirstMatch() && !g) {
if
(
this
.raise_selectedIndexChanging(
null
, k) ==
false
) {
var
f =
this
.get_selectedItem();
var
m =
this
.get_highlightedItem();
if
(f) {
f.set_selected(
false
);
}
if
(m) {
m.unHighlight();
}
this
.set_selectedItem(
null
);
this
.set_selectedIndex(
null
);
this
.set_highlightedItem(
null
);
this
.raise_selectedIndexChanged(
null
, k);
var
l = { Command:
"Select"
, Index: -1 };
this
.postback(l);
}
}
else
{
this
._performSelect(
this
.get_highlightedItem(), k);
}
if
(
this
.get_markFirstMatch()) {
var
h =
this
.get_text().length;
this
.selectText(h, h);
} k.returnValue =
false
;
if
(k.preventDefault) {
k.preventDefault();
}
return
;
}
else
{
if
(j === a.Keys.Down) {
k.returnValue =
false
;
if
(k.altKey) {
this
._toggleDropDown(k);
return
;
}
this
.highlightNextItem(
null
);
if
(k.preventDefault) {
k.preventDefault();
}
return
;
}
else
{
if
(j === a.Keys.Up) {
k.returnValue =
false
;
if
(k.altKey) {
this
._toggleDropDown(k);
return
;
}
this
.highlightPreviousItem();
if
(k.preventDefault) {
k.preventDefault();
}
return
;
}
else
{
if
(j === a.Keys.Tab) {
if
(
this
.get_dropDownVisible()) {
this
._hideDropDown(k);
}
this
._raiseClientBlur(k);
this
._selectItemOnBlur(k);
// This causes the last item of RadComboBoxOne to be selected when I click on RadComboBoxTwo
this
._applyEmptyMessage();
this
._focused =
false
;
return
;
}
}
}
}
}
if
(j == a.Keys.Left || j == a.Keys.Right) {
return
;
}
if
(j >= a.Keys.Numpad0 && j <= a.Keys.Numpad9) {
j -= (a.Keys.Numpad0 - a.Keys.Zero);
}
var
d = String.fromCharCode(j);
if
(d && (!k.altKey) && !(
this
.get_enableLoadOnDemand() || !
this
.get_readOnly())) {
this
.highlightNextItem(d);
return
;
}
}
function
() {
// This is highlightMatches() which is called from _selectItemOnBlur()
if
(!
this
.get_markFirstMatch()) {
return
;
}
var
k =
this
.get_text();
var
f =
this
.getLastWord(k,
this
._getTrimStartingSpaces());
if
(
this
._getLastSeparator(k) == k.charAt(k.length - 1)) {
return
;
}
var
d =
this
.findFirstMatch(f);
if
(
this
.get_highlightedItem()) {
this
.get_highlightedItem().unHighlight();
}
if
(!d) {
if
(k && !
this
.get_allowCustomText() && !
this
.get_enableLoadOnDemand()) {
var
g =
this
._getLastSeparatorIndex(k);
if
(g < k.length - 1) {
var
l = k.substring(0, k.length - 1);
if
(l ==
""
&& $telerik.isSafari) {
var
h =
this
;
window.setTimeout(
function
() {
h.set_text(l);
}, 0);
}
else
{
this
.set_text(l);
this
.highlightMatches();
}
}
}
return
;
}
d.highlight();
d.scrollOnTop();
this
.set_value(d.get_value());
var
m;
var
j;
var
g =
this
._getLastSeparatorIndex(k);
var
e = k.substring(0, g + 1) + d.get_text();
if
(k != e) {
this
.set_text(e);
m = g + f.length + 1;
j = e.length - m;
}
else
{
if
(
this
._callbackText.length > 0) {
m = g +
this
._callbackText.length + 1;
j = k.length - m;
}
}
if
(m && j) {
this
.selectText(m, j);
}
}
<
telerik:GridCheckBoxColumn
DataField
=
"TypeDefault"
DataType
=
"System.Boolean"
FilterControlAltText
=
"Filter TypeDefault column"
HeaderText
=
"Default"
UniqueName
=
"TypeDefault"
>
</
telerik:GridCheckBoxColumn
>
<
telerik:GridCalculatedColumn
UniqueName
=
"Name"
SortExpression
=
"LastName"
HeaderText
=
"Calculated Column"
DataFields
=
"FirstName, LastName"
Expression
=
'{0} + " " + {1}'
FooterText
=
"CalculatedColumn footer"
>
</
telerik:GridCalculatedColumn
>