Protected
Sub
RadGrid1_PageSizeChanged(sender
As
Object
, e
As
Telerik.Web.UI.GridPageSizeChangedEventArgs)
Handles
RadGrid1.PageSizeChanged
RadGrid1.CurrentPageIndex = 0
Session(
"LeadsPageSize"
) = e.NewPageSize
RadGrid1.Rebind()
End
Sub
Protected
Sub
RadGrid1_NeedDataSource(sender
As
Object
, e
As
Telerik.Web.UI.GridNeedDataSourceEventArgs)
Handles
RadGrid1.NeedDataSource
Dim
Customer_id
As
String
=
DirectCast
(
Me
.Parent.FindControl(
"hfCustomer_id"
), HiddenField).Value
If
Customer_id =
""
OrElse
Not
IsNumeric(Customer_id)
Then
divLeads.Visible =
False
Else
Dim
StartRow
As
Int32
Dim
EndRow
As
Int32
StartRow = RadGrid1.CurrentPageIndex * RadGrid1.PageSize + 1
EndRow = StartRow + RadGrid1.PageSize - 1
If
EndRow > RadGrid1.VirtualItemCount
Then
EndRow = RadGrid1.VirtualItemCount
If
StartRow > EndRow
Then
StartRow = EndRow
Dim
objDT
As
DataTable = Customer.SelectLeadsRangeByCustomer(Customer_id, StartRow, EndRow)
If
objDT.Rows.Count = 0
Then
divLeads.Visible =
False
Else
RadGrid1.DataSource = objDT
End
If
End
If
End
Sub
I have been try to center a dynamically create checkbox column with the checkbox centered. If you create it in design time, it is centered. When I create it dynamically in the Page_Load event I get the checkbox left justified. My code behind is in VB. I created it as follows:
Dim checkBoxColumn As NewTreeListCheckBoxColumn()
treeList.Columns.Add(checkBoxColumn)
checkBoxColumn.DataField = "Accessibility"
checkBoxColumn.UniqueName = "Accessibility"
checkBoxColumn.HeaderText = "Accessibility"
checkBoxColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Center
It works, just not centered. Any ideas as to why I cannot center the checkbox?
Thanks,
Paul
A loading panel is displayed after canceling a partial postback in javascript on the PageRequestManagers InitalizeRequest event handler. How do I get rid of the loading panel? Is there any other way to cancel the partial postback?
I have radio buttons in the command section of an ajaxified RadGrid.
<
CommandItemTemplate
>
<
asp:RadioButton
ID
=
"sortByDateOfEntryRadioButton"
AutoPostBack
=
"true"
OnCheckedChanged
=
"ReOrderTimesheetItems"
runat
=
"server"
Text
=
"Order Of Entry"
GroupName
=
"TimesheetItemSortOrder"
/>
<
asp:RadioButton
ID
=
"sortByDateOfTimesheetItemDateRadioButton"
AutoPostBack
=
"true"
OnCheckedChanged
=
"ReOrderTimesheetItems"
runat
=
"server"
Text
=
"Timesheet Date/Time"
GroupName
=
"TimesheetItemSortOrder"
/>
</
CommandItemTemplate
>
I stop the partial post back that occurs when selecting a radio button if the form is dirty. using the javascript below.
The partial postback is sucessfully canceled on the line args.set_cancel(true) but the loading panel is still displayed.
function
initRequest(sender, args) {
var
isSortingTimesheetItems =
((args.get_postBackElement().id.indexOf(
"sortByDateOfTimesheetItemDateRadioButton"
) != -1)
|| (args.get_postBackElement().id.indexOf(
"sortByDateOfEntryRadioButton"
) != -1))
if
(isSortingTimesheetItems) {
// this check has to be done here to stop the partial post back
if
(!FormIsDirty()) {
args.set_cancel(
true
);
//stop async request
return
;
}
}
}
function
RegisterScriptManagerInitializeRequestEvent() {
Sys.WebForms.PageRequestManager.getInstance().add_initializeRequest(initRequest);
}
protected
void
Play_Click(
object
sender, ImageClickEventArgs e)
{
Geek.XTV7_Time_Start = DateTime.Now.ToString();
string
sql =
""
;
var dt =
new
DataTable();
sql +=
" Select ISNull( XTV7_VideoHits, 0) AS XTV7_VideoHits From Xtrain.XTV7_2_Videos WHERE (XTV7_Videos_ID="
+ Geek.XTV7_Videos_ID.ToString() +
")"
;
dt = data.GetDataTable(sql);
Geek.XTV7_VideoHits = (Int32.Parse(dt.Rows[0][
"XTV7_VideoHits"
].ToString()) + 1).ToString();
VidHit();
RadAjaxManager1.ResponseScripts.Add(
"radopen('Forms/View/VideoViewer.aspx','RadWindow1')"
);
}
protected
void
RadGrid_ItemCommand(
object
source, GridCommandEventArgs e)
{
if
((e.Item
is
GridDataItem) && (e.CommandName ==
"Select"
))
{
var item = (GridDataItem)e.Item;
string
gvDataKey = item.GetDataKeyValue(
"XTV7_Videos_ID"
).ToString();
Geek.XTV7_Videos_ID = gvDataKey;
}
}
#region Ajax Manager Request
protected
void
RadAjaxManager1_AjaxRequest(
object
sender, AjaxRequestEventArgs e)
{
switch
(e.Argument)
{
case
"closed"
:
UpdateView();
RadGrid1.Rebind();
break
;
}
}
#endregion
function
onClose() {
$find(
"<%= RadAjaxManager.GetCurrent(Page).ClientID %>"
).ajaxRequest(
"closed"
);
}
function
RowSelected(row) {
}