find radtextbox and hide radtextbox in javascript
var rtbName = $find("<%= rtbName.ClientID %>");
rtbName.set_value('Hello World');
Achievement provides the only real pleasure in life
var rtbName = $find("<%= rtbName.ClientID %>");
rtbName.set_value('Hello World');
Posted by
SF
at
12:05 pm
0
comments
SUBSTRING([TheString], patindex('%[^0]%',[TheString]), 10)
Posted by
SF
at
11:44 am
0
comments
public static Color FindeOppositeColor(Color InputColour)
{
return Color.FromArgb(255 - InputColour.R, 255 - InputColour.G, 255 - InputColour.B);
}
Posted by
SF
at
1:02 pm
0
comments
sometimes i need to open radwindow from server side, I use this code snippet from Telerik:
protected void Button1_Click(object sender, EventArgs e)
{
Telerik.WebControls.RadWindow newwindow = new Telerik.WebControls.RadWindow();
newwindow.ID = "RadWindow1";
newwindow.NavigateUrl = "http://www.google.com";
newwindow.VisibleOnPageLoad = true;
RadWindowManager1.Windows.Add(newwindow);
}
newwindow.Width = Unit.Pixel(500);
newwindow.Height = Unit.Pixel(500);
newwindow.Behaviors = WindowBehaviors.Move | WindowBehaviors.Close;
Posted by
SF
at
7:45 pm
0
comments
what a frustrating 5 minutes....
try Windows key + Up key
enjoy
Posted by
SF
at
3:05 pm
0
comments
oldPath and newPath should look like "c:/FolderABC" or "~/FolderABC"
System.IO.Directory.Move(@oldPath, @newPath);
Posted by
SF
at
5:38 pm
0
comments
found this useful to keep necessary usage of disk space with sql db installed
USE myDatabase
GO
DBCC SHRINKFILE(myDatabase_log, 1)
BACKUP LOG myDatabase WITH TRUNCATE_ONLY
DBCC SHRINKFILE(myDatabase_log, 1)
Posted by
SF
at
11:16 am
0
comments
found the solution at:
http://www.telerik.com/community/forums/aspnet-ajax/editor/incorrect-rendering-of-radeditor-when-shown-with-ajax-in-initially-hidden-parent.aspx
Posted by
SF
at
11:14 am
0
comments
when I enter a random text instead of an integer into the filter, and select any option in the filter options dropdown, i get error
the solution is kind of tricky:
EnableLinqExpressioins property of grid as false
Posted by
SF
at
5:28 pm
0
comments
in my radgrid i use template as EditFormType. When I open the edit form for a grid item I want to show or hide a texbos based on the value populated in it. It can be achieved this way:
Protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item is GridEditFormItem && e.Item.IsInEditMode)
{
GridEditFormItem item = (GridEditFormItem)e.Item;
TextBox TextBox1 = (TextBox)item.FindControl("TextBox1");
//OR/// TextBox txtbox = (TextBox)item["TextBox1"].Controls[0];
if (TextBox1.Text == "your value")
{
TextBox1.Visible = false;
}
}
}
Posted by
SF
at
1:30 pm
0
comments
I use the following line in code behind to open a radwindow:
During as soon as I opened the window once, any postback will cause this window to popup again.
The solution is simple, just put the following code into page_load event.
RadWindow1.Visible = false;
Posted by
SF
at
8:56 am
0
comments
first, make sure you have "ClientDataKeyNames="Id" " added into the Master Table View of the radgrid
then implement the following javascript:
function OpenRecordBreakdown(Id)
{
var oWnd = radopen("RecordBreakDown.aspx?Id=" + , "rwRecordBreakDown");
oWnd.setSize(900, 600);
oWnd.set_behaviors(Telerik.Web.UI.WindowBehaviors.Move + Telerik.Web.UI.WindowBehaviors.Maximize + Telerik.Web.UI.WindowBehaviors.Resize + Telerik.Web.UI.WindowBehaviors.Close)
oWnd.Center();
}
var lastClickedItem = null;
var clickCalledAfterRadprompt = false;
var clickCalledAfterRadconfirm = false;
function onClientButtonClicking(sender, args) {
if (args.get_item().get_text() == "Delete") {
if (!clickCalledAfterRadconfirm) {
args.set_cancel(true);
lastClickedItem = args.get_item();
radconfirm("Are you sure you want to delete this Item?", confirmCallbackFunction);
}
}
if (args.get_item().get_text() == "Record Breakdown") {
var cell = sender.get_element().parentNode.parentNode;
rowindex = cell.rowIndex; //The row index may vary based on the grid structure.
var grid = $find("<%=rgList.ClientID %>");
var MasterTable = grid.get_masterTableView();
var id = MasterTable.get_dataItems()[rowindex - 2].getDataKeyValue("Id");
OpenRecordBreakdown(id);
args.set_cancel(true);
}
}
function confirmCallbackFunction(args) {
if (args) {
clickCalledAfterRadconfirm = true;
lastClickedItem.click();
}
else
clickCalledAfterRadconfirm = false;
lastClickedItem = null;
}
Posted by
SF
at
10:57 am
0
comments
Found this article very useful, hope it can help you as well
Using radprompt and radconfirm with Telerik navigational controls
http://www.telerik.com/support/kb/aspnet-ajax/window/using-radprompt-and-radconfirm-with-telerik-navigational-controls.aspx
Posted by
SF
at
9:34 am
0
comments
ScriptManager.RegisterStartupScript(this, typeof(abc_def_1), "openWin", "openWin('" + ParameterId.ToString() + "');", true);
provide you still need the radwindow manager in .aspx code, and the javascript "openWin"
Posted by
SF
at
4:01 pm
0
comments
"Invalid postback or callback argument. Event validation is enabled using
in my case it is caused by trying to call a radgrid.rebind() in page_load, the radgrid sits inside of a radupdatepanel. In case of postback the code contains client script which caused this security breach. After I put radgrid.rebind() inside !IsPostBack the error disappearred.
Posted by
SF
at
10:25 am
0
comments
found this class really helpful:
http://www.telerik.com/help/aspnet-ajax/grdsavingsettingsonperuserbasis.html
Posted by
SF
at
8:52 am
0
comments
When I tried to reference a public property in user control from a container page, the intellisense doesn't seem to be able to pick up the property. Ignore the red curly underline, build the parent page, it worked~
another VS2010 bug?
Posted by
SF
at
5:19 pm
0
comments
if (e.CommandName == RadGrid.UpdateCommandName)
{
GridEditableItem editable = e.Item as GridEditableItem;
int TheId= Convert.ToInt32(editable.OwnerTableView.DataKeyValues[editable.ItemIndex]["TheId"].ToString());
Posted by
SF
at
9:36 am
0
comments