| protected void Grid_ExcelMLExportRowCreated ( object source, Telerik.Web.UI.GridExcelBuilder.GridExportExcelMLRowCreatedArgs e ) |
| { |
| if ( e.RowType == GridExportExcelMLRowType.HeaderRow ) |
| { |
| RowElement myNewRow = new RowElement(); |
| CellElement myNewCell = new CellElement(); |
| myNewCell.StyleValue = "myNewStyle"; |
| myNewCell.MergeAcross = e.Row.Cells.Count - 1; |
| //is there something like the property below? |
| myNewCell.Width = 200; |
| //etc... |
| } |
| } |
I have a combobox with a treeview ( tvCategory) inside it. ON the same web page I have a asp panel and on which I have a user Control.
I am trying to use AJAXManagerProxy control. ON treeview node change I want to update panel on the web page. Following code I have used for this.
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="tvCategory">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="tvCategory" />
<telerik:AjaxUpdatedControl ControlID="pnlDetail" LoadingPanelID="RadAjaxLoadingPanel1" />
<telerik:AjaxUpdatedControl ControlID="txtNAme" LoadingPanelID="RadAjaxLoadingPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
</telerik:RadAjaxManagerProxy>
On NodeClick event I am trying to set properties of user control.
Protected Sub tvCategory_NodeClick(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadTreeNodeEventArgs)
If e.Node.Value.ToString <> vbNullString Then
Category1.CategoryID = New Guid(e.Node.Value.ToString) 'setting up User control's categoryId property
Category1.LoadCategory = True
End If
pnlDetail.Visible = True
End Sub
Page Load of the user control is called before NodeClick event and I am not able to get the data because I need to know the node selected value to set up on the user control.
How do I do this?
Thanks is advance!!!
| Dim btPrev As New Button |
| btPrev.Attributes.Add("CssClass", "rgPagePrev") |
| <telerik:RadGrid ID="grd" runat="server" |
| AllowPaging="True" |
| PageSize="20" |
| Skin="Vista" |
| GridLines="None" |
| AllowSorting="true" |
| OnExcelMLExportRowCreated="grdBundles_ExcelMLExportRowCreated" |
| OnExcelMLExportStylesCreated="grdBundles_ExcelMLExportStylesCreated" |
| onsortcommand="grdBundles_SortCommand" |
| Visible="true" |
| DataSourceID="dsBundleReport" |
| OnDataBound="grdBundleReport_DataBound" |
| > |
| <PagerStyle NextPageText="Next" PrevPageText="Prev" Mode="NextPrevAndNumeric"> |
| </PagerStyle> |
| <ExportSettings> |
| <Excel Format="ExcelML" /> |
| </ExportSettings> |
| <ClientSettings EnableRowHoverStyle="true" AllowColumnsReorder="true" AllowExpandCollapse="true" > |
| <Resizing AllowColumnResize="true" ClipCellContentOnResize="true" AllowRowResize="false" ResizeGridOnColumnResize="false" /> |
| <Scrolling AllowScroll="true" UseStaticHeaders="true" SaveScrollPosition="true" ScrollHeight="200px" /> |
| </ClientSettings> |
| <MasterTableView AllowPaging="true" AllowCustomSorting="true" AutoGenerateColumns="false" |
| AlternatingItemStyle-CssClass="alernatingItemStyle" DataSourceID="dsBundleReport" UseAllDataFields="true"> |
| <Columns> |
| <telerik:GridBoundColumn SortExpression="BenefitId" ItemStyle-Width="100" HeaderStyle-Width="100" DataField="BenefitId" ReadOnly="true" HeaderText="Benefit Id" HeaderStyle-Font-Bold="true" HeaderStyle-Font-Names="verdana" HeaderStyle-HorizontalAlign="Center" /> |
| <telerik:GridTemplateColumn |
| HeaderText="Image" |
| UniqueName="Image"> |
| <ItemTemplate> |
| <asp:Image ID="Image1" runat="server" src="images/binoculars.gif"/> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridBoundColumn SortExpression="Id" ItemStyle-Width="100" HeaderStyle-Width="100" DataField="Id" ReadOnly="true" HeaderText="Id" HeaderStyle-Font-Bold="true" HeaderStyle-Font-Names="verdana" HeaderStyle-HorizontalAlign="Center" /> |
| <telerik:GridBoundColumn SortExpression="Cd" ItemStyle-Width="100" HeaderStyle-Width="100" DataField="Cd" ReadOnly="true" HeaderText="Cd" HeaderStyle-Font-Bold="true" HeaderStyle-Font-Names="verdana" HeaderStyle-HorizontalAlign="Center" /> |
I have a radgird that will be displaying support tickets. Within the grid I am using the telerik:GridImageColumn to display either a green, yellow or red image.
I am current trying to achieve this with itemdatabound, using findcontrol. I keep getting an error “Object reference not set to an instance of an object.”. Can some let me know what I am doing wrong?
Thanks
If
TypeOf e.Item Is GridDataItem Then
Dim dataItem As GridDataItem = DirectCast(e.Item, GridDataItem)
Dim dataBoundItem As GridDataItem = e.Item
Dim calcdate As Date
Dim tsTimeSpan As TimeSpan
Dim iNumberOfDays As Integer
calcdate = dataItem.DataItem(
"SubmitDate")
tsTimeSpan = Now.Subtract(calcdate)
iNumberOfDays = tsTimeSpan.Days
If iNumberOfDays < 2 Then
dataBoundItem.FindControl(
"imggreen").Visible = True
ElseIf iNumberOfDays = 2 Then
dataBoundItem.FindControl(
"imgyellow").Visible = True
dataItem(
"SubmitDate").BackColor = Color.Yellow
ElseIf iNumberOfDays >= 3 Then
dataBoundItem.FindControl(
"imgred").Visible = True
dataItem("SubmitDate").BackColor = Color.Red
End If
End If
)
<script type="text/javascript">
function showIframe() {
document.getElementById(
"frame1").src = "DrawingTreeView.aspx";
document.all.frame1.style.visibile =
"visible";
}
</script>
.
.
.
<
td>
<telerik:RadDockZone ID="RadDockZone1" runat="server" Height="200px" Width="200px" BorderWidth="0">
<telerik:RadDock ID="RadDock1" runat="server" Title="Drawing Tree"
DefaultCommands="All" Resizable="True"
OnClientDragStart="OnClientDragStart" OnClientDockPositionChanged="OnClientDockPositionChanged"
DockHandle="TitleBar" EnableAnimation="true" EnableRoundedCorners="true">
<ContentTemplate>
<asp:ImageButton runat="server" ID="imgWebsiteThumbnailImage" OnLoad="btnShowThumbnailImage_Click" Visible="true" OnClientClick="showIframe" />
<iframe id="frame1" runat="server" width="100%" height="100%" visible="false" />
</ContentTemplate>
</telerik:RadDock>
</telerik:RadDockZone>
</td>
<?
xml version="1.0"?>
<
configuration>
<
configSections>
<
sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<
sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<
section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<
sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<
section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
<
section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<
section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<
section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
</
sectionGroup>
</
sectionGroup>
</
sectionGroup>
<
sectionGroup name="telerik.web.ui">
<
section name="radScheduler" type="Telerik.Web.UI.RadSchedulerConfigurationSection, Telerik.Web.UI, PublicKeyToken=121fae78165ba3d4" allowDefinition="MachineToApplication" requirePermission="false"/>
</
sectionGroup>
</
configSections>
<
appSettings>
<
add key="ConnectionString" value="server=TESTSVR01\SQLEXPRESS;database=Epilepsy12;uid=sa;password=cout123;"/>
</
appSettings>
<
connectionStrings/>
<
system.web>
< compilation debug="true">
<
assemblies>
<
add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<
add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<
add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<
add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<
add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<
add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<
add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<
add assembly="Telerik.Web.Design, Version=2009.3.1314.20, Culture=neutral, PublicKeyToken=121FAE78165BA3D4"/>
<
add assembly="Accessibility, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies>
</
compilation>
< authentication mode="Windows"/>
< pages>
<
controls>
<
add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<
add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</
controls>
</
pages>
<
httpHandlers>
<
remove verb="*" path="*.asmx"/>
<
add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<
add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<
add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
<
add verb="*" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.Upload.RadUploadProgressHandler, Telerik.Web.UI"/>
<
add verb="*" path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler, Telerik.Web.UI, Culture=neutral, PublicKeyToken=121fae78165ba3d4"></add>
<
add verb="*" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler, Telerik.Web.UI, Culture=neutral, PublicKeyToken=121fae78165ba3d4"></add>
<
add verb="*" path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler, Telerik.Web.UI, Culture=neutral, PublicKeyToken=121fae78165ba3d4" validate="false"/>
<
add path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI" validate="false"/>
</
httpHandlers>
<
httpModules>
<
add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<
add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule, Telerik.Web.UI"/>
<
add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</
httpModules>
</
system.web>
<
system.web.extensions>
<
scripting>
<
webServices>
<
jsonSerialization maxJsonLength="5000000"/>
</
webServices>
</
scripting>
</
system.web.extensions>
< system.codedom>
<
compilers>
<
compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<
providerOption name="CompilerVersion" value="v3.5"/>
<
providerOption name="WarnAsError" value="false"/>
</
compiler>
<
compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<
providerOption name="CompilerVersion" value="v3.5"/>
<
providerOption name="OptionInfer" value="true"/>
<
providerOption name="WarnAsError" value="false"/>
</
compiler>
</
compilers>
</
system.codedom>
< runtime>
<
assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<
dependentAssembly>
<
assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
<
bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</
dependentAssembly>
<
dependentAssembly>
<
assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
<
bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</
dependentAssembly>
</
assemblyBinding>
</
runtime>
</
configuration>