I'm brand new to Telerik. I have never used it before today. I want to display a grid and then allow the user to click on the Edit icon and be presented with a textbox containing an email address. I then want to allow the user to change the email address. Here is my aspx page:
<%@ Page Title="Email Redirect Maintenance" Language="C#" MasterPageFile="~/ITSMandReports.Master" AutoEventWireup="true" CodeBehind="EmailRedirectMaint.aspx.cs" Inherits="SM_ITSRD.ITSM.ReportPortal.AC.EmailRedirectMaint" %>
<%@ Register Src="~/Controls/EmployeePicker.ascx" TagPrefix="uc1" TagName="EmployeePicker" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<h2>Email Redirect Maintenance</h2>
<asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server"></asp:ScriptManagerProxy>
<telerik:RadAjaxManagerProxy ID="RadAjaxProxy1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadRedirectEmail">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadRedirectEmail" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManagerProxy>
<asp:Button ID="btnAddNew" runat="server" Text="Add New" OnClick="btnAddNew_Click" />
<asp:Button ID="btnUpdate" runat="server" Text="Return to Edit view" OnClick="btnUpdate_Click" Visible="false" />
<div runat="server" id="divAddNew" visible="false">
<asp:Table ID="tblAddnew" runat="server" CssClass="table">
<asp:TableHeaderRow>
<asp:TableHeaderCell ColumnSpan="4">Add New</asp:TableHeaderCell>
</asp:TableHeaderRow>
<asp:TableRow>
<asp:TableCell ColumnSpan="4">
<uc1:EmployeePicker runat="server" ID="EmployeePicker" OnEmployeeSelected="EmployeePicker_EmployeeSelected" />
</asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell>
<asp:Label ID="Label1" runat="server" Font-Bold="true" Width="320">Redirect Email Address: </asp:Label>
<asp:TextBox ID="txtRedirectEmailAddress" runat="server" MaxLength="200" Width="320"></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="txtRedirectEmailAddress" ErrorMessage="Please Enter a Valid Email Address" ForeColor="Red" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" SetFocusOnError="true" ValidationGroup="InsertGroup1"></asp:RegularExpressionValidator>
</asp:TableCell>
</asp:TableRow>
</asp:Table>
<asp:Button ID="btnInsert" runat="server" Text="Insert employee with the above listed hours." OnClick="btnInsert_Click" ValidationGroup="InsertGroup1" />
</div>
<div runat="server" id="divUpdate">
<telerik:RadGrid ID="gvEmailRedirectMaint" runat="server" AllowFilteringByColumn="True" AllowSorting="true"
GroupPanelPosition="Top" RenderMode="Lightweight" EnableLinqExpressions="false" OnItemDataBound="gvEmailRedirectMaint_ItemDataBound"
OnNeedDataSource="gvEmailRedirectMaint_NeedDataSource" OnUpdateCommand="gvEmailRedirectMaint_UpdateCommand" OnDeleteCommand="gvEmailRedirectMaint_DeleteCommand">
<GroupingSettings CollapseAllTooltip="Collapse all groups" CaseSensitive="false"></GroupingSettings>
<ClientSettings>
<Resizing AllowColumnResize="true" AllowRowResize="true" ResizeGridOnColumnResize="false" ClipCellContentOnResize="true" EnableRealTimeResize="false" AllowResizeToFit="true" />
</ClientSettings>
<AlternatingItemStyle BackColor="#E0E0E0" />
<MasterTableView AutoGenerateColumns="false" TableLayout="Auto" CommandItemDisplay="Top" DataKeyNames="ID" EditMode="EditForms">
<CommandItemSettings ShowAddNewRecordButton="false" ShowRefreshButton="false" />
<Columns>
<telerik:GridEditCommandColumn HeaderText="Edit:" ButtonType="ImageButton">
<HeaderStyle Width="50px" />
<ItemStyle Width="50px" />
</telerik:GridEditCommandColumn>
<telerik:GridBoundColumn DataField="RedirectEmailAddress" AllowFiltering="false" HeaderText="Redirect Email Address" UniqueName="RedirectEmailAddress" ReadOnly="false">
<HeaderStyle Width="320px" />
<ItemStyle Width="320px" />
</telerik:GridBoundColumn>
<telerik:GridButtonColumn CommandName="Delete" HeaderText="Delete?" Text="Delete" ConfirmText="Are you sure you want to delete this record?" ButtonType="ImageButton" UniqueName="DeleteColumn"></telerik:GridButtonColumn>
</Columns>
</MasterTableView>
<HeaderStyle Font-Bold="True" />
<CommandItemStyle VerticalAlign="Top" />
<ItemStyle VerticalAlign="Top" />
</telerik:RadGrid>
</div>
</asp:Content>
Here is my C# code behind code:
using CommonCS;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
namespace SM_ITSRD.ITSM.ReportPortal.AC
{
public partial class EmailRedirectMaint : System.Web.UI.Page
{
private bool tableCopied = false;
private DataTable originalDataTable;
string userID = HttpContext.Current.Request.LogonUserIdentity.Name.Split('\\')[1];
string connString = ConfigurationManager.ConnectionStrings["ItsmConnectionString"].ConnectionString;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindGrid();
}
}
protected void gvEmailRedirectMaint_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
if (!tableCopied)
{
originalDataTable = ((DataRowView)e.Row.DataItem).Row.Table.Copy();
ViewState["originalValuesDataTable"] = originalDataTable;
tableCopied = true;
}
}
protected void BindGrid()
{
ACRedirectEmailAddress objACRedirectEmailAddress = new ACRedirectEmailAddress(connString);
gvEmailRedirectMaint.DataSource = objACRedirectEmailAddress.GetEmailRedirects();
}
protected void gvEmailRedirectMaint_DeleteCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
{
GridDataItem item = (GridDataItem)e.Item;
string dataKey = item.GetDataKeyValue("ID").ToString();
string strSQLconnection = ConfigurationManager.ConnectionStrings["ITSMConnectionString"].ConnectionString;
StringBuilder _query = new StringBuilder();
_query.Append("delete from AC_EmailRedirect ");
_query.Append(" Where ID = '" + dataKey);
_query.Append("'");
SqlConnection con = new SqlConnection(strSQLconnection);
con.Open();
SqlCommand comm = new SqlCommand();
comm.Connection = con;
comm.CommandType = CommandType.Text;
comm.CommandText = _query.ToString();
int rowsAffected = comm.ExecuteNonQuery();
con.Close();
}
protected void gvEmailRedirectMaint_UpdateCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
{
GridEditableItem editItem = (GridEditableItem)e.Item;
string newVIPPreferredID = (editItem["VIPPreferredID"].Controls[0] as TextBox).Text;
string newRedirectEmailAddress = txtRedirectEmailAddress.Text; // (editItem["RedirectEmailAddress"].Controls[0] as TextBox).Text;
string newCreatedBy = userID; // (editItem["CreatedBy"].Controls[0] as TextBox).Text;
string newModifiedBy = userID; // (editItem["ModifiedBy"].Controls[0] as TextBox).Text;
GridEditFormItem efi = (GridEditFormItem)e.Item;
GridDataItem dataItem = efi.ParentItem;
string dataKey = Convert.ToString(efi.GetDataKeyValue("ID"));
string strSQLconnection = ConfigurationManager.ConnectionStrings["ITSMConnectionString"].ConnectionString;
StringBuilder _query = new StringBuilder();
_query.Append("update AC_EmailRedirect set ");
_query.Append("VIPPreferredID = " + newVIPPreferredID);
_query.Append(",RedirectEmailAddress = " + txtRedirectEmailAddress.Text);
_query.Append(",CreatedBy = " + newCreatedBy);
_query.Append("',CreatedDate = GetDate()");
_query.Append(",modifiedBy = '" + userID);
_query.Append("',modifiedDate = GetDate()");
_query.Append(" Where ID = '" + dataKey);
_query.Append("'");
SqlConnection con = new SqlConnection(strSQLconnection);
con.Open();
SqlCommand comm = new SqlCommand();
comm.Connection = con;
comm.CommandType = CommandType.Text;
comm.CommandText = _query.ToString();
int rowsAffected = comm.ExecuteNonQuery();
con.Close();
}
protected void gvEmailRedirectMaint_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
ACRedirectEmailAddress objACRedirectEmailAddress = new ACRedirectEmailAddress(connString);
gvEmailRedirectMaint.DataSource = objACRedirectEmailAddress.GetEmailRedirects();
}
protected void btnAddNew_Click(object sender, EventArgs e)
{
txtRedirectEmailAddress.Text = "";
divAddNew.Visible = true;
divUpdate.Visible = false;
btnUpdate.Visible = true;
}
protected void EmployeePicker_EmployeeSelected(object sender, EmployeeSelectedEventArgs e)
{
//this takes the employees email address for the employee that was selected in the EmployeePicker
//and inserts the email address in to the text box next to the forward button.
txtPrefID.Text = e.SelectedEmployee.PreferredID.ToString();
txtPrefID.Visible = true;
lblPrefID_0.Visible = true;
}
protected void btnInsert_Click(object sender, EventArgs e)
{
string strSQLconnection = ConfigurationManager.ConnectionStrings["ITSMConnectionString"].ConnectionString;
StringBuilder _query = new StringBuilder();
_query.Append(@"
INSERT INTO AC_EmailRedirect (VIPPreferredID,
RedirectEmailAddress,
userID,
createDate,
userID,
ModifiedDate)
values (
@VIPPreferredID,
@RedirectEmailAddress,
userID,
getDate(),
userID,
getDate()
) ");
SqlConnection con = new SqlConnection(strSQLconnection);
con.Open();
SqlCommand comm = new SqlCommand();
comm.Connection = con;
comm.CommandType = CommandType.Text;
comm.CommandText = _query.ToString();
comm.Parameters.AddWithValue("@VIPPreferredID", txtPrefID.Text);
comm.Parameters.AddWithValue("@RedirectEmailAddress", txtRedirectEmailAddress.Text);
comm.Parameters.AddWithValue("@pCreatedBy", userID);
comm.Parameters.AddWithValue("@pModifiedBy", userID);
int rowsAffected = comm.ExecuteNonQuery();
con.Close();
Response.Redirect(Request.RawUrl);
}
protected void btnUpdate_Click(object sender, EventArgs e)
{
divAddNew.Visible = false;
divUpdate.Visible = true;
btnUpdate.Visible = false;
}
}
}
A few questions:
1. The delete works perfectly.
2. When I click the Edit icon, I do get txtRedirectEmailAddress with the correct value. But if I change it, and put a breakpoint in my code. I notice txtRedirectEmailAddress.Text is blank ("").
3. I tried changing the width of the email textbox but it's not working. How do I set the width?
4. So when I click the Edit icon, I do get the email address in the textbox. I also get the update and cancel icons.
5. When I click the update icon, I get this error:
System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near ','.
Unclosed quotation mark after the character string ''.
I'm having trouble finding the error. Can anyone help?
I have a GridCalculatedColumn that is not summing up the values properly when there is a negative value. Currently it is giving a total that is treating the negative value as if it's positive. The negative values (p1,p2,p3..etc) are shown in brackets indicating it's negative on the grid but is not calculated as such on the total. Is there any setting on the gridcalculatedcolumn so that I can make sure it will consider negative values?
<Columns>
<telerik:GridBoundColumn DataField="RESOURCE" HeaderText="Resource Name / PO" FilterControlAltText="Filter RESOURCE column" SortExpression="RESOURCE" ReadOnly="True" UniqueName="RESOURCE" HeaderStyle-Width="100px">
<ColumnValidationSettings>
</ColumnValidationSettings>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="RESOURCE_ID" HeaderText="Cost Center / Vendor" FilterControlAltText="Filter RESOURCE_ID column" HeaderStyle-Width="200px" SortExpression="RESOURCE_ID" ReadOnly="True" UniqueName="RESOURCE_ID">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="LABOUR_TYPE" HeaderText="Type" FilterControlAltText="Filter LABOUR_TYPE column" SortExpression="LABOUR_TYPE" UniqueName="LABOUR_TYPE" ReadOnly="True" HeaderStyle-Width="80px">
</telerik:GridBoundColumn>
<telerik:GridNumericColumn Aggregate="Sum" FooterText=" " DataField="P1" DataType="System.Double" FilterControlAltText="Filter P1 column" HeaderStyle-Width="65px" HeaderText="P1" ReadOnly="True" SortExpression="P1" UniqueName="P1" NumericType="Currency" FooterAggregateFormatString="{0:C}">
<ColumnValidationSettings>
</ColumnValidationSettings>
</telerik:GridNumericColumn>
<telerik:GridNumericColumn Aggregate="Sum" FooterText=" " DataField="P2" DataType="System.Double" FilterControlAltText="Filter P2 column" HeaderStyle-Width="65px" HeaderText="P2" SortExpression="P2" UniqueName="P2" NumericType="Currency" FooterAggregateFormatString="{0:C}">
<ColumnValidationSettings>
</ColumnValidationSettings>
</telerik:GridNumericColumn>
<telerik:GridNumericColumn Aggregate="Sum" FooterText=" " DataField="P3" DataType="System.Double" FilterControlAltText="Filter P3 column" HeaderStyle-Width="65px" HeaderText="P3" SortExpression="P3" UniqueName="P3" NumericType="Currency" FooterAggregateFormatString="{0:C}">
<ColumnValidationSettings>
<ModelErrorMessage Text="" />
</ColumnValidationSettings>
</telerik:GridNumericColumn>
<telerik:GridNumericColumn Aggregate="Sum" FooterText=" " DataField="P4" DataType="System.Decimal" FilterControlAltText="Filter P4 column" HeaderStyle-Width="65px" HeaderText="P4" SortExpression="P4" UniqueName="P4" NumericType="Currency" FooterAggregateFormatString="{0:C}">
<ColumnValidationSettings>
<ModelErrorMessage Text="" />
</ColumnValidationSettings>
</telerik:GridNumericColumn>
<telerik:GridNumericColumn Aggregate="Sum" FooterText=" " DataField="P5" DataType="System.Decimal" FilterControlAltText="Filter P5 column" HeaderStyle-Width="65px" HeaderText="P5" SortExpression="P5" UniqueName="P5" NumericType="Currency" FooterAggregateFormatString="{0:C}">
<ColumnValidationSettings>
<ModelErrorMessage Text="" />
</ColumnValidationSettings>
</telerik:GridNumericColumn>
<telerik:GridNumericColumn Aggregate="Sum" FooterText=" " DataField="P6" DataType="System.Decimal" FilterControlAltText="Filter P6 column" HeaderStyle-Width="65px" HeaderText="P6" SortExpression="P6" UniqueName="P6" NumericType="Currency" FooterAggregateFormatString="{0:C}">
<ColumnValidationSettings>
<ModelErrorMessage Text="" />
</ColumnValidationSettings>
</telerik:GridNumericColumn>
<telerik:GridNumericColumn Aggregate="Sum" FooterText=" " DataField="P7" DataType="System.Decimal" FilterControlAltText="Filter P7 column" HeaderStyle-Width="65px" HeaderText="P7" SortExpression="P7" UniqueName="P7" NumericType="Currency" FooterAggregateFormatString="{0:C}">
<ColumnValidationSettings>
<ModelErrorMessage Text="" />
</ColumnValidationSettings>
</telerik:GridNumericColumn>
<telerik:GridNumericColumn Aggregate="Sum" FooterText=" " DataField="P8" DataType="System.Decimal" FilterControlAltText="Filter P8 column" HeaderStyle-Width="65px" HeaderText="P8" SortExpression="P8" UniqueName="P8" NumericType="Currency" FooterAggregateFormatString="{0:C}">
<ColumnValidationSettings>
<ModelErrorMessage Text="" />
</ColumnValidationSettings>
</telerik:GridNumericColumn>
<telerik:GridNumericColumn Aggregate="Sum" FooterText=" " DataField="P9" DataType="System.Decimal" FilterControlAltText="Filter P9 column" HeaderStyle-Width="65px" HeaderText="P9" SortExpression="P9" UniqueName="P9" NumericType="Currency" FooterAggregateFormatString="{0:C}">
<ColumnValidationSettings>
<ModelErrorMessage Text="" />
</ColumnValidationSettings>
</telerik:GridNumericColumn>
<telerik:GridNumericColumn Aggregate="Sum" FooterText=" " DataField="P10" DataType="System.Decimal" FilterControlAltText="Filter P10 column" HeaderStyle-Width="65px" HeaderText="P10" SortExpression="P10" UniqueName="P10" NumericType="Currency" FooterAggregateFormatString="{0:C}">
<ColumnValidationSettings>
<ModelErrorMessage Text="" />
</ColumnValidationSettings>
</telerik:GridNumericColumn>
<telerik:GridNumericColumn Aggregate="Sum" FooterText=" " DataField="P11" DataType="System.Decimal" FilterControlAltText="Filter P11 column" HeaderStyle-Width="65px" HeaderText="P11" SortExpression="P11" UniqueName="P11" NumericType="Currency" FooterAggregateFormatString="{0:C}">
</telerik:GridNumericColumn>
<telerik:GridNumericColumn Aggregate="Sum" FooterText=" " DataField="P12" DataType="System.Decimal" FilterControlAltText="Filter P12 column" HeaderStyle-Width="65px" HeaderText="P12" SortExpression="P12" UniqueName="P12" NumericType="Currency" FooterAggregateFormatString="{0:C}">
</telerik:GridNumericColumn>
<telerik:GridCalculatedColumn HeaderText="Total" HeaderStyle-Width="120px" UniqueName="TotalPrice" DataType="System.Decimal"
DataFields="P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12" Expression="{0}+{1}+{2}+{3}+{4}+{5}+{6}+{7}+{8}+{9}+{10}+{11}" FooterText=" "
Aggregate="Sum" DataFormatString="{0:$###,##0.00}">
</telerik:GridCalculatedColumn>
</Columns>
Hi Telerik Team,
Our company try to change editor's skin to "Bootstrap" but we found some UI issues. If we open some plugins, such as "Table Wizard", some icons not centered. I compared it with RadEditor demo site, I found our Editor plugin window using table but demo site using Div. Is there any way we can change the setting?
We are using 2017.2.621.40 Version. Please see the attachment for our plugin page.
Thanks in advance,
Lan
I have created a Grid ServerSide. The first time the grid loads it is fine, but any time a subsequent load happens I get the above error for any column where I am trying to set a UniqueName. I am clearing out all columns before new ones are created so I don't see why I am getting this. Here is a snippit of my code:
// Clear all Grid Columns to start from scratch
RadGrid.MasterTableView.Columns.Clear();
foreach
(
string
column
in
columns)
{
if
(column.ToLower() ==
"recordid"
)
{
RadGrid.MasterTableView.ClientDataKeyNames =
new
string
[] { column };
RadClientDataSource1.Schema.Model.ID = column;
continue
;
}
GridBoundColumn col =
new
GridBoundColumn()
{
DataField = column,
UniqueName = column,
HeaderText = column.Replace(
"_"
,
" "
),
FilterDelay = 300
};
RadGrid1.MasterTableView.Columns.Add(col);
}
I have a form with telerik drop downs (with autopostback) and buttons.
then a grid form. the grid form takes sometimes a while to load.
if a user during that grid load changes a drop down before the grid is done then the page errors.
object not set
how can I put a spinning graphic (loading) overlay and/or keep the drop downs from working until my grid is fully loaded?
I would like to have a Checkboxlist inside the editItemTemplate of a dataform. I want the checkboxlist to be populated from the sql database programmatically.
I am using VB.
Here is my aspx code
<%@ Page Title="" Language="VB" MasterPageFile="~/Header.master" AutoEventWireup="false" CodeFile="EditProposal.aspx.vb" Inherits="StepI_EditProposal" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Main" Runat="Server">
<telerik:RadScriptManager runat="server" ID="rsm"></telerik:RadScriptManager>
<telerik:RadDataForm ID="RadDataForm1" runat="server" CssClass="rdfLeftAligned rdfNoFieldHint" OnItemEditing="loadcounty" DataKeyNames="authrepid,applicationid" DataSourceID="SqlDataSource1" >
<LayoutTemplate>
<div class="RadDataForm RadDataForm_<%# Container.Skin %> rdfLeftAligned rdfNoFieldHint">
<div id="itemPlaceholder" runat="server">
</div>
</div>
</LayoutTemplate>
<ItemTemplate>
<div class="rdfRow">
<asp:Label ID="fiscalorgnameLabel2" runat="server" CssClass="rdfLabel" Text="Fiscal Organization:"></asp:Label>
<asp:Label ID="fiscalorgnameLabel1" runat="server" CssClass="rdfFieldValue" Text='<%# Eval("fiscalorgname") %>' />
</div>
<div class="rdfRow">
<asp:Label ID="behalfofLabel2" runat="server" CssClass="rdfLabel" Text="On Behalf of:"></asp:Label>
<asp:Label ID="behalfofLabel1" runat="server" CssClass="rdfFieldValue" Text='<%# Eval("behalfof") %>' />
</div>
<div class="rdfRow">
<asp:Label ID="authrepLabel2" runat="server" CssClass="rdfLabel" Text="Authorized Representative:"></asp:Label>
<asp:Label ID="authrepLabel1" runat="server" CssClass="rdfFieldValue" Text='<%# Eval("authrep") %>' />
</div>
<div class="rdfRow">
<asp:Label ID="addressLabel2" runat="server" CssClass="rdfLabel" Text="Address"></asp:Label>
<asp:Label ID="addressLabel1" runat="server" CssClass="rdfFieldValue" Text='<%# Eval("address") %>' />
<asp:Label ID="cityLabel1" runat="server" CssClass="rdfFieldValue" Text='<%# Eval("city") %>' />
<asp:Label ID="stateLabel1" runat="server" CssClass="rdfFieldValue" Text='<%# Eval("state") %>' />
<asp:Label ID="ZipCodeLabel1" runat="server" CssClass="rdfFieldValue" Text='<%# Eval("ZipCode") %>' />
</div>
<div class="rdfRow">
<asp:Label ID="telephoneLabel2" runat="server" CssClass="rdfLabel" Text="Telephone:"></asp:Label>
<asp:Label ID="telephoneLabel1" runat="server" CssClass="rdfFieldValue" Text='<%# Eval("telephone") %>' />
</div>
<div class="rdfRow">
<asp:Label ID="emailLabel2" runat="server" CssClass="rdfLabel" Text="Email:"></asp:Label>
<asp:Label ID="emailLabel1" runat="server" CssClass="rdfFieldValue" Text='<%# Eval("email") %>' />
</div>
<div class="rdfRow">
<asp:Label ID="ciFirstname" runat="server" Text="First Name:"></asp:Label>
<asp:Label ID="ciFirstName1" runat="server" text='<%# Eval("firstname1") %>'></asp:Label>
</div>
<div class="rdfRow">
<asp:Label ID="ciAddress" runat="server" Text="Address:"></asp:Label>
<asp:Label ID="Label2" runat="server" text='<%# Eval("address1") %>'></asp:Label>
<asp:Label ID="Label1" runat="server" CssClass="rdfFieldValue" Text='<%# Eval("city1") %>' />
<asp:Label ID="Label3" runat="server" CssClass="rdfFieldValue" Text='<%# Eval("state1") %>' />
<asp:Label ID="Label4" runat="server" CssClass="rdfFieldValue" Text='<%# Eval("ZipCode1") %>' />
</div>
<div class="rdfRow">
<asp:Label ID="Label5" runat="server" CssClass="rdfLabel" Text="Telephone:"></asp:Label>
<asp:Label ID="Label6" runat="server" CssClass="rdfFieldValue" Text='<%# Eval("telephone1") %>' />
</div>
<div class="rdfRow">
<asp:Label ID="lblRegion" runat="server" Text="Region:" CssClass="rdflabel"></asp:Label>
<asp:Label ID="txtRegion" runat="server" Text='<%# Eval("region") %>' CssClass="rdfFieldValue"></asp:Label>
</div>
<div class="rdfRow">
<asp:Label ID="lblCounty" runat="server" Text="County/Counties:" CssClass="rdflabel"></asp:Label>
<asp:datalist ID="dlCounty" runat="server" datasourceid="sqlCounty" CssClass="rdfFieldValue">
<ItemTemplate>
<asp:label id="county" runat="server" text='<%# Eval("county") %>'></asp:label>
</ItemTemplate>
</asp:datalist>
</div>
<div class="rdfRow">
<asp:Label ID="lblProposalSummary" runat="server" Text="Proposal Summary" CssClass="rdfLabel"></asp:Label>
<asp:label ID="txtPropSummary" runat="server" Text='<%# Eval("proposalsummary") %>' BorderStyle="Solid" BorderWidth="1px" Width="80%"></asp:label>
</div>
<div class="rdfRow">
<asp:Label ID="lblMatchFunds" runat="server" Text="Matching Funds Overview" CssClass="rdfLabel"></asp:Label>
<asp:label ID="txtMatchFunds" runat="server" Text='<%# Eval("matchingFundssummary") %>' BorderStyle="Solid" BorderWidth="1px" Width="80%"></asp:label>
</div>
<div class="rdfCommandButtons">
<hr class="rdfHr" />
<telerik:RadButton ID="EditButton" runat="server" ButtonType="SkinnedButton" CausesValidation="False" CommandName="Edit" RenderMode="Lightweight" Text="Edit" ToolTip="Edit" />
</div>
</ItemTemplate>
<EditItemTemplate>
<div class="rdfRow">
<asp:Label ID="fiscalorgnameLabel2" runat="server" AssociatedControlID="fiscalorgnameTextBox" CssClass="rdfLabel" Text="Fiscal Organization:"></asp:Label>
<telerik:RadTextBox ID="fiscalorgnameTextBox" runat="server" RenderMode="Lightweight" Text='<%# Bind("fiscalorgname") %>' WrapperCssClass="rdfInput" />
</div>
<div class="rdfRow">
<asp:Label ID="behalfofLabel2" runat="server" AssociatedControlID="behalfofTextBox" CssClass="rdfLabel" Text="On Behalf of:"></asp:Label>
<telerik:RadTextBox ID="behalfofTextBox" runat="server" RenderMode="Lightweight" Text='<%# Bind("behalfof") %>' WrapperCssClass="rdfInput" />
</div>
<div>
Authorized Representative:
</div>
<div class="rdfRow">
<asp:Label ID="firstnameLabel2" runat="server" AssociatedControlID="firstnameTextBox" CssClass="rdfLabel" Text="First Name"></asp:Label>
<telerik:RadTextBox ID="firstnameTextBox" runat="server" RenderMode="Lightweight" Text='<%# Bind("firstname") %>' WrapperCssClass="rdfInput" />
</div>
<div class="rdfRow">
<asp:Label ID="lastnameLabel2" runat="server" AssociatedControlID="lastnameTextBox" CssClass="rdfLabel" Text="Last Name"></asp:Label>
<telerik:RadTextBox ID="lastnameTextBox" runat="server" RenderMode="Lightweight" Text='<%# Bind("lastname") %>' WrapperCssClass="rdfInput" />
</div>
<div class="rdfRow">
<asp:Label ID="addressLabel2" runat="server" AssociatedControlID="addressTextBox" CssClass="rdfLabel" Text="Address:"></asp:Label>
<telerik:RadTextBox ID="addressTextBox" runat="server" RenderMode="Lightweight" Text='<%# Bind("address") %>' WrapperCssClass="rdfInput" />
</div>
<div class="rdfRow">
<asp:Label ID="cityLabel2" runat="server" AssociatedControlID="cityTextBox" CssClass="rdfLabel" Text="City:"></asp:Label>
<telerik:RadTextBox ID="cityTextBox" runat="server" RenderMode="Lightweight" Text='<%# Bind("city") %>' WrapperCssClass="rdfInput" />
</div>
<div class="rdfRow">
<asp:Label ID="stateLabel2" runat="server" AssociatedControlID="stateTextBox" CssClass="rdfLabel" Text="State:"></asp:Label>
<telerik:RadTextBox ID="stateTextBox" runat="server" RenderMode="Lightweight" Text='<%# Bind("state") %>' WrapperCssClass="rdfInput" />
</div>
<div class="rdfRow">
<asp:Label ID="ZipCodeLabel2" runat="server" AssociatedControlID="ZipCodeTextBox" CssClass="rdfLabel" Text="Zip Code"></asp:Label>
<telerik:RadTextBox ID="ZipCodeTextBox" runat="server" RenderMode="Lightweight" Text='<%# Bind("ZipCode") %>' WrapperCssClass="rdfInput" />
</div>
<div class="rdfRow">
<asp:Label ID="telephoneLabel2" runat="server" AssociatedControlID="telephoneTextBox" CssClass="rdfLabel" Text="Telephone"></asp:Label>
<telerik:RadTextBox ID="telephoneTextBox" runat="server" RenderMode="Lightweight" Text='<%# Bind("telephone") %>' WrapperCssClass="rdfInput" />
</div>
<div class="rdfRow">
<asp:Label ID="emailLabel2" runat="server" AssociatedControlID="emailTextBox" CssClass="rdfLabel" Text="Email Address"></asp:Label>
<telerik:RadTextBox ID="emailTextBox" runat="server" RenderMode="Lightweight" Text='<%# Bind("email") %>' WrapperCssClass="rdfInput" />
</div>
<div>Application Contact</div>
<div>
<asp:Label runat="server" ID="lblAppFirstName" Text="First Name" AssociatedControlID="contactFirstName"></asp:Label>
<telerik:RadTextBox runat="server" ID="contactFirstName" Text='<%# Bind("firstname1") %>' WrapperCssClass="rdfInput"></telerik:RadTextBox>
</div>
<div class="rdfRow">
<asp:Label ID="Label7" runat="server" AssociatedControlID="lastnameTextBox" CssClass="rdfLabel" Text="Last Name"></asp:Label>
<telerik:RadTextBox ID="RadTextBox1" runat="server" RenderMode="Lightweight" Text='<%# Bind("lastname1") %>' WrapperCssClass="rdfInput" />
</div>
<div class="rdfRow">
<asp:Label ID="Label8" runat="server" AssociatedControlID="addressTextBox" CssClass="rdfLabel" Text="Address:"></asp:Label>
<telerik:RadTextBox ID="address1" runat="server" RenderMode="Lightweight" Text='<%# Bind("address1") %>' WrapperCssClass="rdfInput" />
</div>
<div class="rdfRow">
<asp:Label ID="Label9" runat="server" AssociatedControlID="cityTextBox" CssClass="rdfLabel" Text="City:"></asp:Label>
<telerik:RadTextBox ID="RadTextBox3" runat="server" RenderMode="Lightweight" Text='<%# Bind("city1") %>' WrapperCssClass="rdfInput" />
</div>
<div class="rdfRow">
<asp:Label ID="Label10" runat="server" AssociatedControlID="stateTextBox" CssClass="rdfLabel" Text="State:"></asp:Label>
<telerik:RadTextBox ID="RadTextBox4" runat="server" RenderMode="Lightweight" Text='<%# Bind("state1") %>' WrapperCssClass="rdfInput" />
</div>
<div class="rdfRow">
<asp:Label ID="Label11" runat="server" AssociatedControlID="ZipCodeTextBox" CssClass="rdfLabel" Text="Zip Code"></asp:Label>
<telerik:RadTextBox ID="RadTextBox5" runat="server" RenderMode="Lightweight" Text='<%# Bind("ZipCode1") %>' WrapperCssClass="rdfInput" />
</div>
<div class="rdfRow">
<asp:Label ID="Label12" runat="server" AssociatedControlID="telephoneTextBox" CssClass="rdfLabel" Text="Telephone"></asp:Label>
<telerik:RadTextBox ID="RadTextBox6" runat="server" RenderMode="Lightweight" Text='<%# Bind("telephone") %>' WrapperCssClass="rdfInput" />
</div>
<div class="rdfRow">
<asp:Label ID="Label13" runat="server" AssociatedControlID="emailTextBox" CssClass="rdfLabel" Text="Email Address"></asp:Label>
<telerik:RadTextBox ID="RadTextBox7" runat="server" RenderMode="Lightweight" Text='<%# Bind("email1") %>' WrapperCssClass="rdfInput" />
</div>
<div class="rdfRow">
<asp:Label ID="County" runat="server" Text="County:"></asp:Label>
<telerik:RadCheckBoxList runat="server" ID="ckCounty" ></telerik:RadCheckBoxList>
<asp:SqlDataSource runat="server" ID="sqlSelectCounty" ConnectionString='<%$ ConnectionStrings:COSI_GRANTS_TEST %>' SelectCommand="SELECT [County], [CountyID] FROM [County]"></asp:SqlDataSource>
</div>
<div class="rdfRow">
<asp:Label ID="PropLabel" runat="server" Text="Propsal Summary" ></asp:Label>
</div>
<div class="rdfRow">
<asp:TextBox ID="txtProposal" runat="server" Text='<%# Bind("proposalsummary") %>'></asp:TextBox>
</div>
<div class="rdfRow">
<asp:Label ID="Label14" runat="server" Text="Matching Funds Overview"></asp:Label>
</div>
<div class="rdfRow">
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("matchingfundssummary") %>'></asp:TextBox>
</div>
<div class="rdfCommandButtons">
<hr class="rdfHr" />
<telerik:RadButton ID="UpdateButton" runat="server" ButtonType="SkinnedButton" CommandName="Update" RenderMode="Lightweight" Text="Update" ToolTip="Update" />
<telerik:RadButton ID="CancelButton" runat="server" ButtonType="SkinnedButton" CausesValidation="False" CommandName="Cancel" RenderMode="Lightweight" Text="Cancel" ToolTip="Cancel" />
</div>
</EditItemTemplate>
<EmptyDataTemplate>
<div class="RadDataForm RadDataForm_<%# Container.Skin %>">
<div class="rdfEmpty">
There are no items to be displayed.</div>
</div>
</EmptyDataTemplate>
</telerik:RadDataForm>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:COSI_GRANTS_TEST %>" SelectCommand="getApplicationsByAppId" SelectCommandType="StoredProcedure" UpdateCommand="update application set fiscalorgname = @fiscalorgname where applicationid=@appid; update [Authorized_Rep] set firstname=@firstname, lastname=@lastname, address=@address, city=@city, state=@state, zipcode=@zipcode, telephone=@telephone, email=@email where authrepid=@authrepid">
<SelectParameters>
<asp:QueryStringParameter Name="appid" QueryStringField="appid" Type="Int32" />
</SelectParameters>
<UpdateParameters>
<asp:Parameter Name="fiscalorgname" DefaultValue="fiscalOrgname"></asp:Parameter>
<asp:QueryStringParameter Name="appid" querystringfield="appid" ></asp:QueryStringParameter>
<asp:Parameter Name="firstname" />
<asp:parameter name="lastname"/>
<asp:Parameter Name="city" />
<asp:Parameter Name="state" />
<asp:Parameter Name="zipcode" />
<asp:Parameter Name="telephone" />
<asp:Parameter Name="email" />
<asp:Parameter Name="city1" />
<asp:parameter name="authrepid"></asp:parameter>
</UpdateParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="sqlCounty" runat="server" ConnectionString='<%$ ConnectionStrings:COSI_GRANTS_TEST %>' SelectCommand="SELECT ac.ApplicationId, ac.CountyId, c.County FROM Application_County AS ac INNER JOIN County AS c ON c.CountyID = ac.CountyId WHERE (ac.ApplicationId = @appid)">
<SelectParameters>
<asp:QueryStringParameter QueryStringField="appid" Name="appid"></asp:QueryStringParameter>
</SelectParameters>
</asp:SqlDataSource>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Footer" Runat="Server">
</asp:Content>
------------------------------
ANd here is my vb code
Imports System.Data
Imports System.Collections.Generic
Imports System.Data.SqlClient
Imports System.Data.DataTable
Imports System.Data.DataRelation
Imports System.IO
Imports System.IO.Stream
Imports System.IO.MemoryStream
Imports System.Configuration.ConfigurationManager
Imports Telerik.Web.UI
Imports System.Web.UI.WebControls.CheckBoxList
Imports Telerik.Web.Data
Partial Class StepI_EditProposal
Inherits System.Web.UI.Page
Dim conn As New SqlConnection(ConnectionStrings("COSIGrantsDB").ConnectionString)
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
If Not IsPostBack Then
LoadCounty()
End If
End Sub
Protected Sub LoadCounty()
conn.Open()
Dim ck As New RadCheckBoxList()
Me.Controls.Add(ck)
Dim dt As DataTable = New DataTable()
Dim ad As SqlDataAdapter = New SqlDataAdapter("Select countyid, county from county order by county", conn)
ad.Fill(dt)
Dim ck As New CheckBoxList()
ck = TryCast(RadDataForm1.FindControl("ckCounty"), CheckBoxList)
ck.DataSource = dt
ck.DataTextField = "county"
ck.DataValueField = "countyid"
ck.DataBind()
Dim cmd As New SqlCommand("Select * from application _county where applicationid = " & Request.QueryString("appid"), conn)
Dim rdr = cmd.ExecuteReader()
Dim ckvalue As String
While rdr.Read()
For i = 0 To ck.Items.Count - 1
ckvalue = ck.Items(i).Value
If ckvalue = rdr.GetValue(0) Then
ck.Items(i).Selected = True
End If
Next
End While
rdr.Close()
dt.Clear()
conn.Close()
End Sub
Protected Sub raddataform1_itemdatabound(ByVal sender As Object, ByVal e As RadDataFormItemEventArgs) Handles RadDataForm1.ItemDataBound
Dim editableItem As RadDataFormEditableItem = TryCast(e.Item, RadDataFormEditableItem)
LoadCounty()
End Sub
Protected Sub ckCounty_DataBinding1(sender As Object, e As EventArgs)
End Sub
End Class
Thank you
Dev environment: Win10, VS2017, DNN Evoq Community 9.1.1, target framework = 4.5, SqlServer 2012, Telerik 2017.2.711.40
Production environment: Win Server 2012, DNN Evoq Basic 9.1.1, target framework = 4.5, SqlServer 2012, , Telerik 2017.2.711.40
My custom DNN module allows row selection on my dev PC, but when I copy it to the server it does not allow row selection. I have tried client- and server-side tactics. Any thoughts?
This is my markup in server-side mode.
<telerik:RadGrid ID="rgPlacements" runat="server"
AllowSorting="True"
AutoGenerateColumns="False"
HeaderStyle-HorizontalAlign="Center"
HeaderStyle-VerticalAlign="Top"
ItemStyle-VerticalAlign="Top"
AlternatingItemStyle-VerticalAlign="Top"
Skin="WebBlue"
RenderMode="Classic"
AllowPaging="True"
PageSize="50"
AllowMultiRowSelection="True"
DataSourceID="sdsArchive"
AllowFilteringByColumn="True"
OnInit="rgPlacements_Init">
<%-- <ClientSettings>
<Selecting AllowRowSelect="True"/>
</ClientSettings>--%>
<ExportSettings
FileName="Placements"
ExportOnlyData="true"
IgnorePaging="true"
OpenInNewWindow="true"
HideStructureColumns="true">
</ExportSettings>
<GroupingSettings CollapseAllTooltip="Collapse all groups"></GroupingSettings>
<AlternatingItemStyle VerticalAlign="Top" />
<MasterTableView CommandItemDisplay="Top" DataKeyNames="PK_ID" DataSourceID="sdsArchive" Name="Placements">
<CommandItemSettings ShowAddNewRecordButton="false" ShowExportToExcelButton="true" ShowRefreshButton="false" />
<Columns>
<telerik:GridBoundColumn AllowFiltering="true" DataField="DisplayName" FilterControlAltText="Filter DisplayName column" HeaderText="Name" SortExpression="DisplayName" UniqueName="DisplayName">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn AllowFiltering="false" DataField="HoursCompleted" DataType="System.Decimal" FilterControlAltText="Filter HoursCompleted column" HeaderText="Hours completed" SortExpression="HoursCompleted" UniqueName="HoursCompleted">
<ItemStyle HorizontalAlign="Center" Width="10%" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn AllowFiltering="true" DataField="Supervisor" FilterControlAltText="Filter Supervisor column" HeaderText="Supervisor" SortExpression="Supervisor" UniqueName="Supervisor">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn AllowFiltering="true" DataField="DateSupervisorApproval" DataFormatString="{0:d}" DataType="System.DateTime" FilterControlAltText="Filter DateApproved column" HeaderText="Approved" SortExpression="DateApproved" UniqueName="DateApproved">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn AllowFiltering="true" DataField="Name" FilterControlAltText="Filter Name column" HeaderText="Org. name" SortExpression="Name" UniqueName="Name">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn AllowFiltering="false" DataField="IsProBonoName" FilterControlAltText="Filter IsProBonoName column" HeaderText="Type" SortExpression="IsProBonoName" UniqueName="IsProBonoName">
</telerik:GridBoundColumn>
<%-- <telerik:GridClientSelectColumn HeaderText="Archive" UniqueName="ClientSelectColumn">
<ItemStyle HorizontalAlign="Center" />
</telerik:GridClientSelectColumn>--%>
<telerik:GridTemplateColumn UniqueName="CheckBoxTemplateColumn" AllowFiltering="false">
<ItemTemplate>
<asp:CheckBox ID="CheckBox1" runat="server" OnCheckedChanged="ToggleRowSelection"
AutoPostBack="True" />
</ItemTemplate>
<HeaderTemplate>
<asp:CheckBox ID="headerChkbox" runat="server" OnCheckedChanged="ToggleSelectedState"
AutoPostBack="True" />
</HeaderTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
<HeaderStyle HorizontalAlign="Center" VerticalAlign="Top" />
<ItemStyle VerticalAlign="Top" />
</telerik:RadGrid>
</telerik:RadAjaxPanel>
<asp:SqlDataSource ID="sdsArchive" runat="server" ConnectionString="<%$ ConnectionStrings:SiteSqlServer %>"
SelectCommand="sp_tlsGetPlacementsForArchiving" SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:ControlParameter ControlID="hfToggleState" DefaultValue="0" Name="Archived" PropertyName="Value" Type="Boolean" />
</SelectParameters>
</asp:SqlDataSource>
<!-- I added this class -->
<
p
class
=
"first_p_only"
>Only the first paragraph should be styled.</
p
>
<!-- Editor adds this class to all subsequent paragraphs -->
<
p
class
=
"first_p_only"
>This paragraph should be style free.</
p
>
<
p
class
=
"first_p_only"
>Also supposed to be style free.</
p
>