protected void Page_Load(object sender, System.EventArgs e)
{
string[] sImagePath = new string[] {"/_Global/" + ModuleProperties.SiteID + "/img/content"};
radEdtContent.ImageManager.ViewPaths = sImagePath;
radEdtContent.ImageManager.UploadPaths = sImagePath;
radEdtContent.ImageManager.ContentProviderTypeName = typeof(myprovider).AssemblyQualifiedName;
}
public class myprovider : Telerik.Web.UI.Widgets.FileSystemContentProvider
{
public myprovider(HttpContext context, string[] searchPatterns, string[] viewPaths, string[] uploadPaths, string[] deletePaths, string selectedUrl, string selectedItemTag)
: base(context, searchPatterns, viewPaths, uploadPaths, deletePaths, selectedUrl, selectedItemTag)
{
}
public override string StoreFile(UploadedFile file, string path, string name, params string[] arguments)
{
//StoreFile method handles renaming of files if exists.
string fileExtention = name.Substring(name.LastIndexOf("."));
string fileNameWithoutExtension = name.Substring(0, name.IndexOf("."));
string newFileName = fileNameWithoutExtension + DateTime.UtcNow.Ticks + fileExtention;
string result = base.StoreFile(file, path, newFileName, arguments);
return result;
}
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
|
RadScheduler
There are 4000 patients. The DropDown does not allow text based searches. Users must scroll through thousands of patients to find the one they are looking for.
Is there a control, such as autocompletefield
, which better fits my needs?
http://www.telerik.com/community/forums/aspnet-ajax/grid/set-cancel-in-onrowclick-event.aspx
When trying to cancel the click, I had EnablePostBackOnRowClick="true"
And when trying to activate the click, I had: EnablePostBackOnRowClick="False"
I am using this for my grid click event:
grdGrid.ClientSettings.ClientEvents.OnRowClick = "GetDirtyGridRowClickReviewer" |
So I tried several other things from other posts and none work:
<script language="JavaScript" type="text/javascript"> |
<!-- |
function GetDirtyGridRowClickReviewer(sender, eventArgs) |
{ |
var sContinue; |
if (isDirty == 1) { |
sContinue = window.confirm("You have unsaved changes. Please select CANCEL if you would like to return to the form to save your changes. Please select OK if you wish to proceed and lose your changes."); |
if (sContinue != true) { |
//4/13/2010 |
//http://www.telerik.com/community/forums/aspnet-ajax/grid/deselecting-event-set-cancel-true-does-not-preserve-selectcolumn-status.aspx |
// below does nothing, continues to selected row... |
// var grid = $find("<%= grdReviewer.ClientID %>"); |
// var masterTableView = grid.get_masterTableView(); |
// row = masterTableView.get_dataItems()[0]; |
// setTimeout('row.set_selected(true);', 10); |
// below errors...4/12/2010 |
// says isn't supported as of 2009 |
// http://www.telerik.com/community/forums/aspnet-ajax/grid/set-cancel-in-onrowclick-event.aspx |
// eventArgs.set_cancel(true); |
// 4/9/2010 |
// below cancels everything, all buttons on page, everything. |
//$find("<%=grdReviewer.MasterTableView.ClientID %>").cancelAll(); |
return false; // cancel so they can save |
} |
} |
isDirty = 0; // reset if continue |
//http://www.telerik.com/community/forums/aspnet-ajax/grid/cancel-rowclick-event.aspx |
// 4/13/2010 set EnablePostBackOnRowClick="False" |
// below errors |
// doPostBack('<%=grdReviewer.ClientID %>'); |
// 4/13/2010 |
//http://www.telerik.com/community/forums/aspnet-ajax/grid/row-double-click-edit-and-row-click-edit-update-on-grid.aspx |
// doPostBack("<%= grdReviewer.UniqueID %>", "RowClicked:" + sender.get_masterTableView().get_dataItems()[editedRow]._itemIndexHierarchical); |
//http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/editondblclick/defaultcs.aspx |
// below errors object expected... |
var editedRow; |
editedRow = eventArgs.get_itemIndexHierarchical(); |
doPostBack("<%= grdReviewer.UniqueID %>", "RowClicked:" + sender.get_masterTableView().get_dataItems()[editedRow]._itemIndexHierarchical); |
return true; |
} |
// --> |
</script> |
Below are the links to the things I've tried.
http://www.telerik.com/community/forums/aspnet-ajax/grid/deselecting-event-set-cancel-true-does-not-preserve-selectcolumn-status.aspx
http://www.telerik.com/community/forums/aspnet-ajax/grid/set-cancel-in-onrowclick-event.aspx
http://www.telerik.com/community/forums/aspnet-ajax/grid/cancel-rowclick-event.aspx
http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/editondblclick/defaultcs.aspx
Can someone please provide a working example of canceling or activating row click client side after asking if you wish to proceed?
Thanks!
I have two standard USB panels when I press the button I need to process fields on panel one, then hide panel one and display panel two. However when I press the button, the loading panel displays and the code behind fires... but once it is complete and the loading panel is hidden again the next panel is not shown. I have stripped the code down in another temporary file to remove all style sheets, external scripts etc etc and the problem still remains...
I simply can't see where I'm being stupid, please help :)
Partial Class matt_test
Inherits System.Web.UI.Page
Protected Sub Button1_Click(sender As Object, e As System.EventArgs) Handles Button1.Click
Panel1.Visible = False
pnl_test.Visible = True
System.Threading.Thread.Sleep(2000)
End Sub
End Class
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="matt-test.aspx.vb" Inherits="matt_test" %>
<%@ 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"
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
asp:ScriptManager
ID
=
"ScriptManager1"
runat
=
"server"
SupportsPartialRendering
=
"True"
/>
<
telerik:RadCodeBlock
ID
=
"RadCodeBlock1"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
var currentLoadingPanel = null;
var currentUpdatedControl = null;
function RequestStart(sender, args) {
currentLoadingPanel = $find("<%= RadAjaxLoadingPanel1.ClientID%>");
if (args.get_eventTarget() == "<%= Button1.UniqueID %>") {
currentUpdatedControl = "<%= Panel1.ClientID %>";
currentLoadingPanel.show(currentUpdatedControl);
}
}
function ResponseEnd() {
if (currentLoadingPanel != null) {
currentLoadingPanel.hide(currentUpdatedControl);
}
currentUpdatedControl = null;
currentLoadingPanel = null;
}
</
script
>
</
telerik:RadCodeBlock
>
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"Button1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"Panel1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
<
ClientEvents
OnRequestStart
=
"RequestStart"
OnResponseEnd
=
"ResponseEnd"
/>
</
telerik:RadAjaxManager
>
<
telerik:RadAjaxLoadingPanel
ID
=
"RadAjaxLoadingPanel1"
runat
=
"server"
Skin
=
"Default"
BackgroundPosition
=
"Center"
EnableSkinTransparency
=
"true"
Visible
=
"true"
/>
<
div
id
=
"frame_mobilecontent"
>
<
asp:Panel
ID
=
"Panel1"
runat
=
"server"
class
=
"RegInputWrapper"
>
This<
br
/>
Is<
br
/>
A<
br
/>
Test<
br
/>
Panel<
br
/>
</
asp:Panel
>
<
asp:Panel
runat
=
"server"
ID
=
"pnl_test"
style
=
"background-color:Red;width:300px;height:600px;"
visible
=
"false"
>
This<
br
/>
Is<
br
/>
A<
br
/>
Test<
br
/>
Panel 2<
br
/>
</
asp:Panel
>
<
asp:Button
ID
=
"Button1"
runat
=
"server"
Text
=
"Button"
/>
</
div
>
</
form
>
</
body
>
</
html
>
<
telerik:RadGrid
ID
=
"RadGrid3"
runat
=
"server"
Width
=
"100%"
AllowAutomaticUpdates
=
"True"
AllowMultiRowEdit
=
"true"
AllowPaging
=
"false"
DataSourceID
=
"SqlDataSource3"
EnableLinqExpressions
=
"false"
GridLines
=
"None"
OnItemDataBound
=
"RadGrid3_ItemDataBound"
OnPreRender
=
"RadGrid3_PreRender"
PageSize
=
"10"
>
<
MasterTableView
Width
=
"100%"
CommandItemDisplay
=
"Bottom"
EditMode
=
"InPlace"
DataSourceID
=
"SqlDataSource3"
DataKeyNames
=
"ProductAttributeDefKey,Value"
AutoGenerateColumns
=
"false"
>
<
CommandItemTemplate
>
<
asp:LinkButton
ID
=
"btnUpdateEdited"
runat
=
"server"
CommandName
=
"UpdateEdited"
Visible='<%# RadGrid3.EditIndexes.Count > 0 %>'>Update Products</
asp:LinkButton
>
<
asp:LinkButton
ID
=
"btnCancel"
runat
=
"server"
CommandName
=
"CancelAll"
CausesValidation
=
"false"
Visible='<%# RadGrid3.EditIndexes.Count > 0 || RadGrid3.MasterTableView.IsItemInserted %>'>Cancel editing</
asp:LinkButton
>
</
CommandItemTemplate
>
<
Columns
>
<
telerik:GridTemplateColumn
DefaultInsertValue
=
"1"
DataField
=
"SortOrder"
HeaderText
=
"Sort Order"
SortExpression
=
"SortOrder"
UniqueName
=
"SortOrder"
>
<
EditItemTemplate
>
<
telerik:RadNumericTextBox
runat
=
"server"
ID
=
"tbSortOrder"
DbValue='<%# Bind("SortOrder") %>' ShowSpinButtons="true" MinValue="1" MaxValue="999" NumberFormat-DecimalDigits="0" Width="50px">
</
telerik:RadNumericTextBox
>
</
EditItemTemplate
>
<
ItemTemplate
>
<%# Eval("SortOrder")%>
</
ItemTemplate
>
<
ItemStyle
CssClass
=
"sortColumn"
/>
<
HeaderStyle
CssClass
=
"sortColumn"
/>
</
telerik:GridTemplateColumn
>
<
telerik:GridBoundColumn
DataField
=
"ProductId"
HeaderText
=
"ProductId"
SortExpression
=
"ProductId"
UniqueName
=
"ProductId"
Visible
=
"false"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"ProductAttributeDefKey"
HeaderText
=
"Def Key"
SortExpression
=
"ProductAttributeDefKey"
UniqueName
=
"ProductAttributeDefKey"
Visible
=
"false"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Name"
HeaderText
=
"Name"
SortExpression
=
"Name"
UniqueName
=
"Name"
ReadOnly
=
"true"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"AttributeDataType"
HeaderText
=
"AttributeDataType"
SortExpression
=
"AttributeDataType"
UniqueName
=
"AttributeDataType"
Visible
=
"false"
>
</
telerik:GridBoundColumn
>
<
telerik:GridTemplateColumn
DataField
=
"Value"
HeaderText
=
"Value"
SortExpression
=
"Value"
UniqueName
=
"Value"
ForceExtractValue
=
"Always"
>
<
EditItemTemplate
>
</
EditItemTemplate
>
<
ItemTemplate
>
<%# Eval("Value")%>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
</
Columns
>
<
EditFormSettings
>
<
EditColumn
ButtonType
=
"ImageButton"
/>
</
EditFormSettings
>
</
MasterTableView
>
</
telerik:RadGrid
>
<
asp:SqlDataSource
ID
=
"SqlDataSource3"
runat
=
"server"
ConnectionString
=
""
SelectCommand
=
"procProductAttribute_Select"
SelectCommandType
=
"StoredProcedure"
UpdateCommand
=
"procProductAttribute_Update"
UpdateCommandType
=
"StoredProcedure"
>
<
SelectParameters
>
<
asp:Parameter
Name
=
"ProductId"
Type
=
"Int32"
DefaultValue
=
"52964"
/>
<
asp:Parameter
Name
=
"IsCustom"
Type
=
"Boolean"
DefaultValue
=
"false"
/>
</
SelectParameters
>
<
UpdateParameters
>
<
asp:Parameter
Name
=
"ProductId"
Type
=
"Int32"
/>
<
asp:Parameter
Name
=
"ProductAttributeDefKey"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"AttributeDataType"
Type
=
"Int32"
/>
<
asp:Parameter
Name
=
"Value"
Type
=
"String"
/>
</
UpdateParameters
>
</
asp:SqlDataSource
>
protected
void
RadGrid3_PreRender(
object
sender, EventArgs e)
{
if
(!IsPostBack)
{
foreach
(GridItem item
in
RadGrid3.MasterTableView.Items)
{
if
(item
is
GridEditableItem)
{
GridEditableItem editableItem = item
as
GridDataItem;
editableItem.Edit =
true
;
}
}
RadGrid3.Rebind();
}
}
protected
void
RadGrid3_ItemDataBound(
object
sender, GridItemEventArgs e)
{
if
(e.Item
is
GridEditableItem && e.Item.IsInEditMode)
{
GridEditableItem item = (GridEditableItem)e.Item;
GridTemplateColumnEditor editor = (GridTemplateColumnEditor)item.EditManager.GetColumnEditor(
"Value"
);
TableCell cell = (TableCell)editor.ContainerControl;
Int32 id = (Int32)DataBinder.Eval(e.Item.DataItem,
"AttributeDataType"
);
String value =
null
;
if
(DataBinder.Eval(e.Item.DataItem,
"Value"
) != System.DBNull.Value) {
value = (String)DataBinder.Eval(e.Item.DataItem,
"Value"
);
}
switch
(id)
{
case
1:
CheckBox checkBox =
new
CheckBox();
checkBox.Attributes.Add(
"Value"
,
"1"
);
checkBox.Text =
"1"
;
if
(!String.IsNullOrWhiteSpace(value))
{
if
(value.Substring(0, 1) ==
"1"
|| value.Substring(0, 1).ToLower() ==
"t"
|| value.Substring(0, 1).ToLower() ==
"y"
)
{
checkBox.Checked =
true
;
}
else
{
checkBox.Checked =
false
;
}
}
cell.Controls.Add(checkBox);
break
;
case
2:
case
6:
case
7:
RadNumericTextBox numericTextBox =
new
RadNumericTextBox();
numericTextBox.ID =
"NumericTextBox1"
;
numericTextBox.ShowSpinButtons =
true
;
Int32 tempInt;
if
(Int32.TryParse(value,
out
tempInt))
{
numericTextBox.Value = tempInt;
}
cell.Controls.Add(numericTextBox);
break
;
case
3:
default
:
TextBox textBox =
new
TextBox();
textBox.ID =
"TextBox1"
;
if
(!String.IsNullOrWhiteSpace(Server.HtmlDecode(value)))
{
textBox.Text = value;
}
cell.Controls.Add(textBox);
break
;
case
4:
RadTextBox textArea =
new
RadTextBox();
textArea.ID =
"TextArea1"
;
textArea.TextMode = InputMode.MultiLine;
if
(!String.IsNullOrWhiteSpace(Server.HtmlDecode(value)))
{
textArea.Text = value;
}
cell.Controls.Add(textArea);
break
;
case
5:
RadDatePicker dp =
new
RadDatePicker();
dp.ID =
"DatePicker1"
;
DateTime tempDateTime;
if
(DateTime.TryParse(value,
out
tempDateTime))
{
dp.SelectedDate = tempDateTime;
}
cell.Controls.Add(dp);
break
;
case
8:
//lookup here
break
;
}
}
}
Have two buttons on the dialog which are “Scan Another” and “Translate”. Scan Another will
clear the scanned bet image and reset the stake to £0.00. Translate will go immediate to the
translate tab with that bet selected.
This is what right now I am using!
<
telerik:radwindowmanager
id
=
"RadWindowManagerTakeBet"
runat
=
"server"
skin
=
"Metro"
>
</
telerik:radwindowmanager
>
RadWindowManagerTakeBet.RadAlert(
"Stake Saved!"
, 330, 100,
"No Bet Stake"
,
null
,
null
);