Hello to the forum!
I am new to Telerik but also to .NET framework, coming from a Java tech. background ... so i am the same moment implementing but also learning.
Fortunately both .NET framework and tools but also Telerik UI for ASP.NET AJAX are quite handy and easy to understand and use.
My issue description is the following:
I am building a complex webform .aspx page with quite alot of telerik controls (radhtmlcharts mainly, radcodeblocks, radtbs etc.). I have also a radbutton "Refresh", using which i am passing some parameters to vb page code and recalculate and redraw (ajaxmanager, ajaxloadingpanel) several elements. I use this technique to redraw all my charts inside an ajaxloading panel however i can not use an ajax loading panel to redraw some page parts (code variables) that are inside RadCodeBlocks.
Code inside RadCodeBlocks is executed and all variables are calculated upon button submission, what i am trying to achieve is to have the ajax loading icon/effects to be display over my RadCodeBlocks. You can see exactly what i mean if you check the screenshot attached.
Here is some relevant code from the .aspx page:
<%@ Page Language="VB" AutoEventWireup="true" CodeFile="CorporateView2.aspx.vb" Inherits="CorporateView2" %><%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %><body> <form id="form1" runat="server"> ....<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="RadButton1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadHtmlChartAllExamsCountry" LoadingPanelID="AjaxLoadingPanel1" /><telerik:AjaxUpdatedControl ControlID="RadCodeBlock1" LoadingPanelID="AjaxLoadingPanel1" /></telerik:RadAjaxManager> <telerik:RadAjaxLoadingPanel ID="AjaxLoadingPanel1" runat="server" Skin="BlackMetroTouch"> </telerik:RadAjaxLoadingPanel><div class="container"><div class="boxed one"> <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> <div class="title">Total Number of Exams</div> <div class="maincon"> <%= TotalNumberOfExams %> </div> <div class="sub">On pace for 9898</div> <div class="progress">+3.2%</div> </telerik:RadCodeBlock> </div><div class="col3"> <telerik:RadHtmlChart runat="server" ID="RadHtmlChartAllExamsCountry" Skin="Black" Height="270"> <Appearance> <FillStyle BackgroundColor="#262626"></FillStyle> </Appearance> <ChartTitle Text="Total Number of Exams"> <Appearance> <TextStyle Color="#7f7f7f" FontSize="18" FontFamily="Arial,sans-serif" Margin="5 0 0 0" Padding="0" Bold="true" Italic="false" /> </Appearance> </ChartTitle> <Legend> <Appearance Position="Bottom" Align="Center" Visible="true" OffsetY="0"> <TextStyle Color="#8f8686" Padding="0" Margin="0" /> </Appearance> </Legend> <PlotArea> <Series> <telerik:DonutSeries Name="Country" DataFieldY="ProtocolsCountPerc" StartAngle="90" NameField="Country"> <TooltipsAppearance DataFormatString="{0:0,0.0}%" /> <LabelsAppearance Visible="true" DataFormatString="{0}" Color="#ffffff" DataField="ProtocolsCount" /> <Appearance FillStyle-BackgroundColor="#336ca6" Overlay-Gradient="Glass"></Appearance> </telerik:DonutSeries> </Series> <YAxis> </YAxis> </PlotArea> </telerik:RadHtmlChart> </div>Is it possible to have the ajax loading effects (icon etc.) over my RadCodeBlock? Do i have to use another telerik control to display variables from my vb code page or some other code blocks?
Thanks!
Hello there,
I have combox, I am using a treeview to populate its data. When I am selecting the combobox it throws me the following error.
OS - os version: OS X EI Captain version 10.11.2
browser - safari version: 9.0.2 (11601.3.9)
Error
Failed to load resource: Could not connect to the server.
_initRightToLeftScriptResource.axd:8396TypeError: null is not an object (evaluating 'c.set_additionalQueryString')
_initRightToLeftScriptResource.axd:8395
initializeScriptResource.axd:8332
endUpdateTelerik.Web.UI.WebResource.axd:2:49050
endCreateComponentsTelerik.Web.UI.WebResource.axd:2:63458
_raiseInitTelerik.Web.UI.WebResource.axd:2:65559
_doInitializeTelerik.Web.UI.WebResource.axd:2:63974
(anonymous function)Telerik.Web.UI.WebResource.axd:2:65784
(anonymous function)Telerik.Web.UI.WebResource.axd:2:50713
pTelerik.Web.UI.WebResource.axd:2:558
_2PassTelerik.Web.UI.WebResource.axd:2:50697
FTelerik.Web.UI.WebResource.axd:2:1539
dTelerik.Web.UI.WebResource.axd:2:1898
cTelerik.Web.UI.WebResource.axd:2:1294

We have nearly 160+ records in Telerik Grid added to aspx page and if the number of records in the database is going to be increased, it is taking lot of time to execute the DataBind() method executing line even though the SP is getting the data in less time. Please let us know the reason for this Telerik Grid behaviour and also the solution, if any to resolve this...
Regards:
Ravi Chandra.D

I have a RadView and I add data and controls to it. There is a checkbox and two labels. I also add in a Rad Panel to allow for collapse/expand of a RadEditor. All seems to work, except the click event. I need two clicks to expand the RadPanelItem (once it seems to get focus and then the second to open) This only happens once - after that a single click expands and then a single click collapses the RadPanel. Also the down arrow disappears.
How can I stop the initial two click requirement?
example asp
<asp:WizardStep ID="wsoptionQuestions" StepType="Step" Title="option Questions" runat="server"> <h3 style="background-color: #4D85AC;"> <asp:Literal ID="litoptionQuestionsTitle" runat="server">option Questions</asp:Literal></h3> <p class="instructionBlue"> <asp:Literal ID="litoptionQuestionsInstructions" runat="server">You may want to collect option.</asp:Literal></p> <div class="selectAll"> <asp:LinkButton ID="lboptionQuestionSelectAll" CausesValidation="false" ToolTip="Click here to select all option questions" runat="server">Select All</asp:LinkButton> | <asp:LinkButton ID="lboptionQuestionClearAll" CausesValidation="false" ToolTip="Click here to unselect all option questions" runat="server">Clear All</asp:LinkButton> </div> <telerik:RadListView ID="lvoptionQuestions" DataKeyNames="optionQuestionID" ItemPlaceholderID="itemPlaceHolder" runat="server"> <LayoutTemplate> <fieldset> <asp:PlaceHolder ID="itemPlaceholder" runat="server"></asp:PlaceHolder> </fieldset> </LayoutTemplate> <ItemTemplate> <telerik:RadPanelBar ID="RadPanelBar1" runat="server" Skin="Telerik" Width="100%" ExpandMode="FullExpandedItem"> <Items> <telerik:RadPanelItem ID="RadPanelItem" runat="server" Enabled="True"> <Items> <telerik:RadPanelItem ID="RadPanelItemItem" runat="server" /> </Items> <ItemTemplate> <div class="module" style="width: 100%; float: left"> <asp:Table ID="tbloptionQuestion" CellPadding="0" CellSpacing="0" CssClass="formTable" runat="server"> <asp:TableRow CssClass="formRow"> <asp:TableCell CssClass="formPrompt" Style="width: 4%"> <asp:CheckBox ID="cboptionQuestionSelected" ToolTip="Check this box to select this option question" OnCheckedChanged="cboptionQuestion_CheckedChanged" runat="server" /> </asp:TableCell> <asp:TableCell CssClass="formPrompt" Style="width: 4%"> <asp:Label ID="lbloptionQuestionOrder" runat="server"></asp:Label> </asp:TableCell> <asp:TableCell CssClass="formValue" Style="width: 90%"> <asp:Label ID="lbloptionQuestion" runat="server"></asp:Label><asp:Label ID="lbloptionQuestionDisabled" Enabled="false" Text="<br />This question is not available for this location." Visible="false" runat="server"></asp:Label> </asp:TableCell> </asp:TableRow> </asp:Table> <!-- Empty template to suppress global template --> </div> </ItemTemplate> </telerik:RadPanelItem> </Items> <ItemTemplate> <div class="module" style="width: 100%; float: left"> <asp:HiddenField ID="hfoptionQuestionName" runat="server" Value='<%#Eval("optionQuestionShort")%>' /> <asp:Table ID="tbloptionQuestionDisclaimer" CellPadding="0" CellSpacing="0" CssClass="formTable" runat="server"> <asp:TableRow CssClass="formRowShaded"> <asp:TableCell Style="width: 99%" ColumnSpan="3"> <p class="instructionBlue"> <asp:Literal ID="litoptionQuestionDisclaimer" runat="server">If you have selected any option.</asp:Literal> <asp:Literal ID="litoptionQuestionDisclaimerDefault" runat="server">Click on the DEFAULT button to import the default text for this disclaimer.</asp:Literal> </p> </asp:TableCell> </asp:TableRow> <asp:TableRow CssClass="formRowShaded"> <asp:TableCell Style="width: 99%" ColumnSpan="3"> <strong> <asp:Literal ID="litoptionDisclaimerPrompt" runat="server">option Disclaimer</asp:Literal>:</strong> <asp:CustomValidator ID="cvoptionDisclaimer" ControlToValidate="tboptionDisclaimer" CssClass="error" Display="Dynamic" ErrorMessage="<br />You have selected option questions. You must also provide a disclaimer." ForeColor="" SetFocusOnError="true" ValidateEmptyText="true" runat="server"></asp:CustomValidator> <telerik:RadEditor ID="radoptionDisclaimer" AutoResizeHeight="false" BorderColor="#4D85AC" BorderStyle="Solid" BorderWidth="1px" ContentAreaCssFile="~/app_themes/editor.css" EditModes="Design" ExternalDialogsPath="~/RadEditorDialogs/EditorDialogs/" EnableEmbeddedSkins="true" Height="180px" StripFormattingOptions="ConvertWordLists,Css,MSWordNoMargins,Span" Skin="Metro" Width="99%" runat="server" OnClientLoad="OnClientLoad"> <CssFiles> <telerik:EditorCssFile Value="~/app_themes/editor.css" /> </CssFiles> <Tools> <telerik:EditorToolGroup Tag="AppearanceToolbar"> <telerik:EditorDropDown Name="FormatBlock" Text="Normal"> </telerik:EditorDropDown> <telerik:EditorDropDown Name="FontName" Text="Font"> </telerik:EditorDropDown> <telerik:EditorDropDown Name="RealFontSize" Text="Size"> </telerik:EditorDropDown> <telerik:EditorTool Name="StripAll" /> </telerik:EditorToolGroup> <telerik:EditorToolGroup Tag="ColorToolbar"> <telerik:EditorSplitButton Name="ForeColor" Text="Color"> </telerik:EditorSplitButton> <telerik:EditorSplitButton Name="BackColor" Text="Background"> </telerik:EditorSplitButton> </telerik:EditorToolGroup> <telerik:EditorToolGroup Tag="LinkToolbar"> <telerik:EditorTool Name="LinkManager" Text="Change Link" /> </telerik:EditorToolGroup> <telerik:EditorToolGroup Tag="AlignmentToolbar"> <telerik:EditorTool Name="JustifyLeft" /> <telerik:EditorTool Name="JustifyCenter" /> <telerik:EditorTool Name="JustifyRight" /> <telerik:EditorTool Name="JustifyFull" /> </telerik:EditorToolGroup> <telerik:EditorToolGroup Tag="IndentToolbar"> <telerik:EditorTool Name="Indent" /> <telerik:EditorTool Name="Outdent" /> </telerik:EditorToolGroup> <telerik:EditorToolGroup Tag="ListToolbar"> <telerik:EditorTool Name="InsertOrderedList" /> <telerik:EditorTool Name="InsertUnorderedList" /> </telerik:EditorToolGroup> <telerik:EditorToolGroup Tag="LineToolbar"> <telerik:EditorTool Name="InsertHorizontalRule" /> </telerik:EditorToolGroup> <telerik:EditorToolGroup Tag="FormatToolbar"> <telerik:EditorSeparator /> <telerik:EditorTool Name="Bold" ShortCut="CTRL+B / CMD+B" /> <telerik:EditorTool Name="Italic" ShortCut="CTRL+I / CMD+I" /> <telerik:EditorTool Name="Underline" ShortCut="CTRL+U / CMD+U" /> <telerik:EditorTool Name="StrikeThrough" /> <telerik:EditorSeparator /> <telerik:EditorTool Name="Superscript" /> <telerik:EditorTool Name="Subscript" /> </telerik:EditorToolGroup> <telerik:EditorToolGroup Tag="ClipboardToolbar"> <telerik:EditorTool Name="SelectAll" ShortCut="CTRL+A / CMD+A" /> <telerik:EditorTool Name="Cut" ShortCut="CTRL+X / CMD+X" /> <telerik:EditorTool Name="Copy" ShortCut="CTRL+C / CMD+C" /> <telerik:EditorTool Name="Paste" ShortCut="CTRL+V / CMD+V" /> </telerik:EditorToolGroup> <telerik:EditorToolGroup Tag="UndoToolbar"> <telerik:EditorSplitButton Name="Undo"> </telerik:EditorSplitButton> <telerik:EditorSplitButton Name="Redo"> </telerik:EditorSplitButton> </telerik:EditorToolGroup> <telerik:EditorToolGroup Tag="PrintToolbar"> <telerik:EditorTool Name="Print" ShortCut="CTRL+P / CMD+P" /> </telerik:EditorToolGroup> </Tools> </telerik:RadEditor> <asp:Panel ID="pnloptionDisclaimerDefault" CssClass="formPanel" Visible="false" runat="server"> <asp:Button ID="btnoptionDefault" CausesValidation="false" Text="Default" ToolTip="Click here to import the default option disclaimer" OnClick="btnoptionDefault_Click" runat="server" /> <asp:Label ID="lbloptionDisclaimerDefault" Visible="false" runat="server"></asp:Label> </asp:Panel> </asp:TableCell> </asp:TableRow> </asp:Table> </div> </ItemTemplate> </telerik:RadPanelBar> </ItemTemplate> <AlternatingItemTemplate> <telerik:RadPanelBar ID="RadPanelBar1" runat="server" Skin="Telerik" Width="100%" ExpandMode="FullExpandedItem"> <Items> <telerik:RadPanelItem ID="RadPanelItem" runat="server" Enabled="True"> <Items> <telerik:RadPanelItem ID="RadPanelItemItem" runat="server" /> </Items> <ItemTemplate> <div class="module" style="width: 100%; float: left"> <asp:Table ID="tbloptionQuestion" CellPadding="0" CellSpacing="0" CssClass="formTable" runat="server"> <asp:TableRow CssClass="formRow"> <asp:TableCell CssClass="formPrompt" Style="width: 5%"> <asp:CheckBox ID="cboptionQuestionSelected" ToolTip="Check this box to select this option question" OnCheckedChanged="cboptionQuestion_CheckedChanged" runat="server" /> </asp:TableCell> <asp:TableCell CssClass="formPrompt" Style="width: 5%"> <asp:Label ID="lbloptionQuestionOrder" runat="server"></asp:Label> </asp:TableCell> <asp:TableCell CssClass="formValue" Style="width: 90%"> <asp:Label ID="lbloptionQuestion" runat="server"></asp:Label> <asp:Label ID="lbloptionQuestionDisabled" Enabled="false" Text="<br />This question is not available for this location." Visible="false" runat="server"></asp:Label> </asp:TableCell> </asp:TableRow> </asp:Table> </div> </ItemTemplate> </telerik:RadPanelItem> </Items> <ItemTemplate> <div class="module" style="width: 100%; float: left"> <asp:HiddenField ID="hfoptionQuestionName" runat="server" /> <asp:Table ID="tbloptionQuestionDisclaimer" CellPadding="0" CellSpacing="0" CssClass="formTable" runat="server"> <asp:TableRow CssClass="formRowShaded"> <asp:TableCell Style="width: 99%" ColumnSpan="3"> <p class="instructionBlue"> <asp:Literal ID="litoptionQuestionDisclaimer" runat="server">If you have selected any options. </asp:Literal> <asp:Literal ID="litoptionQuestionDisclaimerDefault" runat="server">Click on the DEFAULT button to import the default text for this disclaimer.</asp:Literal> </p> </asp:TableCell> </asp:TableRow> <asp:TableRow CssClass="formRowShaded"> <asp:TableCell Style="width: 99%" ColumnSpan="3"> <strong> <asp:Literal ID="litoptionDisclaimerPrompt" runat="server">option Disclaimer</asp:Literal>:</strong> <asp:CustomValidator ID="cvoptionDisclaimer" ControlToValidate="tboptionDisclaimer" CssClass="error" Display="Dynamic" ErrorMessage="<br />You have selected option questions. You must also provide a disclaimer." ForeColor="" SetFocusOnError="true" ValidateEmptyText="true" runat="server"></asp:CustomValidator> <telerik:RadEditor ID="radoptionDisclaimer" AutoResizeHeight="false" BorderColor="#4D85AC" BorderStyle="Solid" BorderWidth="1px" ContentAreaCssFile="~/app_themes/editor.css" EditModes="Design" ExternalDialogsPath="~/RadEditorDialogs/EditorDialogs/" EnableEmbeddedSkins="true" Height="180px" StripFormattingOptions="ConvertWordLists,Css,MSWordNoMargins,Span" Skin="Metro" Width="99%" runat="server" OnClientLoad="OnClientLoad"> <CssFiles> <telerik:EditorCssFile Value="~/app_themes/editor.css" /> </CssFiles> <Tools> <telerik:EditorToolGroup Tag="AppearanceToolbar"> <telerik:EditorDropDown Name="FormatBlock" Text="Normal"> </telerik:EditorDropDown> <telerik:EditorDropDown Name="FontName" Text="Font"> </telerik:EditorDropDown> <telerik:EditorDropDown Name="RealFontSize" Text="Size"> </telerik:EditorDropDown> <telerik:EditorTool Name="StripAll" /> </telerik:EditorToolGroup> <telerik:EditorToolGroup Tag="ColorToolbar"> <telerik:EditorSplitButton Name="ForeColor" Text="Color"> </telerik:EditorSplitButton> <telerik:EditorSplitButton Name="BackColor" Text="Background"> </telerik:EditorSplitButton> </telerik:EditorToolGroup> <telerik:EditorToolGroup Tag="LinkToolbar"> <telerik:EditorTool Name="LinkManager" Text="Change Link" /> </telerik:EditorToolGroup> <telerik:EditorToolGroup Tag="AlignmentToolbar"> <telerik:EditorTool Name="JustifyLeft" /> <telerik:EditorTool Name="JustifyCenter" /> <telerik:EditorTool Name="JustifyRight" /> <telerik:EditorTool Name="JustifyFull" /> </telerik:EditorToolGroup> <telerik:EditorToolGroup Tag="IndentToolbar"> <telerik:EditorTool Name="Indent" /> <telerik:EditorTool Name="Outdent" /> </telerik:EditorToolGroup> <telerik:EditorToolGroup Tag="ListToolbar"> <telerik:EditorTool Name="InsertOrderedList" /> <telerik:EditorTool Name="InsertUnorderedList" /> </telerik:EditorToolGroup> <telerik:EditorToolGroup Tag="LineToolbar"> <telerik:EditorTool Name="InsertHorizontalRule" /> </telerik:EditorToolGroup> <telerik:EditorToolGroup Tag="FormatToolbar"> <telerik:EditorSeparator /> <telerik:EditorTool Name="Bold" ShortCut="CTRL+B / CMD+B" /> <telerik:EditorTool Name="Italic" ShortCut="CTRL+I / CMD+I" /> <telerik:EditorTool Name="Underline" ShortCut="CTRL+U / CMD+U" /> <telerik:EditorTool Name="StrikeThrough" /> <telerik:EditorSeparator /> <telerik:EditorTool Name="Superscript" /> <telerik:EditorTool Name="Subscript" /> </telerik:EditorToolGroup> <telerik:EditorToolGroup Tag="ClipboardToolbar"> <telerik:EditorTool Name="SelectAll" ShortCut="CTRL+A / CMD+A" /> <telerik:EditorTool Name="Cut" ShortCut="CTRL+X / CMD+X" /> <telerik:EditorTool Name="Copy" ShortCut="CTRL+C / CMD+C" /> <telerik:EditorTool Name="Paste" ShortCut="CTRL+V / CMD+V" /> </telerik:EditorToolGroup> <telerik:EditorToolGroup Tag="UndoToolbar"> <telerik:EditorSplitButton Name="Undo"> </telerik:EditorSplitButton> <telerik:EditorSplitButton Name="Redo"> </telerik:EditorSplitButton> </telerik:EditorToolGroup> <telerik:EditorToolGroup Tag="PrintToolbar"> <telerik:EditorTool Name="Print" ShortCut="CTRL+P / CMD+P" /> </telerik:EditorToolGroup> </Tools> </telerik:RadEditor> <asp:Panel ID="pnloptionDisclaimerDefault" CssClass="formPanel" Visible="false" runat="server"> <asp:Button ID="btnoptionDefault" CausesValidation="false" Text="Default" ToolTip="Click here to import the default option disclaimer" OnClick="btnoptionDefault_Click" runat="server" /> <asp:Label ID="lbloptionDisclaimerDefault" Visible="false" runat="server"></asp:Label> </asp:Panel> </asp:TableCell> </asp:TableRow> </asp:Table> </div> </ItemTemplate> </telerik:RadPanelBar> </AlternatingItemTemplate> </telerik:RadListView></asp:WizardStep>
All,
I am new with Telerik and to this forum. I'm working on a Radgrid with a dropdown box that will be populated on pre-render. This works fine and the values come in as expected. However, when I try to grab them they will not appear in newValues. If I change the RadDropDownList back to a GrindBoundColumn the function works as expected.
Any help is appreciated! Thanks!
ASPX:
<telerik:GridTemplateColumn HeaderText="Bin #" HeaderStyle-Width="260px" DataField="Bin_no" UniqueName="Mat_Bin_no">
<ItemTemplate>
<telerik:RadDropDownList runat="server" ID="rddBin_no" Width="250px"
DataTextField="Bin_no" DataValueField="Bin_no">
</telerik:RadDropDownList>
</ItemTemplate>
</telerik:GridTemplateColumn>
VB:
Private Function FindMaterialData(ByVal sender As Object, ByVal e As GridBatchEditingEventArgs, sOrdNo As String, sLoc As String) As Boolean
Dim bErrorsFound As Boolean = False
Dim p_iWisysReturnValue As Integer = 0
Dim iSequenceNo As String
Dim sItemNo As String
Dim sBin As String
Dim sSerialLot As String
Dim dqty As Double
Dim dtExpDate As Date
Dim e2 As Telerik.Web.UI.GridItemEventArgs
Dim bIsEdited As Boolean = True
Dim lOffset As Long = 0
For Each row As GridDataItem In rgMaterial.Items
Dim Command As GridBatchEditingCommand
Try
Command = e.Commands.Item(row.ItemIndex - lOffset)
If Command.Item.DataSetIndex <> row.ItemIndex Then
bIsEdited = False
lOffset = lOffset + 1
Else
bIsEdited = True
End If
Catch
bIsEdited = False
End Try
iSequenceNo = row("Mat_seq_no").Text
sItemNo = row("Mat_item_no").Text
''Edited rows
If bIsEdited Then
Dim newValues As Hashtable = Command.NewValues
Dim oldValues As Hashtable = Command.OldValues
sSerialLot = newValues("ser_lot_no")
sBin = newValues("bin_no")
dqty = newValues("QtyRemaining")
Else
'Non edited rows
sSerialLot = row("Mat_ser_lot_no").Text
sBin = row("Mat_bin_no").Text
dqty = row("Mat_QtyRemaining").Text
End If
If dqty <> 0 Then
doSomething()
End If
Next
FindMaterialData = Not bErrorsFound
End Function



<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default" %><!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> <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" /></head><body> <form id="form1" runat="server"> <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> <Scripts> <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" /> <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" /> <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" /> </Scripts> </telerik:RadScriptManager> <script type="text/javascript"> //Put your JavaScript code here. </script> <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> </telerik:RadAjaxManager> <div> </div> <telerik:RadGrid ID="RadGrid1" runat="server" CellSpacing="0" Skin="WebBlue"><ExportSettings><Pdf><PageHeader><LeftCell Text=""></LeftCell><MiddleCell Text=""></MiddleCell><RightCell Text=""></RightCell></PageHeader><PageFooter><LeftCell Text=""></LeftCell><MiddleCell Text=""></MiddleCell><RightCell Text=""></RightCell></PageFooter></Pdf></ExportSettings> <ClientSettings AllowKeyboardNavigation="True"> <Selecting CellSelectionMode="MultiCell" /> <Scrolling AllowScroll="True" UseStaticHeaders="True" /> </ClientSettings><MasterTableView ShowFooter="False"><CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings><ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column" Created="True"><HeaderStyle Width="20px"></HeaderStyle></ExpandCollapseColumn><EditFormSettings><EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn></EditFormSettings><BatchEditingSettings EditType="Cell"></BatchEditingSettings><PagerStyle PageSizeControlType="RadComboBox"></PagerStyle></MasterTableView><PagerStyle PageSizeControlType="RadComboBox"></PagerStyle> <SelectedItemStyle BackColor="#FF9999" /><FilterMenu EnableImageSprites="False"></FilterMenu> </telerik:RadGrid> <telerik:RadButton ID="RadButton1" runat="server" Text="Highlight any cells in the grid above then click this button. Do that twice, and notice how it is off by one column." onclick="RadButton1_Click" Height="112px" Width="1263px" Font-Size="Large"> </telerik:RadButton> <p> </p> </form></body></html>
//the following is code-behind (default.aspx.cs)
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Configuration;
using System.Web.Security;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Telerik.Web.UI;
public partial class Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//populate RadGrid with test table data
if (IsPostBack == false)
{
RadGrid1.DataSource = GenerateTestTable( );
RadGrid1.DataBind();
}
}
protected void RadButton1_Click(object sender, EventArgs e)
{
//do something with selected/hilighted cells - WHY IS IT OFF BY ONE COLUMN?!?!?!?!?!?!?
foreach (GridTableCell item in RadGrid1.SelectedCells )
{
item.Text = "Hello!";
item.BackColor = System.Drawing.Color.Aquamarine;
}
}
static DataTable GenerateTestTable()
{
// create DataTable columns
DataTable dt = new DataTable();
for (int i = 0; i < 8; i++) { dt.Columns.Add("Column_" + i.ToString(), typeof(int)); }
// create DataTable rows
DataRow dr = null;
for (int row = 0; row < 8; row++)
{
dr = dt.NewRow();
for (int col = 0; col < 8; col++) { dr[col] = col +row*8; }
dt.Rows.Add(dr);
}
return dt;
}
}
// why is it off by one column?!?!?!?!?
