I have a RadGrid displaying data from a SQL DB in which the datetime is UTC.
I would like for the RadGrid to automatically change this datetime so it matches the client's timezone.
How can that be achieved?
® = ®
Hello,
I am working with a RadSearchBox and I would be interested in displaying a list with suggestions triggered from server side, just like when user types in RadSearchBox, but triggered from server instead. The idea is user search triggers a process that populates my database and when process is done, I would like to display the list of suggestions that would match the original search with actual data. Is there any way?
Thank you in advance.
Hello,
I have added One Custom Task Field 'SrNo' as object datatype with respect to demo project given here. I have not used EntityFramework. I am Binding RadGantt's Datasource and DependenciesDataSource simply on Page_Load Event.
To add new Task Field below is the code I have written
public
class
CustomGanttTaskFactory : ITaskFactory
{
Task ITaskFactory.CreateTask()
{
return
new
CustomTask();
}
}
public
class
CustomTask : Task
{
public
CustomTask()
:
base
()
{
}
public
object
SrNo
{
get
{
return
(
object
)(ViewState[
"SrNo"
] ??
""
); }
set
{ ViewState[
"SrNo"
] = value; }
}
protected
override
IDictionary<
string
,
object
> GetSerializationData()
{
var dict =
base
.GetSerializationData();
dict[
"SrNo"
] = SrNo;
return
dict;
}
public
override
void
LoadFromDictionary(System.Collections.IDictionary values)
{
base
.LoadFromDictionary(values);
SrNo = values[
"SrNo"
];
}
}
Page_Load Event:
protected
void
Page_Load(
object
sender, EventArgs e)
{
List<ITask> newFinalTask =
new
List<ITask>();
List<IDependency> FinalDependency =
new
List<IDependency>();
newFinalTask.Add(
new
CustomTask { ID = 1, SrNo =
"1"
, OrderID = 1, ParentID =
null
, Title =
"A"
, Start =
new
DateTime(2015, 01, 10, 0, 0, 0), End =
new
DateTime(2015, 01, 19, 23, 59, 59), PercentComplete = 0.60M, Expanded =
false
, Summary =
true
});
newFinalTask.Add(
new
CustomTask { ID = 2, SrNo =
""
, OrderID = 2, ParentID = 1, Title =
"A1"
, Start =
new
DateTime(2015, 01, 10, 0, 0, 0), End =
new
DateTime(2015, 01, 15, 23, 59, 59), PercentComplete = 0.60M, Expanded =
false
});
newFinalTask.Add(
new
CustomTask { ID = 3, SrNo =
""
, OrderID = 3, ParentID = 1, Title =
"A2"
, Start =
new
DateTime(2015, 01, 16, 0, 0, 0), End =
new
DateTime(2015, 01, 19, 23, 59, 59), PercentComplete = 0.60M, Expanded =
false
});
newFinalTask.Add(
new
CustomTask { ID = 4, SrNo =
"2"
, OrderID = 4, ParentID =
null
, Title =
"B"
, Start =
new
DateTime(2015, 01, 20, 0, 0, 0), End =
new
DateTime(2015, 01, 31, 23, 59, 59), PercentComplete = 0.60M, Expanded =
false
, Summary =
true
});
newFinalTask.Add(
new
CustomTask { ID = 5, SrNo =
""
, OrderID = 5, ParentID = 4, Title =
"B1"
, Start =
new
DateTime(2015, 01, 20, 0, 0, 0), End =
new
DateTime(2015, 01, 31, 23, 59, 59), PercentComplete = 0.60M, Expanded =
false
});
FinalDependency.Add(
new
Dependency { ID = 1, PredecessorID = 1 ,SuccessorID = 4, Type = DependencyType.FinishStart });
RadGantt1.DataSource = newFinalTask;
RadGantt1.DependenciesDataSource = FinalDependency;
}
Design Page:
<
telerik:RadGantt
runat
=
"server"
ID
=
"RadGantt1"
Enabled
=
"true"
ReadOnly
=
"True"
AllowSorting
=
"False"
>
<
DataBindings
>
<
TasksDataBindings
IdField
=
"ID"
TitleField
=
"Title"
StartField
=
"Start"
EndField
=
"End"
PercentCompleteField
=
"PercentComplete"
OrderIdField
=
"OrderID"
SummaryField
=
"Summary"
ParentIdField
=
"ParentID"
/>
<
DependenciesDataBindings
IdField
=
"ID"
PredecessorIdField
=
"PredecessorID"
SuccessorIdField
=
"SuccessorID"
TypeField
=
"Type"
/>
</
DataBindings
>
<
CustomTaskFields
>
<
telerik:GanttCustomField
PropertyName
=
"SrNo"
ClientPropertyName
=
"SrNo"
/>
</
CustomTaskFields
>
<
Columns
>
<
telerik:GanttBoundColumn
DataField
=
"ID"
HeaderText
=
"ID"
AllowEdit
=
"false"
AllowSorting
=
"false"
Width
=
"50px"
></
telerik:GanttBoundColumn
>
<
telerik:GanttBoundColumn
DataField
=
"SrNo"
HeaderText
=
"Sr.No."
AllowEdit
=
"false"
AllowSorting
=
"false"
Width
=
"50px"
UniqueName
=
"SrNo"
></
telerik:GanttBoundColumn
>
<
telerik:GanttBoundColumn
DataField
=
"Title"
HeaderText
=
"ACTIVITY"
AllowEdit
=
"false"
AllowSorting
=
"false"
></
telerik:GanttBoundColumn
>
<
telerik:GanttBoundColumn
DataField
=
"Start"
HeaderText
=
"START"
DataFormatString
=
"dd/MM/yyyy"
AllowEdit
=
"false"
AllowSorting
=
"false"
Width
=
"80px"
></
telerik:GanttBoundColumn
>
<
telerik:GanttBoundColumn
DataField
=
"End"
HeaderText
=
"END"
DataFormatString
=
"dd/MM/yyyy"
AllowEdit
=
"false"
AllowSorting
=
"false"
Width
=
"80px"
></
telerik:GanttBoundColumn
>
<
telerik:GanttBoundColumn
DataField
=
"PercentComplete"
HeaderText
=
"% COMPLETED"
AllowEdit
=
"false"
AllowSorting
=
"false"
></
telerik:GanttBoundColumn
>
</
Columns
>
</
telerik:RadGantt
>
But it is not Displaying Data in Sr.No. Field. Below Attached is the output Image.
Please help me with what is wrong with my code.
Hi,
I am trying to implement paging on a RadGrid in a web forms application.
The problem I am having is that when the user selects a page the correct information displays, but then the text '22057|updatePanel|ctl00_MainContent_ctl00_MainContent_grdResultsPanel|'
erroneously appears above the control after which the paging no longer functions. I have attached part of a screenshot so you can see what I'm talking about.
Why is this happening?
ASPX:
<
telerik:RadGrid
ID
=
"grdResults"
runat
=
"server"
Width
=
"100%"
Height
=
"430px"
PageSize
=
"10"
ItemStyle-HorizontalAlign
=
"Left"
HeaderStyle-HorizontalAlign
=
"Left"
OnItemCommand
=
"grdResults_ItemCommand"
OnItemDataBound
=
"grdResults_ItemDataBound"
AllowPaging
=
"True"
AlternatingItemStyle-HorizontalAlign
=
"Left"
ItemStyle-BackColor
=
"#ffffff"
AlternatingItemStyle-BackColor
=
"#eeeeee"
Visible
=
"true"
AutoGenerateColumns
=
"false"
OnNeedDataSource
=
"grdResults_NeedDataSource"
>
<
MasterTableView
TableLayout
=
"Auto"
>
<
NoRecordsTemplate
>
<
div
style
=
"padding: 8px 0 5px 5px; height: 20px; width: 110%;"
>
There are currently no candidates that match the selection.
</
div
>
</
NoRecordsTemplate
>
<
Columns
>
<
telerik:GridTemplateColumn
HeaderText
=
"Candidate ID"
UniqueName
=
"CandidateID"
Visible
=
"false"
>
<
ItemTemplate
>
<%#Eval("CandidateID")%>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
HeaderText
=
"Prefix"
HeaderStyle-Width
=
"35px"
>
<
ItemTemplate
>
<%#Eval("Prefix")%>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
HeaderText
=
"Forename"
>
<
ItemTemplate
>
<%#Eval("Forename")%>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
HeaderText
=
"Surname"
>
<
ItemTemplate
>
<%#Eval("Surname")%>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
HeaderText
=
"MobilePhone"
>
<
ItemTemplate
>
<%#Eval("MobilePhone")%>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
</
Columns
>
</
MasterTableView
>
<
ClientSettings
>
<
Scrolling
AllowScroll
=
"True"
UseStaticHeaders
=
"True"
SaveScrollPosition
=
"true"
></
Scrolling
>
</
ClientSettings
>
</
telerik:RadGrid
>
Please ask if you need further information.
Hi,
Version 2017.2.503 says this is fixed: RadButton as Checkbox/Radio checked backgrounds are misplaced in Classic RenderMode.
I'm using 2017.2.621, and it appears it is broken.?
Here's the code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
></
title
>
<
style
type
=
"text/css"
>
/* Button Normal */
.btnNormal,
.rdDisabled .btnNormal
{
width: 70px;
height: 23px;
margin: 0; /*7px 5px 0 0;*/
display: block;
float:right;
background: url("static2.gif") no-repeat scroll -42px 0 #eeeeee ! important;
}
/* Button Mouseover */
.btnHovered,
.rdDisabled .btnHovered
{
background-position: -42px -25px ! important;
}
.btnNormal .rbText
{
color: #333333;
margin: 4px 0 0 ! important;
font-family: Verdana, Arial, Segoe UI, Sans-Serif ! important;
font-weight: normal ! important;
font-size: 11px ! important;
}
</
style
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
/>
<
table
class
=
"tblLookup"
cellspacing
=
"0"
cellpadding
=
"0"
>
<
tr
>
<
td
>
<
telerik:RadRadioButtonList
ID
=
"rblLookupBy"
runat
=
"server"
RenderMode
=
"Classic"
AutoPostBack
=
"false"
>
<
Items
>
<
telerik:ButtonListItem
Text
=
"Option 1"
/>
<
telerik:ButtonListItem
Text
=
"Option 2"
Selected
=
"true"
/>
<
telerik:ButtonListItem
Text
=
"Option 3"
/>
</
Items
>
</
telerik:RadRadioButtonList
>
</
td
>
</
tr
>
<
tr
>
<
td
>
<
telerik:RadButton
ID
=
"btnLookUp"
runat
=
"server"
Text
=
"Lookup"
Image-EnableImageButton
=
"true"
Image-IsBackgroundImage
=
"true"
CssClass
=
"btnNormal"
HoveredCssClass
=
"btnHovered"
AutoPostBack
=
"false"
/>
</
td
>
</
tr
>
</
table
>
</
form
>
</
body
>
</
html
>
If I add a RenderMode="Lightweight" or "Auto", etc. Then the radio button list aligns properly, but this causes the RadButton which has enabled images to not display properly. Can you confirm the fix from 2017.2.503 is actually in 2017.2.621, or what else may be wrong.
Thanks,
Dave