In our system we have a dynamic RedTreeView which is constructed on load and all nodes got a ID.
I need the treeview to:
Collapsing the entire treeview is easy, but finding the node and expanding it seems to be a hassle.
.
I'm currently using a RadFilter on a page that contains the following field editors:
<
FieldEditors
>
<
telerik:RadFilterDateFieldEditor
DataType
=
"System.DateTime"
DisplayName
=
"Date Created"
FieldName
=
"DateCreated"
/>
<
telerik:RadFilterTextFieldEditor
DataType
=
"System.DateTime"
DisplayName
=
"Date Last Modified"
FieldName
=
"DateModified"
/>
<
telerik:RadFilterNumericFieldEditor
DisplayName
=
"File Size (bytes)"
FieldName
=
"FileSizeBytes"
DataType
=
"System.Int32"
PreviewDataFormat
=
"'{0:#,##0}'"
/>
</
FieldEditors
>
I'm using the RadFilter in an unusual way, however. I'm not using it against live data. Instead, I'm using RadFilter to build a Linq "Where" clause that I save, and then I add that "Where" clause to a Linq query later.
For example, here is a Linq query created by the RadFilter, in combination with RadFilterDynamicLinqQueryProvider:
(it.DateCreated = DateTime.Parse(
"3/16/2015 12:00:00 AM"
)
AND
it.DateModified > DateTime.Parse(
"3/16/2015 12:00:00 AM"
)
AND
it.FileSizeBytes > 0)
It currently works perfectly. What I would like to do, however, is to use a "dynamic date syntax" in place of an actual hard-coded date when entering the text into the RadFilterDateFieldEditor. At a later time, my code will substitute this "dynamic date syntax" with an actual date, before running the actual Linq query. So what I would like the RadFilter-generated Linq query to look like is this:
(it.DateCreated = DateTime.Parse(
"[MM/dd/yyyy hh:mm:ss PP]"
)
AND
it.DateModified > DateTime.Parse(
"[MM/dd/yyyy hh:mm:ss PP]"
)
AND
it.FileSizeBytes > 0)
I would then substitute everything within the brackets with the current date and time just before executing the query, so that it would look exactly like the first query example before executing. (The exception being that the actual dates would be different, of course, and would vary depending on when the query was going to execute.)
When I try to enter my dynamic date syntax into the text box, however, it fails validation immediately because it contains non-date characters. The warning symbol pops up inside the text box to show invalid input.
I tried to use a RadFilterTextFieldEditor instead of a RadFilterDateFieldEditor, and the validation was no longer an issue (no warning symbol popped up inside the text box). When I attempted to save the settings and generate the Linq query, however, I got the following error:
System.FormatException: String was not recognized
as
a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at System.Convert.ToDateTime(String value, IFormatProvider provider)
at System.String.System.IConvertible.ToDateTime(IFormatProvider provider)
at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
at System.Convert.ChangeType(Object value, Type conversionType)
at Telerik.Web.UI.RadFilterNonGroupExpression.ParseValue[T](Object value)
at Telerik.Web.UI.RadFilterSingleValueExpression`1.Telerik.Web.UI.IRadFilterValueExpression.SetValues(ArrayList values)
at Telerik.Web.UI.RadFilter.FetchExpressionsValues(RadFilterGroupExpressionItem group)
at Telerik.Web.UI.RadFilter.SaveSettings()
So it appears that the RadFilter code is parsing the value of the input when saving the settings, and of course the parse fails. I would like it to succeed anyway, of course, so that I can substitute the actual date just before I run the Linq query. I can always verify the user input using other methods, and throw an error if the input will not result in a valid generated date.
Changing the DataType from System.DateTime to System.String is not an option, because then the control uses string comparisons instead of date comparisons, and the Linq query changes completely.
I already have a dynamic date component that's fully functional. It does a lot more than simply substitute the current date, however. There are numerous possible output formats, as well as numerous possible calculations that can be applied on the date, and you can even run external scripts that return dates if the built-in functions don't meet your needs. The choices are so many that I have an ASP.NET web server control that I'd like to use instead of a regular text box inside the RadFilterDateFieldEditor, to make it easy to choose the correct dynamic date syntax. I'll be happy to worry about that later, however, if I can somehow get the filter to work the way that I want even with manually-typed dynamic date syntax.
I've been reading a bit about creating your own custom field editors. I think that the SaveSettings() issue is outside of that, however. I think that I would get the same DateTime.Parse() error even if I wrote my own custom field editor. So I would like to fix the SaveSettings() issue first, before worrying about creating my own custom field editor.
I know it's an unusual application of the RadFilter, but any help getting things to work the way I'd like them to would be greatly appreciated.
Thank you.
I set CurrentFilterFunction="EqualTo" and filter on number 1.
But i get number 1, 10, 11,12,13,14,21 etc......
SqlDbType is VarChar
What do i wrong?
Which is prefered and recommended way to create custom skins?
I know that i can create skin with Visual Style Builder and compile it with acTelerikStylesAssembly to DLL library, which i can attache to SkinManager etc.
I know that i can copy files from C:\Program Files (x86)\Telerik\UI for ASP.NET AJAX Q1 2015\Skins, rename it with acTelerikStylesRenaming or manual and place them in App_Themes folder etc.
But...
In C:\Program Files (x86)\Telerik\UI for ASP.NET AJAX Q1 2015\Skins subfolders i have more folders and files than in skin *.zip file downloaded from VisualStyleBuilder. Why? If i create two skins by two different ways, my application will be working in the same way and looks great with both skins?
I must create four skins for my application (light and dark for normal users and two high contrast for users with some dysfunction), and this will be hard work for me, that i must know how to make it with minimal effort.
P.S. Sorry for my bad English.
Exception ID: 0 |
From: System.Web |
Time of Error: 6/23/2010 6:42:06 PM |
Exception Type: System.Web.HttpException |
Exception Message: This is an invalid webresource request. |
Exception Source: System.Web |
Source: Path :/WebResource.axd - Raw Url :/WebResource.axd?d=ajTmsUGo059i8jVyULN6WJxyGEzDWeYyk5iXrJ-hlCbfDyKpxWCzGgr__HcHehjE45vAS9-jMMZQxEhj5WlSgsmmlvC8804M8q7f1ZWxcrM4ODuYtuHJilKNWiCjODeP0&t=634129147086009932 |
Stack Trace: at System.Web.Handlers.AssemblyResourceLoader.System.Web.IHttpHandler.ProcessRequest(HttpContext context) |
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() |
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) |
<?xml version="1.0"?> |
<configuration> |
<appSettings> |
<add key="Telerik.ScriptManager.TelerikCdn" value="Enabled" /> |
<add key="Telerik.StyleSheetManager.TelerikCdn" value="Enabled" /> |
</appSettings> |
<system.web> |
<compilation debug="true" targetFramework="4.0" /> |
<customErrors mode="Off" /> |
<sessionState compressionEnabled="true"></sessionState> |
<httpRuntime maxRequestLength="2097151" /> |
<pages maintainScrollPositionOnPostBack="true" controlRenderingCompatibilityVersion="4.0" clientIDMode="AutoID"> |
</pages> |
<httpHandlers> |
<add path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" validate="false" /> |
<add path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" validate="false" /> |
<add path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" validate="false" /> |
<add path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" validate="false" /> |
<add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false" /> |
</httpHandlers> |
<httpModules> |
<add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule" /> |
<add name="RadCompression" type="Telerik.Web.UI.RadCompression" /> |
</httpModules> |
</system.web> |
<system.webServer> |
<modules runAllManagedModulesForAllRequests="true"> |
<remove name="RadUploadModule" /> |
<remove name="RadCompression" /> |
<add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule" preCondition="integratedMode" /> |
<add name="RadCompression" type="Telerik.Web.UI.RadCompression" preCondition="integratedMode" /> |
</modules> |
<validation validateIntegratedModeConfiguration="false" /> |
<handlers> |
<remove name="ChartImage_axd" /> |
<remove name="Telerik_Web_UI_SpellCheckHandler_axd" /> |
<remove name="Telerik_Web_UI_DialogHandler_aspx" /> |
<remove name="Telerik_RadUploadProgressHandler_ashx" /> |
<remove name="Telerik_Web_UI_WebResource_axd" /> |
<add name="ChartImage_axd" path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" preCondition="integratedMode" /> |
<add name="Telerik_Web_UI_SpellCheckHandler_axd" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" preCondition="integratedMode" /> |
<add name="Telerik_Web_UI_DialogHandler_aspx" path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" preCondition="integratedMode" /> |
<add name="Telerik_RadUploadProgressHandler_ashx" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" preCondition="integratedMode" /> |
<add name="Telerik_Web_UI_WebResource_axd" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" preCondition="integratedMode" /> |
</handlers> |
<security> |
<requestFiltering> |
<requestLimits maxAllowedContentLength="2147482624" /> |
</requestFiltering> |
</security> |
</system.webServer> |
</configuration> |
We need to display multiple columns in the radgrid. We want scrolling, reorder, filtering, sorting and column Show/Hide feature of the grid.
When I hide a column. Blank space appears at the end of the grid. Also resizing of other columns takes place
Suppose width of the first 4 columns are 100px, 150px, 200px, 250px
Now. I hide the 2nd column. Grid will resize itself as Width of the 3rd column will be 150px instead of original 200px. 4th will be 200px.
This issue appears in IE8 and with Allow scrolling = true. It works fine in IE11
Hi,
I have a Radcombobox control which runs a javascript function when selected item changes (OnClientSelectedIndexChanged event). When the event is lauched, I want to know the comboBox name that it does. Is there any way?
Thanks.
Hi,
I try to run a LightBox with images read from a database. Because it is not working I tried to today to display an image from a base64 string. I can display the image as RadBinaryImage but it does not show up in the LightBox. I also noticed, that ITemplate.InstantiateIn is never called.
Here is the code behind:
protected
void
Page_Load(
object
sender, EventArgs e)
{
[...]
List<RadLightBoxItem> itemsList =
new
List<RadLightBoxItem>();
byte
[] imageData = Convert.FromBase64String(
"iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAApnSURBVHjaYvz//z/DKBi5ACCAmEaDYGQDgAAaTQAjHAAE0GgCGOEAIIBGE8AIBwABxEKKYkZGRhS+h4cH49+/f8OYmJjCgHIWQCFekLLRYKU9+Pfv372fP38e+vDhw/KLFy+eBwr9AGKUFj0xDXyAAGIkpReAnADc3Nw0gfxpQKbDr1+/GH7//s0w2qOgD2BmZmZgY2NjYGFhASWEL58+fZp34sSJDqDUGyD+TUoCAAggshKAq6urGTDXbwB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AAAwBhKO42ZcdZ+AAAAABJRU5ErkJggg=="
);
RadLightBoxItem my_item =
new
RadLightBoxItem();
my_item.ItemTemplate =
new
LightBoxTemplate(imageData);
my_item.Description =
"The default image"
;
my_item.ImageUrl =
"~/images/test.png"
;
binaryDemoImage.DataValue = imageData;
binaryDemoImage.Width = 100;
binaryDemoImage.Height = 100;
binaryDemoImage.ResizeMode = BinaryImageResizeMode.Fit;
itemsList.Add(my_item);
log.Debug(
"Bild "
+ my_item.Description +
" zur RadLightBox dazu."
);
RadLightBox1.DataSource = itemsList;
RadLightBox1.DataBind();
[...]
}
With:
class
LightBoxTemplate : ITemplate
{
protected
RadBinaryImage image;
private
byte
[] binary;
private
static
readonly
log4net.ILog log = log4net.LogManager.GetLogger(
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public
LightBoxTemplate(
byte
[] binary)
{
log.Debug(
"LightBoxTemplate wurde erstellt mit "
+ binary.Length +
" byte"
);
this
.binary = binary;
}
void
ITemplate.InstantiateIn(Control container)
{
log.Debug(
"InstantiateIn wurde aufgerufen mit "
+ binary.Length +
" byte"
);
image =
new
RadBinaryImage();
image.DataValue = binary;
image.Width = 800;
image.Height = 600;
image.ResizeMode = BinaryImageResizeMode.Fit;
container.Controls.Add(image);
}
}
Here is the aspx-page:
[...]
<
telerik:RadLightBox
ID
=
"RadLightBox1"
runat
=
"server"
PreserveCurrentItemTemplates
=
"true"
Width
=
"800px"
>
</
telerik:RadLightBox
>
<
telerik:RadBinaryImage
ID
=
"binaryDemoImage"
runat
=
"server"
/>
<
asp:Button
ID
=
"Button1"
Text
=
"Open LightBox"
OnClientClick
=
"OpenLigthBox(); return false;"
runat
=
"server"
/>
[...]
And attached is what it looks like.
Can you please help me to get the image show up in the Lightbox? Any advice is warmly welcomed.Thanks!
Ralf