I have a programmatically created radgrid. One Column in the grid is a GridDateTimeColumn. I have allowed filtering on this column, but I can not get it to filter to the exact date. I initially was trying to do format so I could filter on date and time, but I would settle for just the date at this point if it got it working. The column created code is:
GridDateTimeColumn bc40 =
new
GridDateTimeColumn();
dg.MasterTableView.Columns.Add(bc40);
bc40.PickerType = GridDateTimeColumnPickerType.DatePicker;
bc40.DataField =
"LaunchDate"
;
bc40.HeaderText =
"LaunchDate"
;
bc40.UniqueName =
"LaunchDate"
;
bc40.ItemStyle.HorizontalAlign = HorizontalAlign.Left;
bc40.AutoPostBackOnFilter =
true
;
bc40.DataFormatString =
"{0:MM/dd/yyyy}"
;
bc40.EnableTimeIndependentFiltering =
true
;
bc40.FilterDateFormat =
"MM/dd/yyyy"
;
bc40.DataType =
typeof
(System.DateTime);
bc40.Display =
true
;
I have try muliple variations of FormatString, FilterFormats, Disabled TimeIndepence with no such luck. I though it may be looking directly at the grid's format, so I have also added this to my ItemDataBound event:
DateTime launchDateTime = DateTime.Parse(item[
"LaunchDate"
].Text.ToString());
string
formattedDateTime = String.Format(
"{0:MM/dd/yyyy}"
, launchDateTime);
item[
"LaunchDate"
].Text = formattedDateTime;
The date on the grid shows up in the format of 01/01/2016. The format in the filter shows up as 01/01/2016. But when the filter of "Equal To" is set, I don't retrieve any records.
This filter is a requirement for my application to work properly. Any help would be greatly appreciated.
Hi,
I am using RadEditor to load a DOCX, replace a few strings with RadFlowDocumentEditor on the ImportContent event, and then export to DOCX.
I am only using the Editor to view the replaced values before exporting to DOCX and I find that layout and formating have changed during the process.
For now, using RTF instead of DOCX and setting Import StylesMode to Inline has brought the best results but some formatting issues remain (tables, numbering, etc.).
How can I make RadEditor perform the least changes?
Thanks
Hi. I would like to know how do i integrate asp:Repeater with telerik:RadPanelBar. my final outcome would be each row in the repeater is able to show and hide as the content of the repeater might cause the whole page to be very long
i receive the following error
Telerik.Web.UI.RadPanelItemCollection must have items of type 'Telerik.Web.UI.RadPanelItem'. 'ItemTemplate' is of type 'System.Web.UI.HtmlControls.HtmlGenericControl'.
my markup.
01.<
asp:UpdatePanel
ID
=
"UpdatePanel2"
runat
=
"server"
>
02. <
ContentTemplate
>
03.
04. <
asp:Repeater
ID
=
"Repeater2"
runat
=
"server"
>
05.
06. <
HeaderTemplate
>
07. <
telerik:RadPanelBar
RenderMode
=
"Lightweight"
runat
=
"server"
ID
=
"RadPanelBar1"
Width
=
"750"
Height
=
"250"
08.
Skin
=
"Telerik"
ExpandMode
=
"FullExpandedItem"
>
09. <
Items
>
10. </
HeaderTemplate
>
11. <
ItemTemplate
>
12. <
telerik:RadPanelItem
Expanded
=
"true"
CssClass
=
"top-offers"
>
13. <
ContentTemplate
>
14. <
tr
>
15. <
td
>
16. <
asp:Label
runat
=
"server"
ID
=
"lblEntry"
>Entry Type <%# Container.ItemIndex+1 %></
asp:Label
>
17. </
td
>
18. </
tr
>
19. <
tr
>
20. <
td
>Entry Qualification</
td
>
21. <
td
>
22. <
telerik:RadEditor
ID
=
"txtQualification"
runat
=
"server"
Content='<%# DataBinder.Eval(Container.DataItem, "qualification") %>' ToolsFile="/Users/benjamin/Desktop/editor/ToolsFile.xml" EditModes="Design">
23. <
DocumentManager
ViewPaths
=
"~/Documents"
UploadPaths
=
"~/Documents"
/>
24. </
telerik:RadEditor
>
25. </
td
>
26. </
tr
>
27. <
tr
>
28. <
td
>Academic Requirement</
td
>
29. <
td
>
30. <
telerik:RadEditor
ID
=
"txtRequirement"
runat
=
"server"
Content='<%# DataBinder.Eval(Container.DataItem, "requirement") %>' ToolsFile="/Users/benjamin/Desktop/editor/ToolsFile.xml" EditModes="Design">
31. <
DocumentManager
ViewPaths
=
"~/Documents"
UploadPaths
=
"~/Documents"
/>
32. </
telerik:RadEditor
>
33. </
td
>
34. </
tr
>
35. <
tr
>
36. <
td
>Relavant Working Experience</
td
>
37. <
td
>
38. <
telerik:RadEditor
ID
=
"txtExperience"
runat
=
"server"
Content='<%# DataBinder.Eval(Container.DataItem, "experience") %>' ToolsFile="/Users/benjamin/Desktop/editor/ToolsFile.xml" EditModes="Design">
39. <
DocumentManager
ViewPaths
=
"~/Documents"
UploadPaths
=
"~/Documents"
/>
40. </
telerik:RadEditor
>
41. </
td
>
42. </
tr
>
43. <
tr
>
44. <
td
>
45. <
asp:Button
ID
=
"btnRemoveCert"
runat
=
"server"
Text
=
"Remove Certificate"
46.
CommandName
=
"remove"
CommandArgument='<%# Container.ItemIndex %>' />
47. </
td
>
48. </
tr
>
49. <
tr
>
50. <
td
colspan
=
"2"
><
hr
/></
td
>
51. </
tr
>
52. </
ContentTemplate
>
53. </
telerik:RadPanelItem
>
54. </
ItemTemplate
>
55. <
FooterTemplate
>
56. <
tr
>
57. <
td
>
58. <
asp:Button
ID
=
"btnAddEntry"
runat
=
"server"
Text
=
"Add Entry"
OnClick
=
"btnAddEntry_Click"
/>
59. </
td
>
60. </
tr
>
61. </
Items
>
62. </
telerik:RadPanelBar
>
63. </
FooterTemplate
>
64. </
asp:Repeater
>
65.
66. </
ContentTemplate
>
67.</
asp:UpdatePanel
>
I've hooked up RadGrid to an EntityDataSource control. It shows data fine, but won't update. Here is how I have the data source control setup:
<ef:EntityDataSource ID="EntityDataSource1" runat="server" EntitySetName="Events" DefaultContainerName="" EnableInsert="True" EnableUpdate="True" ContextTypeName="DataAccess.SurveyContext" EnableFlattening="False" AutoPage="False" AutoSort="False" EnableViewState="True"></ef:EntityDataSource>
Any ideas why update won't work?
David McCarter
I've got a Grid which holds quite a few columns of information.The first column of each row is a button with a unique ID that, when clicked, expands the DetailTables with relevant information to the row. The button executes the following command: CommandName="expandCollapse" .
How can I make it so that whenever I click a row it would expand the DetailTables? Any help would be much appreciated.
I have some code I'm troubleshooting from our offshore team. We have a datagrid that we want to enable paging on, the problem is that the CurrentPageIndex of the RadGrid is always 0. We aren't using a DataSource property but retrieving our data via a service layer in the code-behind that calls a stored proc that uses OFFSET and FETCH to return the subset of rows based on the page index and page size.
Here's the ASPX code for the RadGrid:
<
telerik:RadGrid
ID
=
"EnrollmentPeriodCompanyElectionsGrid"
runat
=
"server"
AllowSorting
=
"true"
AutoGenerateColumns
=
"false"
PageSize
=
"20"
AllowPaging
=
"True"
AllowCustomPaging
=
"true"
OnPageIndexChanged
=
"EnrollmentPeriodCompanyElectionsGrid_PageIndexChanged"
OnPageSizeChanged
=
"EnrollmentPeriodCompanyElectionsGrid_PageSizeChanged"
OnNeedDataSource
=
"EnrollmentPeriodCompanyElectionsGrid_NeedDataSource"
OnItemDataBound
=
"EnrollmentPeriodCompanyElectionsGrid_ItemDataBound"
EnableViewState
=
"true"
>
<
MasterTableView
NoMasterRecordsText
=
"Nothing was found for this election period"
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"HrpClientID"
HeaderText
=
"ID"
SortExpression
=
"HrpClientID"
/>
<
telerik:GridHyperLinkColumn
HeaderText
=
"COMPANY"
UniqueName
=
"Company"
SortExpression
=
"CompanyName"
DataTextField
=
"CompanyName"
DataNavigateUrlFields
=
"CompanyID,BenefitEnrollmentPeriodID"
DataNavigateUrlFormatString
=
"~/Admin/Companies/Company.aspx?companyID={0}&page=Exhibits&periodID={1}"
HeaderStyle-Width
=
"300px"
/>
<
telerik:GridBoundColumn
DataField
=
"CompanyType"
HeaderText
=
"TYPE"
SortExpression
=
"CompanyType"
/>
<
telerik:GridBoundColumn
DataField
=
"HRP"
HeaderText
=
"HRP"
SortExpression
=
"HRP"
/>
<
telerik:GridBoundColumn
DataField
=
"HRC"
HeaderText
=
"HRC"
SortExpression
=
"HRC"
/>
<
telerik:GridBoundColumn
DataField
=
"EnrollmentStatus"
SortExpression
=
"EnrollmentStatus"
HeaderText
=
"STATUS"
/>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
Here's the NeedDataSource method:
protected
void
EnrollmentPeriodCompanyElectionsGrid_NeedDataSource(
object
sender, GridNeedDataSourceEventArgs e)
{
try
{
var enrollmentId = Request.QueryString[
"PeriodID"
] !=
null
?
int
.Parse(Request.QueryString[
"PeriodID"
]) : 0;
{
RadGrid enrollmentPeriodCompanyElectionsGrid = (RadGrid)sender;
int
currentPageIndex = EnrollmentPeriodCompanyElectionsGrid.CurrentPageIndex;
var dataSource = GetBenefitEnrollmentCompanies(enrollmentId, currentPageIndex, pageSize);
enrollmentPeriodCompanyElectionsGrid.DataSource = dataSource.BenefitEnrollmentCompanyDetail;
// set this only once.
if
(enrollmentPeriodCompanyElectionsGrid.VirtualItemCount == 0)
enrollmentPeriodCompanyElectionsGrid.VirtualItemCount = dataSource.TotalRecordsCount;
}
}
catch
(Exception ex)
{
ErrorHandler.HandleError<Exception>(ex,
new
{ UserID = CurrentUser.UserID, CompanyID = CurrentCompany.CompanyID, ViewingUserID = CurrentUser.UserID, PageIndex = 1, PageSize = pageSize });
}
}
and PageIndexChanged:
protected
void
EnrollmentPeriodCompanyElectionsGrid_PageIndexChanged(
object
sender, GridPageChangedEventArgs e)
{
try
{
// reset this property to new page after.
EnrollmentPeriodCompanyElectionsGrid.CurrentPageIndex = e.NewPageIndex + 1;
}
catch
(Exception ex)
{
ErrorHandler.HandleError<Exception>(ex,
new
{ UserID = CurrentUser.UserID, CompanyID = CurrentCompany.CompanyID, ViewingUserID = CurrentUser.UserID, PageIndex = e.NewPageIndex, PageSize = pageSize });
}
}
However, no matter what the CurrentPageIndex is 0. I've verified by manually changing the CurrentPageIndex in Visual Studio that, when set, paging works correctly, it just is always being set to 0. I've tried everything, but I can't get the paging to recognize that I'm selecting a new page.
I have a DDT binding server side to Id & Name, I also have checkboxes
rdtLocation.DataSource = locations;
rdtLocation.DataTextField = "Name";
rdtLocation.DataFieldID = "Id";
rdtLocation.DataValueField = "Id";
rdtLocation.DataFieldParentID = "ParentId";
rdtLocation.DataSource = locations;
rdtLocation.DataBind();
With one selected item when I look at the selectedValue I get a comma separated list containing 2 instances of the id. ie - "2,2"
See attached screen shot.
Why is this and what is the fix.
Andy
Hi there,
I need to show next and prev button above rad grid so that when my site is open on mobile view, user can navigate to rest of the columns. Every column is given fixed width. But the issue I am facing that I must have to freeze at least one column.
Current code:
<MasterTableView DataKeyNames="UserID" HeaderStyle-Width="100px" TableLayout="Auto" CommandItemDisplay="TopAndBottom" CommandItemSettings-ShowAddNewRecordButton="false" CommandItemSettings-ShowRefreshButton="false" CommandItemSettings-NextFrozenColumnText="Next Column" CommandItemSettings-PrevFrozenColumnText="Previous Column">
<ClientSettings>
<Scrolling AllowScroll="true" UseStaticHeaders="true" FrozenColumnsCount="1" EnableNextPrevFrozenColumns="true" />
</ClientSettings>
When I set FrozenColumnsCount="0", next and prev button stop working.
Kindly provide the solution so that no column would get freezed.