| Imports System.Data.SqlClient |
| Imports Telerik.Web.UI |
| Imports System.Drawing |
| Partial Class category |
| Inherits System.Web.UI.Page |
| Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load, Me.Load |
| 'Put user code to initialize the page here |
| RadGrid1.DataBind() |
| End Sub |
| Protected Sub btninsert_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btninsert.Click |
| Dim sConnStr As String = "Data Source=Barlet-HP\SQLEXPRESS;Initial Catalog=KDN;Integrated Security=True" |
| Dim cnBKTest As New SqlConnection(sConnStr) |
| Dim cmdTest As New SqlCommand("addGroup", cnBKTest) |
| cmdTest.CommandType = Data.CommandType.StoredProcedure |
| cmdTest.Parameters.Add(New SqlParameter("@Group_Name", Data.SqlDbType.VarChar)) |
| cmdTest.Parameters("@Group_Name").Value = TextBox1.Text.ToString |
| cnBKTest.Open() |
| cmdTest.ExecuteNonQuery() |
| cnBKTest.Close() |
| RadGrid1.DataBind() |
| Label2.Text = "Last Inserted Category is: " & TextBox1.Text |
| TextBox1.Text = "" |
| TextBox1.Focus() |
| '''''''''''''''''''''''''''''''''''''''''''''' |
| End Sub |
| Protected Sub RadGrid1_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource |
| End Sub |
| Protected Sub RadGrid1_ItemDeleted(ByVal source As Object, ByVal e As Telerik.Web.UI.GridDeletedEventArgs) Handles RadGrid1.ItemDeleted |
| Dim item As GridDataItem = DirectCast(e.Item, GridDataItem) |
| Dim id As String = item.GetDataKeyValue("Group_id").ToString() |
| If Not e.Exception Is Nothing Then |
| e.ExceptionHandled = True |
| SetMessage("Group with ID " + id + " cannot be deleted. Reason: " + e.Exception.Message) |
| Else |
| SetMessage("Group with ID " + id + " is deleted!") |
| End If |
| End Sub |
| Protected Sub RadGrid1_ItemUpdated(ByVal source As Object, ByVal e As Telerik.Web.UI.GridUpdatedEventArgs) Handles RadGrid1.ItemUpdated |
| Dim item As GridEditableItem = DirectCast(e.Item, GridEditableItem) |
| Dim id As String = item.GetDataKeyValue("Group_id").ToString() |
| If Not e.Exception Is Nothing Then |
| e.KeepInEditMode = True |
| e.ExceptionHandled = True |
| SetMessage("Group with ID " + id + " cannot be updated. Reason: " + e.Exception.Message) |
| Else |
| SetMessage("Group with ID " + id + " is updated!") |
| End If |
| End Sub |
| Protected Sub RadGrid1_ItemInserted(ByVal source As Object, ByVal e As Telerik.Web.UI.GridInsertedEventArgs) Handles RadGrid1.ItemInserted |
| If Not e.Exception Is Nothing Then |
| e.ExceptionHandled = True |
| e.KeepInInsertMode = True |
| SetMessage("Product cannot be inserted. Reason: " + e.Exception.Message) |
| Else |
| SetMessage("New product is inserted!") |
| End If |
| End Sub |
| Private Sub DisplayMessage(ByVal text As String) |
| RadGrid1.Controls.Add(New LiteralControl(String.Format("<span style='color:red'>{0}</span>", text))) |
| End Sub |
| Private Sub SetMessage(ByVal message As String) |
| gridMessage = message |
| End Sub |
| Private gridMessage As String = Nothing |
| Protected Sub RadGrid1_DataBound(ByVal sender As Object, ByVal e As EventArgs) Handles RadGrid1.DataBound |
| If Not String.IsNullOrEmpty(gridMessage) Then |
| DisplayMessage(gridMessage) |
| End If |
| End Sub |
| End Class |
Hello,
We are currently in the process of evaluating RadEditor in order to use it in a MOSS 2007 Publishing project.
Functionality fits our project needs but there are some issues that need clarification.
The version I have deployed on our MOSS Server is RadEditorMOSS 5.6.2.0 and I am using a RadHtmlField embedded in a Page Layout.
I would like to verify the following things regarding Tables:
1. In Table Wizard: Table Properties: CSS Class Layout , there is a drop down with pre-defined styles. Is it possible to create your own custom styles that apply to tables, and how is this done?
2. In the following RadEditor Demo (http://demos.telerik.com/aspnet-ajax/editor/examples/tablelayoutcssfile/defaultcs.aspx)
, when you click on an element of a table, on the bottom of the editor, some choices on setting the element's style appear. Does this functionality exist only in ASP.NET version of the editor, or there is a way to enable it in the MOSS version also?
Your feedback would be very helpful.
Regards,
Kostas
| <telerik:RadGrid ID="grdworkhistory" AllowMultiRowSelection="True" AllowMultiRowEdit="True" |
| Skin="WebBlue" runat="server" AllowAutomaticInserts="True" EnableViewState = "false" |
| Width="97%" PageSize="10" AllowAutomaticUpdates="True" |
| AllowPaging="True" AutoGenerateColumns="False" OnItemCreated="grdworkhistory_ItemCreated" |
| ShowStatusBar="True" |
| GridLines="Both" ShowFooter="True"> |
| <ClientSettings> |
| <Selecting AllowRowSelect="true" /> |
| </ClientSettings> |
| <MasterTableView CommandItemDisplay="Top" DataKeyNames="EmploymentEpisodeId" ClientDataKeyNames="EmploymentEpisodeId" |
| EditMode="EditForms" AutoGenerateColumns="False" Width="100%"> |
| <Columns> |
| <telerik:GridEditCommandColumn> </telerik:GridEditCommandColumn> |
| <telerik:GridBoundColumn DataField="JobEmployer.Name" EditFormColumnIndex="0" HeaderText="Name" SortExpression="Name" |
| UniqueName="WHname" Visible="true"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="JobTitle" EditFormColumnIndex="1" HeaderText="Title" SortExpression="Title" |
| UniqueName="WHtitle" Visible="true"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="JobEmployer.EmployerAddress.Address1" EditFormColumnIndex="0" HeaderText="Address" SortExpression="created_date" |
| UniqueName="WHaddress" Visible="false"> |
| </telerik:GridBoundColumn> |
| <telerik:GridDropDownColumn DataField="JobEmployer.EmployerAddress.AddressCountry.CountryId" EditFormColumnIndex="1" HeaderText="Country" |
| SortExpression="WHcountry" UniqueName="Country" Visible="false" ListTextField="name" ListValueField="countryId"> |
| </telerik:GridDropDownColumn> |
| <telerik:GridBoundColumn DataField="JobEmployer.EmployerAddress.City" EditFormColumnIndex="0" HeaderText="City" |
| SortExpression="WHcity" UniqueName="city" visible="false"> |
| </telerik:GridBoundColumn> |
| <telerik:GridDropDownColumn DataField="JobEmployer.EmployerAddress.AddressState.StateId" EditFormColumnIndex="0" HeaderText="State" |
| SortExpression="WHstate" UniqueName="state" Visible="false" ListTextField="name" ListValueField="stateId"> |
| </telerik:GridDropDownColumn> |
| <telerik:GridBoundColumn DataField="JobEmployer.EmployerAddress.PostalCode" EditFormColumnIndex="1" HeaderText="Postal" |
| SortExpression="WHpostal" UniqueName="postal"> |
| </telerik:GridBoundColumn> |
| <telerik:GridDateTimeColumn EditFormColumnIndex="0" DataField="BeginDate" HeaderText="From" |
| SortExpression="WHfrom" UniqueName="beginDate" Visible="true" > |
| </telerik:GridDateTimeColumn> |
| <telerik:GridDateTimeColumn EditFormColumnIndex="1" DataField="EndDate" HeaderText="To" |
| SortExpression="WHto" UniqueName="endDate" Visible="true"> |
| </telerik:GridDateTimeColumn> |
| <telerik:GridBoundColumn ItemStyle-Wrap="true" EditFormColumnIndex="0" DataField="Description" |
| SortExpression="WHDescription" UniqueName="description" Visible="false"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn ItemStyle-Wrap="true" EditFormColumnIndex="0" DataField="EmploymentEpisodeId" |
| SortExpression="WHID" UniqueName="EmploymentEpisodeId" Visible="false"> |
| </telerik:GridBoundColumn> |
| </Columns> |
| <EditFormSettings ColumnNumber="2" CaptionDataField="Work History" CaptionFormatString="Edit properties for work history"> |
| <FormTableItemStyle Wrap="true"></FormTableItemStyle> |
| <FormCaptionStyle > </FormCaptionStyle> |
| <FormMainTableStyle GridLines="Horizontal" CellSpacing="0" CellPadding="3" BackColor="White" |
| Width="100%" /> |
| <FormTableStyle CellSpacing="0" CellPadding="2" Height="110px" |
| BackColor="White" /> |
| <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle> |
| <EditColumn ButtonType="LinkButton" |
| InsertText="Insert " UpdateText="Update record" UniqueName="EditCommandworkhistory" CancelText="Cancel edit"> |
| </EditColumn> |
| <FormTableButtonRowStyle HorizontalAlign="Left" ></FormTableButtonRowStyle> |
| </EditFormSettings> |
| </MasterTableView> |
| </telerik:RadGrid> |