or
Private Sub rrbMain_SelectedTabChange(sender As Object, e As Telerik.Web.UI.RibbonBarSelectedTabChangeEventArgs) Handles rrbMain.SelectedTabChange Select Case e.Tab.Text Case "Tab1" Response.Redirect("~/tab1.aspx") Case "Tab2" Response.Redirect("~/tab2.aspx") End SelectEnd Sub<%
@ Register TagPrefix="ModelData" TagName="ucSourscDoc" Src="~/PeerBenchmarking/controls/ucSourceDocument.ascx" %>
<%
@ Register TagPrefix="ModelData" TagName="ucUploadDoc" Src="~/PeerBenchmarking/controls/ucUploadDocument.ascx" %>
<telerik:RadGrid runat="server" ID="RadGridBoardPositionLink" AllowMultiRowSelection="false"> <MasterTableView DataKeyNames="BoardPositionId" ClientDataKeyNames="BoardPositionId, ProgramLink, GroupLink" AutoGenerateColumns="false" TableLayout="Fixed" NoMasterRecordsText="You do not have any board positions created" CommandItemDisplay="Top"> <CommandItemSettings ShowAddNewRecordButton="false" ShowRefreshButton="false" /> <CommandItemTemplate> <asp:Panel runat="server" CssClass="CommandItemPanel"> <telerik:RadButton runat="server" ID="RadButtonSaveBoardPositionLink" Text="Save"/> </asp:Panel> </CommandItemTemplate> <Columns> <telerik:GridBoundColumn DataField="BoardPositionID" DataType="System.Int64" UniqueName="BoardPositionID" Display="false" /> <telerik:GridBoundColumn DataField="ApplicationId" DataType="System.Int64" UniqueName="ApplicationId" Display="false" /> <telerik:GridBoundColumn DataField="ProgramLink" DataType="System.String" UniqueName="ProgramId" Display="false" /> <telerik:GridBoundColumn DataField="GroupLink" DataType="System.String" UniqueName="GroupLink" Display="false" /> <telerik:GridBoundColumn DataField="ProgramId" DataType="System.Int64" UniqueName="ProgramId" Display="false" /> <telerik:GridBoundColumn DataField="Name" DataType="System.String" HeaderText="Position Name" UniqueName="Name" ItemStyle-Width="25%" HeaderStyle-Width="25%" /> </Columns> </MasterTableView> <ClientSettings EnableRowHoverStyle="true"> <Selecting AllowRowSelect="true" /> <ClientEvents OnRowSelected="RowSelectedRadGridBoardPositionLink"/> </ClientSettings></telerik:RadGrid><telerik:RadGrid runat="server" ID="RadGridProgramsLink" AllowAutomaticDeletes="false" AllowAutomaticInserts="false" AllowAutomaticUpdates="false" AllowMultiRowSelection="true"> <MasterTableView DataKeyNames="ProgramId" ClientDataKeyNames="ProgramId" CommandItemDisplay="None" AutoGenerateColumns="false" TableLayout="Fixed"> <Columns> <telerik:GridTemplateColumn HeaderStyle-Width="20px" ItemStyle-Width="20px"> <ItemTemplate> <asp:CheckBox runat="server" ID="CheckboxProgramCheck" AutoPostBack="false" Onclick="OnCheckedCheckBoxProgram(this);" /> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridBoundColumn DataField="ProgramId" DataType="System.Int64" UniqueName="ProgramId" Display="false" /> <telerik:GridBoundColumn DataField="Name" DataType="System.String" UniqueName="Name" HeaderText="Program Name" HeaderStyle-Width="150px" ItemStyle-Width="150px" /> </Columns> </MasterTableView></telerik:RadGrid>function OnCheckedCheckBoxProgram( sender ){if ( myRowSelectedBoardPositionLink == 0 ){radalert( "You need to select a position to assign program(s)", 400, 100, "Assign Program", null ); return false; } // assign it to the attribute of the selected position recordAssignProgramId();}function AssignProgramId(){ // selected row of the Board Position to edit the ProgramId attribute var myCheckbox; var myString = ""; var myMasterTable = $find( "<%= RadGridProgramsLink.ClientID %>" ).get_masterTableView(); // build the array and store back in the SelectedRow - BoardPosition table for ( var i = 0; i < myMasterTable.get_dataItems().length; i++ ) { myCheckbox = myMasterTable.get_dataItems()[i].findElement( "CheckboxProgramCheck" ); if ( myCheckbox.checked ) { myString = myString + myMasterTable.get_dataItems()[i].getDataKeyValue( 'ProgramId' ) + "|"; } } myMasterTable = $find( "<%= RadGridBoardPositionLink.ClientID %>" ).get_masterTableView(); // ***** CODE HERE FOR WRITTING TO THE SELECTED ROW ProgramLink COLUMN ******}
<div style="z-index: 1;"> <telerik:RadToolTip runat="server" ID="testTooltip" HideEvent="FromCode" Position="Center" Width="400px" Height="200px" Animation="None" ShowEvent="OnClick" ShowDelay="0" ManualClose="true" EnableViewState="true" TargetControlID="" RenderInPageRoot="true" RelativeTo="BrowserWindow" ShowCallout="False" Modal="true" BorderWidth="6spx" BorderColor="Gray" BorderStyle="Solid"> </telerik:RadToolTip> </div><MasterTableView TableLayout="Auto" EditMode="PopUp" AlternatingItemStyle-BorderColor="Red"> <Columns> <telerik:GridClientSelectColumn HeaderStyle-Width="36px"> <HeaderStyle Width="36px" /> </telerik:GridClientSelectColumn> <telerik:GridBoundColumn DataField="pkID" HeaderText="SerialNO" UniqueName="pkID"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Visit_IP" HeaderText="IP" UniqueName="Visit_IP"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="DateTimes" HeaderText="DateTime" UniqueName="DateTimes"> </telerik:GridBoundColumn> <telerik:GridTemplateColumn HeaderText="Edit" UniqueName="TemplateEditColumn"> <ItemTemplate> <asp:LinkButton runat="server" ID="LinkButtonEdit" Text="LinkButtonEdit" CommandName="LinkButtonEdit" CommandArgument='<%# Eval("pkID") %>' /> </ItemTemplate> </telerik:GridTemplateColumn> </Columns> </MasterTableView>protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e) { if (e.Item is GridDataItem) { GridDataItem dataItem = ((GridDataItem)(e.Item)); LinkButton linkButton = dataItem.FindControl("LinkButtonEdit") as LinkButton; linkButton.ID = "LinkButtonEditID_" + dataItem.ItemIndex; linkButton.Text = "LinkButtonEditText_" + dataItem.ItemIndex; RadWindowIndexBuilder winbuider = new RadWindowIndexBuilder(this.RadWindowManager1, this.RadPaneWindow.ClientID, dataItem); linkButton.Click += winbuider.LinkButtonEdit_Click; } } //How to Get/Set Follow Value for 'pkID' From Rows of RadGrid ??????? public class RadWindowIndexBuilder { RadWindowManager radWindowManager = null; string restrictionZoneID = null; int index = 0; string pkid = null; public RadWindowIndexBuilder(RadWindowManager RadWindowManager1, string RestrictionZoneID, GridDataItem Item) { radWindowManager = RadWindowManager1; restrictionZoneID = RestrictionZoneID; index = Item.ItemIndex; pkid = "???"; //How to Get/Set this Value From Rows of RadGrid ???
//pkid = Item.GetDataKeyValue("pkID").ToString(); ???
//pkid = Item.OwnerTableView.DataKeyValues[Item.ItemIndex][0].ToString(); ??? } public void LinkButtonEdit_Click(object sender, EventArgs e) { radWindowManager.Windows.Clear(); RadWindow rwin = new RadWindow(); rwin.ID = "RadWindowLinkButtonEdit_" + index; rwin.Modal = false; rwin.Width = 640; rwin.Height = 480; rwin.Skin = "Office2007"; rwin.NavigateUrl = "AdminContentBuilderInfo.aspx?id=" + pkid; rwin.Behaviors = WindowBehaviors.Close; rwin.InitialBehaviors = WindowBehaviors.Maximize | WindowBehaviors.None; rwin.RestrictionZoneID = restrictionZoneID; rwin.VisibleOnPageLoad = true; radWindowManager.Windows.Add(rwin); } }When I save the displayed chart image with the code below, the axis labels are missing from the image (I saw on an earlier post this can happen if scroll mode is on). I am not using scroll mode
Here is the code
Dim
ms1 As New System.IO.MemoryStream()
Me.chtGraph.Save(ms1, System.Drawing.Imaging.ImageFormat.Png)
Me.Page.Response.Clear()
Me.Page.Response.ClearHeaders()
Me.Page.Response.AddHeader("Content-disposition", "attachment; filename=graph.png")
Me.Page.Response.AddHeader("Content-type", "image/png")
Me.Page.Response.BinaryWrite(ms1.ToArray())
Me.Page.Response.[End]()
I am building a Grid using the Q1 2010 RadGrid control, and
using Template Form Update as my guide.
I have a Template edit form, and I'm having an issue when
trying to add a Telerik Grid Dropdown Column.
I am getting an error saying that the Grid Dropdown
Column is not a known element.
Below is a copy of my edit form template:
<telerik:RadGrid ID="RadGrid1" runat="server" CssClass="RadGrid" GridLines="None"
AllowPaging="True" PageSize="20" AllowSorting="True" AutoGenerateColumns="False"
ShowStatusBar="true" AllowAutomaticDeletes="True" AllowAutomaticInserts="True"
AllowAutomaticUpdates="True" DataSourceID="SqlDataSource1" OnItemDeleted="RadGrid1_ItemDeleted"
OnItemInserted="RadGrid1_ItemInserted" OnItemUpdated="RadGrid1_ItemUpdated" OnItemCommand="RadGrid1_ItemCommand"
>
<MasterTableView CommandItemDisplay="TopAndBottom" DataSourceID="SqlDataSource1" DataKeyNames="MCCLoadId">
<Columns>
<telerik:GridEditCommandColumn>
</telerik:GridEditCommandColumn>
<telerik:GridBoundColumn UniqueName="MCCNo" HeaderText="MCCNo" DataField="MCCNo">
<HeaderStyle ForeColor="Silver" ></HeaderStyle>
<ItemStyle ForeColor="Gray" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="MCC_Cmpt" HeaderText="MCC Compartment" UniqueName="MCC_Cmpt">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="DeviceType_DeviceTypeId" HeaderText="Device Type" UniqueName="DeviceTypeId" >
</telerik:GridBoundColumn>
</Columns>
<EditFormSettings EditFormType="Template">
<FormTemplate>
<table id="Table2" cellspacing="2" cellpadding="1" width="100%" border="0" rules="none"
style="border-collapse: collapse; background: white;">
<tr class="EditFormHeader">
<td colspan="2" style="font-size:small">
<b>MCC Load Details</b>
</td>
</tr>
<tr>
<td>
<table id="Table3" cellspacing="1" cellpadding="1" width="250" border="0" class="module">
<tr>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
MCC #:
</td>
<td>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("MCCNo") %>'></asp:TextBox>
</td>
</tr>
<tr>
<td>
MCC Section:
</td>
<td>
<asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("MCC_Sect") %>'></asp:TextBox>
</td>
</tr>
<tr>
<td>
MCC Section Suffix:
</td>
<td>
<asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("MCC_Sect_Suffix") %>'></asp:TextBox>
</td>
</tr>
<tr>
<td>
MCC Compartment:
</td>
<td>
<asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("MCC_Cmpt") %>'></asp:TextBox>
</td>
</tr>
<tr>
<td>
MCC Compartment Suffix:
</td>
<td>
<asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("MCC_Cmpt_Suffix") %>'></asp:TextBox>
</td>
</tr>
<tr>
<td>
MCC Compartment Space Factor:
</td>
<td>
<asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("MCC_Cmpt_Space_Factor") %>'></asp:TextBox>
</td>
</tr>
<tr>
<td>
MCC Compartment Connection:
</td>
<td>
<asp:TextBox ID="TextBox7" runat="server" Text='<%# Bind("MCC_Cmpt_Conn") %>'></asp:TextBox>
</td>
</tr>
<tr>
<td>
MCC Short Circuit:
</td>
<td>
<asp:TextBox ID="TextBox8" runat="server" Text='<%# Bind("MCC_Short_Ckt_Prot") %>'></asp:TextBox>
</td>
</tr>
<tr>
<td>
MCC Short Circuit Rating:
</td>
<td>
<asp:TextBox ID="TextBox9" runat="server" Text='<%# Bind("MCC_Short_Ckt_Rating") %>'></asp:TextBox>
</td>
</tr>
<tr>
<td>
MCC Short Circuit Class:
</td>
<td>
<asp:TextBox ID="TextBox10" runat="server" Text='<%# Bind("MCC_Short_Ckt_Class") %>'></asp:TextBox>
</td>
</tr>
<tr>
<td>
MCC Control Device:
</td>
<td>
<telerik:GridDropDownColumn DataField="DeviceType_DeviceTypeId" DataSourceID="SqlDataSource2"
HeaderText="DeviceTypes" ListTextField="DeviceTypeName" ListValueField="DeviceTypeId"
UniqueName="DeviceTypeId" ColumnEditorID="GridDropDownColumnEditor1">
</telerik:GridDropDownColumn>
</td>
</tr>
</table>
</td>
</tr>
</FormTemplate>
</EditFormSettings>
</MasterTableView>
</telerik:RadGrid>