Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I am creating new datatype in render control usinf Tim 3 classes way but did not find teh control in render control drop down Classes Code:
namespace umb.etx.telrichControl
{
class richPrevalueEditor: System.Web.UI.WebControls.PlaceHolder, umbraco.interfaces.IDataPrevalue
#region IDataPrevalue Members
// referenced datatype
private umbraco.cms.businesslogic.datatype.BaseDataType _datatype;
private TextBox _txtLimit;
public richPrevalueEditor(umbraco.cms.businesslogic.datatype.BaseDataType DataType)
_datatype = DataType;
setupChildControls();
}
private void setupChildControls()
_txtLimit = new TextBox();
_txtLimit.ID = "txtLimit";
_txtLimit.CssClass = "umbEditorTextField";
Controls.Add(_txtLimit);
public Control Editor
get
return this;
protected override void OnLoad(EventArgs e)
base.OnLoad(e);
if (!Page.IsPostBack)
if (Configuration.Length > 0)
_txtLimit.Text = Configuration;
else
_txtLimit.Text = "100";
public void Save()
_datatype.DBType = (umbraco.cms.businesslogic.datatype.DBTypes)Enum.Parse(typeof(umbraco.cms.businesslogic.datatype.DBTypes), DBTypes.Ntext.ToString(), true);
string data = _txtLimit.Text;
SqlHelper.ExecuteNonQuery("delete from cmsDataTypePreValues where datatypenodeid = @dtdefid",
SqlHelper.CreateParameter("@dtdefid", _datatype.DataTypeDefinitionId));
SqlHelper.ExecuteNonQuery("insert into cmsDataTypePreValues (datatypenodeid,[value],sortorder,alias) values (@dtdefid,@value,0,'')",
SqlHelper.CreateParameter("@dtdefid", _datatype.DataTypeDefinitionId), SqlHelper.CreateParameter("@value", data));
protected override void Render(HtmlTextWriter writer)
writer.WriteLine("<table>");
writer.Write("<tr><th>Character Limit:</th><td>");
_txtLimit.RenderControl(writer);
writer.Write("</td></tr>");
writer.Write("</table>");
public string Configuration
object conf =
SqlHelper.ExecuteScalar<object>("select value from cmsDataTypePreValues where datatypenodeid = @datatypenodeid",
SqlHelper.CreateParameter("@datatypenodeid", _datatype.DataTypeDefinitionId));
if (conf != null)
return conf.ToString();
return "";
#endregion
public static ISqlHelper SqlHelper
return Application.SqlHelper;
Sorry dont know how to use code Tags.
Any Help..
i have also developed a dll by using the same code illustrated in http://www.nibble.be/?p=62 and create package but still not luck. Am I doing mistake in creating package or any thing alse.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Issue in creating datatype using telrik rad controls
I am creating new datatype in render control usinf Tim 3 classes way but did not find teh control in render control drop down
Classes Code:
namespace umb.etx.telrichControl
{
class richPrevalueEditor: System.Web.UI.WebControls.PlaceHolder, umbraco.interfaces.IDataPrevalue
{
#region IDataPrevalue Members
// referenced datatype
private umbraco.cms.businesslogic.datatype.BaseDataType _datatype;
private TextBox _txtLimit;
public richPrevalueEditor(umbraco.cms.businesslogic.datatype.BaseDataType DataType)
{
_datatype = DataType;
setupChildControls();
}
private void setupChildControls()
{
_txtLimit = new TextBox();
_txtLimit.ID = "txtLimit";
_txtLimit.CssClass = "umbEditorTextField";
Controls.Add(_txtLimit);
}
public Control Editor
{
get
{
return this;
}
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
if (!Page.IsPostBack)
{
if (Configuration.Length > 0)
{
_txtLimit.Text = Configuration;
}
else
{
_txtLimit.Text = "100";
}
}
}
public void Save()
{
_datatype.DBType = (umbraco.cms.businesslogic.datatype.DBTypes)Enum.Parse(typeof(umbraco.cms.businesslogic.datatype.DBTypes), DBTypes.Ntext.ToString(), true);
string data = _txtLimit.Text;
SqlHelper.ExecuteNonQuery("delete from cmsDataTypePreValues where datatypenodeid = @dtdefid",
SqlHelper.CreateParameter("@dtdefid", _datatype.DataTypeDefinitionId));
SqlHelper.ExecuteNonQuery("insert into cmsDataTypePreValues (datatypenodeid,[value],sortorder,alias) values (@dtdefid,@value,0,'')",
SqlHelper.CreateParameter("@dtdefid", _datatype.DataTypeDefinitionId), SqlHelper.CreateParameter("@value", data));
}
protected override void Render(HtmlTextWriter writer)
{
writer.WriteLine("<table>");
writer.Write("<tr><th>Character Limit:</th><td>");
_txtLimit.RenderControl(writer);
writer.Write("</td></tr>");
writer.Write("</table>");
}
public string Configuration
{
get
{
object conf =
SqlHelper.ExecuteScalar<object>("select value from cmsDataTypePreValues where datatypenodeid = @datatypenodeid",
SqlHelper.CreateParameter("@datatypenodeid", _datatype.DataTypeDefinitionId));
if (conf != null)
return conf.ToString();
else
return "";
}
}
#endregion
public static ISqlHelper SqlHelper
{
get
{
return Application.SqlHelper;
}
}
}
}
Sorry dont know how to use code Tags.
Any Help..
i have also developed a dll by using the same code illustrated in http://www.nibble.be/?p=62 and create package but still not luck. Am I doing mistake in creating package or any thing alse.
is working on a reply...