Hi, just got view model displayed on calendar, now trying to add EventTemplate & display some fields from view model, but got undefined error, so i'm adding Resources. i kinda understand this Resources is the data for event, but what are the exact differences between DataSource and Resources?
Since DataSource takes view model and the fields i want to show are all in view model. is there an easy way to populate EventTemplate?
Hello,
I recently started to work on an old ASP.Net project and one of the first action I was asked to perform was to update Telerik version (from Q3 2012 to the last one).
The migration went almost well, but I have a problem in some specific situations : on every RadGrid with nested DetailTables, enable both HeaderContextMenu and HeaderContextFilterMenu causes a stack overflow exception during page loading.
Here is an example :
<
telerik:RadGrid
ID
=
"RGPhase"
runat
=
"server"
OnNeedDataSource
=
"RGPhase_NeedDataSource"
OnDetailTableDataBind
=
"RGPhase_DetailTableDataBind"
GridLines
=
"None"
PageSize
=
"500"
AutoGenerateColumns
=
"false"
Culture
=
"fr-FR"
EnableHeaderContextMenu
=
"true"
EnableHeaderContextFilterMenu
=
"false"
AllowFilteringByColumn
=
"true"
AllowAutomaticInserts
=
"True"
AllowAutomaticUpdates
=
"False"
AllowAutomaticDeletes
=
"False"
AllowPaging
=
"True"
AllowSorting
=
"True"
ShowFooter
=
"True"
OnEditCommand
=
"RGPhase_EditCommand"
OnCancelCommand
=
"RGPhase_CancelCommand"
OnUpdateCommand
=
"RGPhase_UpdateCommand"
OnDeleteCommand
=
"RGPhase_DeleteCommand"
>
<
MasterTableView
DataKeyNames
=
"IdPhaseInAffaire"
IsFilterItemExpanded
=
"false"
CommandItemSettings-ShowRefreshButton
=
"false"
ShowGroupFooter
=
"true"
CommandItemDisplay
=
"Top"
CommandItemSettings-ShowAddNewRecordButton
=
"false"
>
<
NoRecordsTemplate
>
Aucune phase
</
NoRecordsTemplate
>
<
DetailTables
>
<
telerik:GridTableView
GridLines
=
"None"
PageSize
=
"500"
AutoGenerateColumns
=
"false"
EnableHeaderContextMenu
=
"false"
EnableHeaderContextFilterMenu
=
"false"
AllowFilteringByColumn
=
"true"
DataKeyNames
=
"IdPhaseInAffaire"
AllowAutomaticInserts
=
"false"
AllowAutomaticUpdates
=
"True"
AllowAutomaticDeletes
=
"false"
AllowPaging
=
"True"
AllowSorting
=
"True"
ShowFooter
=
"true"
CommandItemStyle-CssClass
=
"DontShow"
CommandItemSettings-ShowRefreshButton
=
"false"
IsFilterItemExpanded
=
"false"
ShowGroupFooter
=
"true"
CommandItemDisplay
=
"Top"
CommandItemSettings-ShowAddNewRecordButton
=
"false"
>
<
DetailTables
>
<
telerik:GridTableView
GridLines
=
"None"
PageSize
=
"500"
AutoGenerateColumns
=
"false"
EnableHeaderContextMenu
=
"false"
EnableHeaderContextFilterMenu
=
"false"
AllowFilteringByColumn
=
"true"
DataKeyNames
=
"IdPhaseInAffaire"
AllowAutomaticInserts
=
"True"
AllowAutomaticUpdates
=
"True"
AllowAutomaticDeletes
=
"True"
AllowPaging
=
"True"
AllowSorting
=
"True"
ShowFooter
=
"true"
CommandItemSettings-ShowRefreshButton
=
"false"
CommandItemStyle-CssClass
=
"DontShow"
IsFilterItemExpanded
=
"false"
ShowGroupFooter
=
"true"
CommandItemDisplay
=
"Top"
CommandItemSettings-ShowAddNewRecordButton
=
"false"
>
And the code behind associated :
protected
void
RGPhase_NeedDataSource(
object
sender, GridNeedDataSourceEventArgs e)
{
DataLoadOptions dlo =
new
DataLoadOptions();
dlo.LoadWith<PhaseInAffaire>(p => p.Phase);
RGPhase.DataSource = BLLPhase.GetAffairePhaseOnly(MyCompleteAffaire.IdAffaire, dlo);
}
protected
void
RGPhase_DetailTableDataBind(
object
sender, GridDetailTableDataBindEventArgs e)
{
var idPhaseInAffaire = (
int
)e.DetailTableView.ParentItem.GetDataKeyValue(
"IdPhaseInAffaire"
);
var pia = MyCompleteAffaire.PhaseInAffaire.Where(c => c.IdParent == idPhaseInAffaire).ToList();
e.DetailTableView.DataSource = pia;
}
When I set either "EnableHeaderContextMenu" or "EnableHeaderContextFilterMenu" to false, I have no problem loading the page.
Apparently the server is stuck in a recursive call of this method : Telerik.Web.UI.GridHeaderContextMenu.GridContextFilterTemplate.CheckForSpecialColumns(Telerik.Web.UI.GridTableView currentTableView).
Any help would be appreciated,
Thanks
I am currently using a RadGrid to display a list of events and documents. One of the columns in the grid is called "Action" with a few links in it (a link to the document, a link to a 3rd party annotation tool, etc). The user wants the ability to rename the document (using the grid's edit functionality) but wants the "Rename" link to be in the Action column instead of it's own column. How do I add a GridEditCommandColumn-like action to another column or add other columns to the GridEditCommandColumn.
<
telerik:GridTemplateColumn
HeaderText
=
"Actions"
HeaderStyle-HorizontalAlign
=
"Left"
ItemStyle-HorizontalAlign
=
"Left"
>
<
ItemTemplate
>
<
asp:HyperLink
runat
=
"server"
Target
=
"_blank"
ID
=
"ViewLink"
Text
=
"View"
NavigateUrl
=
"/ViewCaseDoc.aspx?"
/>
<
asp:LinkButton
runat
=
"server"
ID
=
"AnnotationOpenLink"
Text
=
"Annotate"
/>
<%--
I want this action here
<
telerik:GridEditCommandColumn
UniqueName
=
"EditCommandColumn"
EditText
=
"Rename"
></
telerik:GridEditCommandColumn
>
--%>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
Hi,
I am using the Maskedtextbox for user input of a mac address, I am using the following code which works fine. It displays "00-00-00-00-00-00" on initial load and only accepts characters 0-9 and A-F
<
telerik:RadMaskedTextBox
RenderMode
=
"Lightweight"
ID
=
"RadMaskedTextBox3"
runat
=
"server"
Mask="<0|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F><
0
|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F>-<
0
|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F><
0
|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F>-<
0
|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F><
0
|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F>-<
0
|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F><
0
|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F>-<
0
|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F><
0
|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F>-<
0
|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F><
0
|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F>"></
telerik:RadMaskedTextBox
>
The issue arises when I press the backspace to delete, all that happens is the cursor moves back but does not reset the character back to the initial mask value which is what I would expect to happen.
How can I achieve this.
Chris
Hi,
I am using the Maskedtextbox for user input of a mac address, I am using the following code which works fine. It displays "00-00-00-00-00-00" on initial load and only accepts characters 0-9 and A-F
<
telerik:RadMaskedTextBox
RenderMode
=
"Lightweight"
ID
=
"RadMaskedTextBox3"
runat
=
"server"
Mask="<0|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F><
0
|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F>-<
0
|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F><
0
|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F>-<
0
|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F><
0
|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F>-<
0
|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F><
0
|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F>-<
0
|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F><
0
|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F>-<
0
|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F><
0
|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F>"></
telerik:RadMaskedTextBox
>
The issue arises when I press the backspace to delete, all that happens is the cursor moves back but does not reset the character back to the initial mask value which is what I would expect to happen.
How can I achieve this.
Chris
Is there a way I could add a value with the legends labels?
Client or Server side
Hello,
I am trying to capture the order of columns headers after a user changes (re-orders) a column in the Grid. But so far I only seem to capture the original order.
I plan to store the order in the database, and when the grid is loaded re-order the columns for each user.
Here's a code snip that gets called after a user changes a column: (always gets original order)
string sVal = "";
GridColumnCollection cols = grid.MasterTableView.Columns;
GridColumn c;
string[] sOrder = new string[grid.Items[0].Cells.Count];
for (int i = 0; i < grid.Items[0].Cells.Count; i++)
{
sVal = grid.Items[0].Cells[i].ID.ToString();
c = cols.FindByUniqueNameSafe(sVal);
sOrder[i] = sVal + ":" + i.ToString();
}
How do I get the actual order of columns after they are changed by the user?
I have a grid with the following declaration. The grid is bound client-side. For some reason, I can't get the HyperlinkColumn to display its text centered. (see attached image). Any idea why?
<
telerik:RadGrid
id
=
"rgCEE"
runat
=
"server"
AutoGenerateColumns
=
"False"
Height
=
"100%"
Width
=
"100%"
AllowPaging
=
"False"
AllowSorting
=
"False"
EnableLinqExpressions
=
"false"
ShowStatusBar
=
"False"
style
=
"border:0px;"
>
<
MasterTableView
DataKeyNames
=
"EmployeeId"
ClientDataKeyNames
=
"EmployeeId"
Width
=
"100%"
TableLayout
=
"Fixed"
HierarchyLoadMode
=
"Client"
CommandItemDisplay
=
"None"
>
<
Columns
>
<
telerik:GridHyperlinkColumn
UniqueName
=
"SelectColumn"
Text
=
"Select"
DataNavigateUrlFields
=
"EmployeeId"
DataNavigateUrlFormatString
=
"javascript:SelectExistingEmployee_CO({0});"
>
<
HeaderStyle
Width
=
"100px"
HorizontalAlign
=
"Center"
/>
<
ItemStyle
HorizontalAlign
=
"Center"
/>
</
telerik:GridHyperlinkColumn
>
<
telerik:GridDateTimeColumn
HeaderText
=
"Born"
DataField
=
"BirthDate"
DataType
=
"System.DateTime"
DataFormatString
=
"{0:MM/dd/yy}"
>
<
HeaderStyle
width
=
"80px"
HorizontalAlign
=
"Left"
></
HeaderStyle
>
<
ItemStyle
HorizontalAlign
=
"Left"
VerticalAlign
=
"Middle"
></
ItemStyle
>
</
telerik:GridDateTimeColumn
>
<
telerik:GridTemplateColumn
UniqueName
=
"spacerCol"
></
telerik:GridTemplateColumn
>
</
Columns
>
<
CommandItemTemplate
>
</
CommandItemTemplate
>
</
MasterTableView
>
<
ClientSettings
AllowExpandCollapse
=
"True"
>
<
Selecting
AllowRowSelect
=
"False"
EnableDragToSelectRows
=
"False"
/>
<
Scrolling
AllowScroll
=
"True"
UseStaticHeaders
=
"True"
ScrollHeight
=
"100%"
/>
<
Resizing
AllowColumnResize
=
"False"
EnableRealTimeResize
=
"True"
ResizeGridOnColumnResize
=
"True"
/>
<
ClientEvents
OnGridCreated
=
"rgCEECreatedHandler_CO"
/>
</
ClientSettings
>
</
telerik:RadGrid
>