private class RadioButtonDateColumnTemplate : ITemplate{ protected RadioButton rButton; protected RadDatePicker datePicker; private string colname; public RadioButtonDateColumnTemplate(string cName) { colname = cName; } public void InstantiateIn(System.Web.UI.Control container) { rButton = new RadioButton(); rButton.GroupName = "ScaleButtons"; rButton.ID = "dateButton"; rButton.DataBinding += new EventHandler(rButton_DataBinding); datePicker = new RadDatePicker(); datePicker.ID = "DatePicker"; datePicker.DataBinding += new EventHandler(datePicker_DataBinding); datePicker.Load += new EventHandler(datePicker_Load); container.Controls.Add(rButton); container.Controls.Add(datePicker); } void datePicker_Load(object sender, EventArgs e) { rButton.Attributes.Add("onClick", string.Format("DateButtonClicked('{0}')", datePicker.ClientID)); } void datePicker_DataBinding(object sender, EventArgs e) { RadDatePicker dPick = (RadDatePicker)sender; GridDataItem container = (GridDataItem)dPick.NamingContainer; string date = ((DataRowView)container.DataItem)[colname].ToString(); DateTime dateTime; if (date == string.Empty) dPick.SelectedDate = null; else { DateTime.TryParse(date, out dateTime); dPick.SelectedDate = dateTime; } } void rButton_DataBinding(object sender, EventArgs e) { RadioButton rBut = (RadioButton)sender; GridDataItem container = (GridDataItem)rBut.NamingContainer; bool naChecked; bool.TryParse(((DataRowView)container.DataItem)["na"].ToString(), out naChecked); rButton.Checked = !naChecked; datePicker.Enabled = !naChecked; }}private class RadioButtonColumnTemplate : ITemplate{ protected RadioButton rButton; private string colname; public RadioButtonColumnTemplate(string cName) { colname = cName; } public void InstantiateIn(System.Web.UI.Control container) { rButton = new RadioButton(); rButton.GroupName = "ScaleButtons"; rButton.DataBinding += new EventHandler(rButton_DataBinding); if (colname == "na") { rButton.ID = "naButton"; rButton.Load += new EventHandler(rButton_Load); } container.Controls.Add(rButton); } void rButton_Load(object sender, EventArgs e) { GridDataItem gridRow = (GridDataItem)rButton.Parent.NamingContainer; string gridID = gridRow.OwnerGridID; int rowIndex = gridRow.DataSetIndex; rButton.Attributes.Add("onClick", string.Format("NaButtonClicked('{0}',{1},'Date')", gridID, rowIndex)); } void rButton_DataBinding(object sender, EventArgs e) { RadioButton rBut = (RadioButton)sender; GridDataItem container = (GridDataItem)rBut.NamingContainer; bool check; bool.TryParse(((DataRowView)container.DataItem)[colname].ToString(), out check); rButton.Checked = check; }}protected void CategoriesPanelBar_Init(object sender, EventArgs e){ DataTable cTypes = GetCapabilityTypes(false); DataTable cCategories = GetCapabilityCategories(); RadPanelBar rpbCapabilityCategories = (RadPanelBar)sender; foreach (DataRow typeRow in cTypes.Rows) { string typeName = typeRow["typename"].ToString(); string typeID = typeRow["id"].ToString(); RadPanelItem typeItem = new RadPanelItem(typeName); DataRow[] categoriesByType = cCategories.Select(string.Format("type = {0}", typeID)); foreach (DataRow categoryRow in categoriesByType) { string categoryName = categoryRow["categoryname"].ToString(); int categoryID = int.Parse(categoryRow["id"].ToString()); RadPanelItem categoryItem = new RadPanelItem(categoryName); categoryItem.BackColor = System.Drawing.Color.LightBlue; RadGrid rgItems = new RadGrid(); rgItems.AutoGenerateColumns = false; rgItems.AllowMultiRowEdit = true; rgItems.MasterTableView.EditMode = GridEditMode.InPlace; rgItems.PreRender += new EventHandler(rgItems_PreRender); BuildCapabilityItemsGridByCategory(rgItems, categoryID); categoryItem.Controls.Add(rgItems); typeItem.Items.Add(categoryItem); } rpbCapabilityCategories.Items.Add(typeItem); }}...
DataTable dtCapabilities = GetCapabilityItemsByCategoryAndSite(category, site);...dtCapabilities.Columns.Add("na", System.Type.GetType("System.Boolean"));GridTemplateColumn naCol = new GridTemplateColumn();naCol.ItemTemplate = new RadioButtonColumnTemplate("na");naCol.HeaderText = "N/A ";naCol.DataField = "na";rgItems.Columns.Insert(rgItems.Columns.Count, naCol);...GridTemplateColumn dateCol = new GridTemplateColumn(); dateCol.ItemTemplate = new RadioButtonDateColumnTemplate("date");dateCol.HeaderText = "Date";dateCol.DataField = "date";dateCol.UniqueName = "Date";rgItems.Columns.Insert(rgItems.Columns.Count, dateCol);...rgItems.DataSource = dtCapabilities;rgItems.DataBind();function DateButtonClicked(datePickerId) { var datePicker = $find(datePickerId) datePicker.set_enabled(true);}function NaButtonClicked(gridID, index, colName) { var gridView = $find(gridID); var masterTable = gridView.get_masterTableView(); var cell = masterTable.getCellByColumnUniqueName(masterTable.get_dataItems()[index], colName) if (cell != null) { var datePickers = cell.getElementsByClassName('RadPicker RadPicker_Default'); for (i = 0; i < datePickers.length; i++) { var idString = datePickers[i].innerHTML; var startString = "id=\""; var endString = "\""; var startIndex = idString.indexOf(startString) + startString.length; var endIndex = idString.indexOf(endString, startIndex); var datePickerId = idString.substring(startIndex, endIndex); } } var datePicker = $find(datePickerId) datePicker.set_enabled(false);}<script type="text/javascript"> function chkFilter_CheckedChanged(sender, args) { var tableView = $find("<%# TryCast(Container, GridItem).OwnerTableView.ClientID %>"); tableView.filter("column", args.get_item().get_value(), "EqualTo"); }</script>
How to solve change the radgrid default tool tip when site has mutiple langaues?
For example, when french user look at the grid, they want to see tool tip"sort" word in french.
I tried Mygrid.Culture =
new System.Globalization.CultureInfo("fr-fr"); it doesn't work.
var divReviewAllPers = getElementId('divReviewAllPers');
for (i = 1; i < arrItems.length; i++) { strAllPersText += '<u>Item #' + i + '</u><br />'; if (i == parseInt(hidItemEdit.value)) { // This is the item being edited, so update the master string with the textbox values var strNewPersTextItem = '';
var strItemLines = arrItems[i]; for (x = 0; x < arrLines.length; x++) { if (x < getElementId('hidNumLines').value) { if (strLine == '') { strAllPersText += 'Line ' + (x + 1) + ' - [LINE IS BLANK]<br />'; } else { strAllPersText += 'Line ' + (x + 1) + ' - ' + strLine + '<br />'; } } strNewPersTextItem += 'Line ' + (x + 1) + ' - [LINE IS BLANK]<br />'; } } else { // This is not the item being edited, so put the existing data back in the master string if (arrItems[i].length > 0) { for (y = 0; y < arrLines.length; y++) { if (y < getElementId('hidNumLines').value) { if (arrLines[y] == '') { strAllPersText += 'Line ' + (y + 1) + ' - [LINE IS BLANK]<br />'; } else { strAllPersText += 'Line ' + (y + 1) + ' - ' + arrLines[y] + '<br />'; } } } } } } if (intMode == 1) { strNewPersTextItem = '<u>Item #' + i + '</u><br />' + strNewPersTextItem; divReviewAllPers.innerHTML = strAllPersText + strNewPersTextItem; divReviewAllPers2.innerHTML = strAllPersText + strNewPersTextItem; } else { divReviewAllPers.innerHTML = strAllPersText; divReviewAllPers2.innerHTML = strAllPersText; }divReviewAllPers.innerHTML, but it doesnt appear when I trigger the tooltip. <center> <a href="#" id="lnkReviewAllPers" class="link-color">Click here to review all personalization text</a> </center> <rad:RadToolTip ID="RadToolTip7" Skin="Default" runat="server" TargetControlID="lnkReviewAllPers" ShowEvent="OnClick" IsClientID="true" RelativeTo="Element" Position="BottomCenter" Width="400px" Height="225px" Animation="Fade" ManualClose="true"> <div id="divReviewAllPers" style="height:215px; overflow:auto;"></div> </rad:RadToolTip> cat1
- item 1
- item 2
- item 3
cat2
- item 4
Right now I bind tree view from server side manually, but I want to use for example ObjectDataSource or SqlDataSource instead.

I have written this jQuery code that allows a single RadEditor instance to be used to edit multiple different editable areas (editable bodies) on the same page. It is very efficient and vastly improves page loading time but there are a few problems that I am unable to resolve and I hope you may be able to help.
To use the jQuery code, the markup on the page needs to be similar to this:
| <div class="SKEditorWrapper"> |
| <telerik:RadEditor using PageTop Toolbar goes here/> |
| </div> |
| <div id="BodyBlockPanel1" class="SKEditableBody"> |
| <textarea name="BodyBlockHTML1" rows="2" cols="20" id="BodyBlockHTML1" class="SKEditableBodyText" style="display:none;"> |
| This is editable body 1. |
| </textarea> |
| </div> |
| <div id="BodyBlockPanel2" class="SKEditableBody"> |
| <textarea name="BodyBlockHTML2" rows="2" cols="20" id="BodyBlockHTML2" class="SKEditableBodyText" style="display:none;"> |
| This is editable body 2. |
| </textarea> |
| </div> |
| <!-- ... and so on. We have 40 editable bodies on our page.--> |
| $(document).ready(function(){ |
| var $bodyBlock; |
| var $editorBody; |
| var firstEdit = true; |
| var $prevEditableBody = null; |
| //Hide the RadEditor and its wrapper. |
| $('SKEditorWrapper').hide(); |
| var $radEditor = $('div.RadEditor').hide(); |
| var saveEditorContent = function(){ |
| //Copy the content from the RadEditor back into the TextArea. |
| var editor = $find($radEditor.attr('id')); |
| var edContent = editor.get_html('true'); |
| $prevEditableBody |
| .find('.SKEditableBodyText') |
| .val(edContent); |
| }; |
| var moveEditorToBody = function(event){ |
| var $editorPanel = $('.SKEditorWrapper'); |
| var $editableBody = $(this); |
| //Switch off the mouse-over styling on all editable bodies on the page. |
| $('.SKEditableBody') |
| .removeClass('SKEditableBodyHighlight'); |
| //Attach highlighter class and mousout handlers to transfer editor content |
| //to TextArea when the user clicks 'save'. |
| $editableBody |
| .addClass('SKEditableBodyHighlight') |
| .unbind('mouseenter mouseleave') |
| .mouseleave(saveEditorContent) |
| .blur(saveEditorContent); |
| //Remove the RadEditor from its current position in the DOM, replace |
| //it with a DIV to render the markup and copy the editor content into |
| //the TextArea ready for AJAX postback. |
| if (firstEdit){ |
| firstEdit = false; |
| $editorPanel.remove(); |
| } |
| else { |
| var editor = $find($radEditor.attr('id')); |
| var edContent = editor.get_html('true'); |
| $('<div/>') |
| .addClass('SKEditableBodyBlockContent') |
| .html(edContent) |
| .replaceAll($editorPanel); |
| saveEditorContent(); |
| } |
| //Insert the RadEditor into its new position in the DOM, i.e. in the |
| //editable body the user clicked on. |
| $editableBody.append($editorPanel); |
| //Find the DIV showing the rendered markup of this editable body and |
| //replace it with the RadEditor. |
| var editor = $find($radEditor.attr('id')); |
| $bodyBlock = $(event.target).closest('.SKEditableBodyBlockContent'); |
| editor.set_html($bodyBlock.html()); |
| var editorBody = document.all ? editor.get_document().body : editor.get_document(); |
| $editorBody = $(editorBody); |
| $bodyBlock.remove(); |
| //Show the RadEditor and its wrapper. |
| $editorPanel.show(); |
| $radEditor.show(); |
| //Delay a short time and then apply focus to editor to cause text cursor |
| //to be displayed in the RadEditor. |
| setTimeout(function(){ |
| editor.setFocus(); |
| },200); |
| //Prevent the click event from activating any links from anchor tags in the |
| //editable body. |
| event.preventDefault(); |
| //Re-Attach click and hover handlers to the editable body that was being |
| //edited previously. |
| if ($prevEditableBody){ |
| $prevEditableBody |
| .one('click', moveEditorToBody) |
| .unbind('mouseenter mouseleave') |
| .hover(function(){ |
| $(this).addClass('SKEditableBodyHighlight'); |
| }, function(){ |
| $(this).removeClass('SKEditableBodyHighlight'); |
| }); |
| } |
| $prevEditableBody = $editableBody; |
| }; |
| //Find the TextAreas for every editable body, hide them and insert a |
| //DIV to show their rendered markup. |
| $('.SKEditableBodyText').each(function(index){ |
| $(this).hide(); |
| $('<div/>') |
| .addClass('SKEditableBodyBlockContent') |
| .html($(this).val()) |
| .insertAfter($(this)); |
| }); |
| //Make the editable bodies editable, using single RadEditor, when the user |
| //clicks them and attach mouse-overs to indicate which bodies are editable. |
| $('.SKEditableBody') |
| .one('click', moveEditorToBody) |
| .hover(function(){ |
| $(this).addClass('SKEditableBodyHighlight'); |
| }, function(){ |
| $(this).removeClass('SKEditableBodyHighlight'); |
| }); |
| }); |
I hope you can help, as this would be a very efficient solution to the problem of having multiple editable areas on a single page.