Hi, I got confused with all the threads I've read and I wasn't able to find an answer to my problem.
I have a RadGrid bound to RadClientDataSource. I'm using ClientItemTemplate to format my data in a single cell and my column does not have a header.
So each data item occupies a single cell per row.
I want to know how I can group/ungroup the grid using a checkbox.
I was able to group by declaring the grouping in the grid but I want to achieve this using the checkbox.
One of the data field in the cell is a date, I want to sort my grid based on this field in a descending order.
How can I do it?
ps. type is string representing the name of the typeid.
<
telerik:RadClientDataSource
ID
=
"AlarmClientDataSource"
runat
=
"server"
AutoSync
=
"True"
>
<
ClientEvents
OnDataParse
=
"AlarmClientDataSource_OnDataParse"
OnChange
=
"AlarmClientDataSource_OnChange"
/>
<
SortExpressions
>
<
telerik:ClientDataSourceSortExpression
FieldName
=
"Created"
SortOrder
=
"Desc"
/>
</
SortExpressions
>
<
Schema
DataName
=
"Result"
ResponseType
=
"JSON"
ErrorsName
=
"ErrorMessage"
>
<
Model
ID
=
"ID"
>
<
telerik:ClientDataSourceModelField
FieldName
=
"ID"
DataType
=
"String"
Nullable
=
"true"
Editable
=
"False"
/>
<
telerik:ClientDataSourceModelField
FieldName
=
"TypeID"
DataType
=
"String"
Nullable
=
"false"
Editable
=
"False"
/>
<
telerik:ClientDataSourceModelField
FieldName
=
"Created"
DataType
=
"Date"
/>
</
Model
>
</
Schema
>
</
telerik:RadClientDataSource
>
<
telerik:RadCheckBox
ID
=
"AlarmGroupCheckBox"
runat
=
"server"
Text
=
"Group Alarms By Type"
Width
=
"100%"
RenderMode
=
"Classic"
AutoPostBack
=
"False"
OnClientCheckedChanged
=
"AlarmGroupCheckBox_OnClientCheckedChanged"
>
</
telerik:RadCheckBox
>
<
telerik:RadGrid
ID
=
"AlarmGrid"
runat
=
"server"
ClientDataSourceID
=
"AlarmClientDataSource"
Width
=
"100%"
AutoGenerateColumns
=
"False"
RenderMode
=
"Lightweight"
Skin
=
"Material"
CssClass
=
"noWrapRadGrid"
>
<
ClientSettings
AllowGroupExpandCollapse
=
"true"
>
<
Selecting
CellSelectionMode
=
"SingleCell"
></
Selecting
>
<
ClientEvents
OnCellSelected
=
"AlarmGrid_CellSelected"
OnCellSelecting
=
"AlarmGrid_CellSelecting"
OnGridCreated
=
"gridCreated"
></
ClientEvents
>
</
ClientSettings
>
<
SortingSettings
SortedBackColor
=
"#FFF6D6"
EnableSkinSortStyles
=
"false"
></
SortingSettings
>
<
MasterTableView
ShowHeader
=
"False"
AllowNaturalSort
=
"True"
>
<%--<
SortExpressions
>
<
telerik:GridSortExpression
FieldName
=
"Created"
SortOrder
=
"Descending"
/>
</
SortExpressions
>--%>
<
GroupByExpressions
>
<
telerik:GridGroupByExpression
>
<
SelectFields
>
<
telerik:GridGroupByField
FieldAlias
=
"Type"
FieldName
=
"type"
></
telerik:GridGroupByField
>
</
SelectFields
>
<
GroupByFields
>
<
telerik:GridGroupByField
FieldName
=
"type"
/>
</
GroupByFields
>
</
telerik:GridGroupByExpression
>
</
GroupByExpressions
>
<
Columns
>
<
telerik:GridTemplateColumn
UniqueName
=
"Alarms"
>
<
ClientItemTemplate
>
<
table
>
<
tr
>
<
td
>
<
div
class
=
"alarm"
>
<
div
class
=
"alarm-wrapper"
>
<
div
style
=
"color:red; font-weight:bold"
>Alarm: #: ID #</
div
>
<
dl
class
=
"alarm-list-details"
>
<
dt
class
=
"name"
>#= fecha.format(Created, 'YYYY-MM-DD hh:mm:ss A') #</
dt
>
</
dl
>
</
div
>
</
div
>
</
td
>
</
tr
>
</
table
>
</
ClientItemTemplate
>
</
telerik:GridTemplateColumn
>
</
Columns
>
</
MasterTableView
>
<
GroupingSettings
ShowUnGroupButton
=
"true"
/>
</
telerik:RadGrid
>
</
ItemTemplate
>
</
telerik:RadPanelItem
>
Good day Telerik Community,
I'm starting at Telerik and I need help with Custom Skins and web resources for showing Icons.
I have made my custom Skin that is the same as the Old Forest Skin One, it's all good with my DLL until I see Icons ("Edit","Delete","Ok","Cancel", etc.). This Icons are not showing (Html broken Image shown and Alt shown), I want to know how to call the Image from the DLL web resource and not through the File itself (for example: ~/Image/Edit.gif, is what I'm doing now but I want to call it from the Web Resource to keep independance of the Skin).
I hope I'm clear with my trouble I am having,
I hope you can help me Solve it :)...
Thanks for Reading,
Hi all,
So im having a problem with de radcombobox, i have a combobox getting values from the database, no problem there, the problem starts when i selecta a option, and then is i select the combobox, and no value is selected, and i press autside de combobox to get out of the selection the box loses the value previously selected.
Does anybody ave any ideas?
<
telerik:RadNumericTextBox
Width
=
"100px"
ID
=
"txtTest"
EmptyMessage
=
"Test"
ShowSpinButtons
=
"false"
DisplayText
=
""
Type
=
"Number"
runat
=
"server"
InvalidStyleDuration
=
"100"
>
<
NumberFormat
AllowRounding
=
"false"
GroupSeparator
=
""
DecimalDigits
=
"15"
KeepNotRoundedValue
=
"true"
/>
<
ClientEvents
OnKeyPress
=
"keyPress"
OnValueChanged
=
"valueChanged"
/>
</
telerik:RadNumericTextBox
>
Telerik.Web.UI.RadNumericTextBox.prototype._compileRegEx = function () {
var regexDecimalSeparator = this.get_numberFormat().DecimalSeparator == "." ? "\\." : this.get_numberFormat().DecimalSeparator;
this._acceptRegExp = new RegExp("[e0-9" + regexDecimalSeparator + this.get_numberFormat().NegativeSign + "]{1}");
this._rejectRegExp = new RegExp("[^e0-9" + regexDecimalSeparator + this.get_numberFormat().NegativeSign + "]{1}", "g");
this._decimalReplaceRegExp = new RegExp(regexDecimalSeparator, "g");
};
var orgNegativeSign = "";
function keyPress(sender, args) {
if (args.get_keyCode() == 45) {
orgNegativeSign = sender.get_numberFormat().NegativeSign;
sender.get_numberFormat().NegativeSign = "~";
}
}
function valueChanged(sender, args) {
if (orgNegativeSign != "") {
sender.get_numberFormat().NegativeSign = orgNegativeSign;
orgNegativeSign = "";
}
}
01.
protected void RadGridMain_OnItemCommand(object sender, GridCommandEventArgs e)
02.
{
03.
if (e.CommandName == RadGrid.InitInsertCommandName)
04.
{
05.
RadGridMain.MasterTableView.EditFormSettings.UserControlName = "~/Insert.ascx"
06.
07.
// Set up the control
08.
Control control = Page.LoadControl("~/Insert.ascx");
09.
RadGrid radGridInsert = control.FindControl("radGridInsert") as RadGrid;
10.
11.
radGridInsert.NeedDataSource += RadGridInsertSelector_OnNeedDataSource;
12.
13.
// give the child a handle to the parent
14.
PSC.Controls.UdcsConnectionInsert.ParentRadGrid = RadGridMain;
15.
}
16.
else if (e.CommandName == RadGrid.EditCommandName)
17.
{
18.
RadGridMain.MasterTableView.EditFormSettings.UserControlName = "~/Edit.ascx";
19.
}
20.
}
ParentRadGrid.MasterTableView.IsItemInserted = false;
GridEditFormItem editFormItem = e.Item as GridEditFormItem;
GridDataItem parentItem = editFormItem.ParentItem;
parentItem.EditFormItem.Edit = false;
Hi,
I'm working on fixing web accessibility errors. I have a RadGrid (see attachment) with more than 10 columns. When I want to edit a particular row in the grid, all my editable fields have accessibility errors (no labels, titles, or aria-labels for displayed textboxes/dropdown lists). I'm trying to figure out what properties of radgrid or it's components I can use so that each field on my page will be web accessible in edit mode. I know that I can use code behind to set a tooltip of a particular item on my page (see below) to some value; however, it's not a good solution since I have more than 10 columns in my grid. Let me know if there is a better way to solve the web accessibility problems for editable items on my page.
If TypeOf (e.Item) Is GridEditableItem AndAlso e.Item.IsInEditMode Then
Dim item As GridEditableItem = DirectCast(e.Item, GridEditableItem)
Dim txtBox As TextBox = DirectCast(item("CllctnID").Controls(0), TextBox)
txtBox.ToolTip = "hello"
End If
Thank you,
Lyubov
Good afternoon everyone,
I'm working on a conversion to an async/client-side UI. I know that RadGrid's are rather touchy about master/detail/hierarchical grid types being bound client side, and in addition I need Export functionality on some grids. This is leading to some of the grids being bound the "old" way, via ItemDataBound, NeedDataSource, etc.
What I'm wondering is if the situation is supported in making an ItemDataBound function asynchronous.
For example, I have a grid that displays a set of schedules, and a detail grid that displays a set of backups set to fire on said schedule. There is some parsing that needs to happen in the code-behind ItemDataBound method (setting Image URLs, Tooltips, parsing Recurrence Rules, etc). Is it possible to make those methods asynchronous?
Thanks in advance!
Example:
protected
async Task rgrdSchedules_ItemDataBound(
object
sender, GridItemEventArgs e)
{
if
(e.Item
is
GridDataItem)
{
var myItem = (GridDataItem)e.Item;
var taskScheduleGet = await IceApi.ExecuteGet<Schedule>(
"url/to/resource/" + myItem.GetDataKeyValue("ScheduleId").ToString()
);
// Do Independent Work (Image URLs, ToolTips, etc) //
Schedule mySchedule = await taskScheduleGet;
// Do bindings to mySchedule
}
}