Hello,
I thought this would be straight-forward, and maybe it is -- I am probably missing something obvious. I have a RadGrid that has DropDownList inside a GridTemplateColumn.
<
telerik:RadGrid
ID
=
"RadGridTestsInstruments"
runat
=
"server"
DataSourceID
=
"SqlDataSourceTestsInstruments"
AutoGenerateColumns
=
"False"
AllowSorting
=
"True"
Height
=
"220px"
Width
=
"430px"
AllowMultiRowSelection
=
"false"
AllowAutomaticUpdates
=
"True"
OnItemUpdated
=
"RadGridTestsInstruments_ItemUpdated"
style
=
"margin-top: 0px"
>
<
GroupingSettings
CollapseAllTooltip
=
"Collapse all groups"
></
GroupingSettings
>
<
ClientSettings
AllowKeyboardNavigation
=
"true"
EnableRowHoverStyle
=
"true"
>
<
Selecting
AllowRowSelect
=
"true"
></
Selecting
>
<
Scrolling
AllowScroll
=
"True"
UseStaticHeaders
=
"True"
/>
</
ClientSettings
>
<
MasterTableView
DataSourceID
=
"SqlDataSourceTestsInstruments"
DataKeyNames
=
"set_test_id,test_id"
EditMode
=
"Batch"
>
<
BatchEditingSettings
EditType
=
"Cell"
/>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"set_test_id"
HeaderText
=
"set_test_id"
SortExpression
=
"set_test_id"
UniqueName
=
"set_test_id"
DataType
=
"System.Int32"
ReadOnly
=
"True"
Display
=
"False"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"test_id"
DataType
=
"System.Int32"
HeaderText
=
"test_id"
ReadOnly
=
"True"
SortExpression
=
"test_id"
UniqueName
=
"test_id"
Display
=
"False"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"grid_instrument_id"
DataType
=
"System.Int32"
HeaderText
=
"grid_instrument_id"
ReadOnly
=
"True"
SortExpression
=
"grid_instrument_id"
UniqueName
=
"grid_instrument_id"
Display
=
"False"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"test"
HeaderText
=
"Test"
SortExpression
=
"test"
UniqueName
=
"test"
ReadOnly
=
"True"
>
</
telerik:GridBoundColumn
>
<
telerik:GridTemplateColumn
HeaderText
=
"Instrument"
HeaderStyle-Width
=
"110px"
UniqueName
=
"instrument_id"
DataField
=
"instrument_id"
AllowFiltering
=
"false"
>
<
ItemTemplate
>
<%# Eval("instrument") %>
</
ItemTemplate
>
<
EditItemTemplate
>
<
telerik:RadDropDownList
RenderMode
=
"Lightweight"
runat
=
"server"
ID
=
"RadDropDownListInstruments"
DataField
=
"set_test_id"
DataValueField
=
"instrument_id"
DataTextField
=
"instrument"
AllowCustomText
=
"true"
EmptyMessage
=
"Choose Instrument"
DataSourceID
=
"SqlDataSourceInstruments"
Width
=
"100px"
>
</
telerik:RadDropDownList
>
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridBoundColumn
DataField
=
"workflow_id"
DataType
=
"System.Int32"
HeaderText
=
"workflow_id"
ReadOnly
=
"True"
UniqueName
=
"workflow_id"
Display
=
"False"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"workflow"
HeaderText
=
"Workflow"
SortExpression
=
"workflow"
UniqueName
=
"workflow"
ReadOnly
=
"True"
>
</
telerik:GridBoundColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
I need the DropDownList datasource to have a parameter from a cell value on the selected row. The DataKeyName also contains the same value that could be used as a parm.
<
asp:SqlDataSource
ID
=
"SqlDataSourceInstruments"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:MineLIMSConnection %>"
SelectCommand="SELECT distinct i.instrument_id, i.instrument, tst.set_test_id
FROM instruments i
Inner Join tests_instruments ti on ti.instrument_id = i.instrument_id
Inner Join ml_temp_dest_sets_tests tst on tst.test_id = ti.test_id
WHERE tst.set_test_id = @set_test_id">
<
SelectParameters
>
<
asp:ControlParameter
ControlID
=
"RadGridTestsInstruments"
DefaultValue
=
"999"
Name
=
"set_test_id"
PropertyName
=
"SelectedValues['set_test_id']"
Type
=
"Int32"
/>
</
SelectParameters
>
</
asp:SqlDataSource
>
When I try to use a ControlParameter from the Grid itself as shown above, I get this error:
Could not find control 'RadGridTestsInstruments' in ControlParameter 'set_test_id'.
<
asp:SqlDataSource
ID
=
"SqlDataSourceInstruments"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:MineLIMSConnection %>"
SelectCommand="SELECT distinct i.instrument_id, i.instrument, tst.set_test_id
FROM instruments i
Inner Join tests_instruments ti on ti.instrument_id = i.instrument_id
Inner Join ml_temp_dest_sets_tests tst on tst.test_id = ti.test_id
WHERE tst.set_test_id = @set_test_id">
<
SelectParameters
>
<
asp:Parameter
Name
=
"set_test_id"
Type
=
"Int32"
/>
</
SelectParameters
>
</
asp:SqlDataSource
>
If I just use a Parameter from the Grid itself as shown above, there is nothing returned.
I am thinking that I should be going this route, but I must not be setting the right field on the Grid and/or dropdown to set the parameter properly.
If I remove the parameter completely, I get data, but from all rows in the Grid, which is incorrect.
Thanks in advance,
g.
How to get the edit value from the GridBoundColumn in RadGrid.
telerik:GridBoundColumn UniqueName="Title" ReadOnly="true" DataField="TBL_Jobs_Titles.Title" HeaderText="Title" DataType="System.String" HeaderStyle-Width="40px" FilterControlWidth="40px"></telerik:GridBoundColumn>
I am getting null value and send how to implement itHi,
I'm using the RadWizard inside a custom advanced template for the RadScheduler Insert/Edit. Said RadScheduler is itself in a UserControl that is loaded from a master page on menu button click (All working from AJAX, no page ever reloaded).
Here's the chain of event to help you understand my situation :
Master page loads usercontrol containing RadScheduler.
RadScheduler loads a custom template on Insert/Edit
Custom template uses a RadWizard to guide the user through an appointment insertion
I've used test cases provided in various threads that had similar question but they do not work : User can press "Next" without validation triggering
I also tried to add this line to my web.config but since I'm using .Net 4.0 I think it should not even matter :
<add key="ValidationSettings:UnobtrusiveValidationMode" value="None" />
Here is one of the template I tried, I can press "Next" on it without entering any info on the textboxes
<
telerik:RadWizard
runat
=
"server"
ID
=
"RadWizard2"
RenderedSteps
=
"All"
>
<
WizardSteps
>
<
telerik:RadWizardStep
ID
=
"RadWizardStep3"
ValidationGroup
=
"Group1"
>
<
asp:TextBox
runat
=
"server"
ID
=
"TextBox1"
ValidationGroup
=
"Group1"
/>
<
asp:RequiredFieldValidator
ID
=
"RequiredFieldValidator2"
runat
=
"server"
ErrorMessage
=
"ADD TEXT"
ControlToValidate
=
"TextBox1"
ValidationGroup
=
"Group1"
>
</
asp:RequiredFieldValidator
>
</
telerik:RadWizardStep
>
<
telerik:RadWizardStep
ID
=
"RadWizardStep1"
ValidationGroup
=
"Group2"
>
<
asp:TextBox
runat
=
"server"
ID
=
"TextBox2"
ValidationGroup
=
"Group2"
/>
<
asp:RequiredFieldValidator
ID
=
"RequiredFieldValidator1"
runat
=
"server"
ErrorMessage
=
"ADD TEXT"
ControlToValidate
=
"TextBox2"
ValidationGroup
=
"Group2"
>
</
asp:RequiredFieldValidator
>
</
telerik:RadWizardStep
>
<
telerik:RadWizardStep
ID
=
"RadWizardStep2"
ValidationGroup
=
"Group3"
>
<
asp:TextBox
runat
=
"server"
ID
=
"TextBox3"
ValidationGroup
=
"Group3"
/>
<
asp:RequiredFieldValidator
ID
=
"RequiredFieldValidator3"
runat
=
"server"
ErrorMessage
=
"ADD TEXT"
ControlToValidate
=
"TextBox3"
ValidationGroup
=
"Group3"
>
</
asp:RequiredFieldValidator
>
</
telerik:RadWizardStep
>
</
WizardSteps
>
</
telerik:RadWizard
>
Version of Telerik is 2016.3.1027
Target Framework is .Net 4.0
Thank you in advance
<
telerik:RadButton
runat
=
"server"
ID
=
"menuBtn"
AutoPostBack
=
"false"
OnClientClicked
=
"BtnClick"
HoveredCssClass
=
"menuImageHover"
CssClass
=
"menuImage"
PressedCssClass
=
"menuImagePressed"
>
<
ContentTemplate
>
<
div
id
=
"mButton"
class
=
"mainMenuButton"
runat
=
"server"
>
<
table
border
=
"0"
>
<
tr
>
<
td
>
<
img
id
=
"icon"
alt
=
""
runat
=
"server"
/>
</
td
>
<
td
style
=
"width: 100%; text-align: center"
>
<
span
id
=
"text"
runat
=
"server"
></
span
>
</
td
>
</
tr
>
</
table
>
</
div
>
</
ContentTemplate
>
</
telerik:RadButton
>
.menuImageHover
{
background-position
:
-150px
;
}
.menuImagePressed
{
background-position
:
-300px
;
}
.menuImage
{
background
:
url
(
'../Images/menu_button.png'
)
no-repeat
;
height
:
70px
;
width
:
150px
!important
;
position
:
relative
;
display
:
block
;
}
Hi!
I'm in need of using the RadOrgChart for showing some data and the point of the Tooltip is to show details of the Item I'm hovering over.
I did a demo just to try and see how it would look with some basic data on a Table.
I used this Demo as a reference...pretty much, I just copied and pasted it and modified it to see how it would look and then I would start doing some changes on it.
My problem: I don't know if its what I'm thinking, that the OnAjaxUpdate is not getting triggered, or if I messed up somewhere else.
I've never tried this before, so I'm pretty new at this and a little help would be useful ^^
OrgChartNew.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OrgChartNew.aspx.cs" Inherits="RadOrgChart3.OrgChartNew" %>
<!DOCTYPE html>
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
></
title
>
<
link
href
=
"css/styles.css"
rel
=
"stylesheet"
/>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
runat
=
"server"
ID
=
"RadScriptManager1"
/>
<
telerik:RadSkinManager
ID
=
"RadSkinManager1"
runat
=
"server"
ShowChooser
=
"true"
/>
<
div
class
=
"demo-container size-wide no-bg"
>
<
div
class
=
"qsf-demo-canvas"
>
<
h2
>
<
span
>Test</
span
>
</
h2
>
<
telerik:RadOrgChart
RenderMode
=
"Lightweight"
ID
=
"RadOrgChart1"
runat
=
"server"
Skin
=
"Default"
DataSourceID
=
"SqlDataSource1"
EnableDrillDown
=
"true"
DataFieldID
=
"hijo"
DataFieldParentID
=
"padre"
>
<
ItemTemplate
>
<
asp:Panel
runat
=
"server"
ID
=
"Panel1"
CssClass
=
"TemplateHolder"
>
<
div
class
=
"rocCustomTextWrap"
>
<
span
>
<%# Eval("nombre")%>
</
span
>
</
div
>
</
asp:Panel
>
</
ItemTemplate
>
</
telerik:RadOrgChart
>
</
div
>
</
div
>
<
telerik:RadToolTipManager
RenderMode
=
"Lightweight"
runat
=
"server"
ID
=
"RadToolTipManager1"
Skin
=
"Default"
OnAjaxUpdate
=
"OnAjaxUpdate"
Position
=
"BottomRight"
OffsetX
=
"16"
OffsetY
=
"16"
EnableShadow
=
"false"
Width
=
"195"
Height
=
"135"
/>
<
asp:SqlDataSource
runat
=
"server"
ID
=
"SqlDataSource1"
ConnectionString="<%$ ConnectionStrings:masterConnectionString %>"
SelectCommand="SELECT [hijo], [padre], [nombre], [edad], [color] FROM [PADREHIJOTABLETEST]"></
asp:SqlDataSource
>
</
form
>
</
body
>
</
html
>
OrgChartNew.aspx.cs:
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Web;
using
System.Web.UI;
using
System.Web.UI.WebControls;
using
Telerik.Web.UI;
namespace
RadOrgChart3
{
public
partial
class
OrgChartNew : System.Web.UI.Page
{
private
bool
isDrillDown =
false
;
protected
void
Page_Load(
object
sender, EventArgs e)
{
RadOrgChart1.GroupItemDataBound +=
new
Telerik.Web.UI.OrgChartGroupItemDataBoundEventHandler(RadOrgChart1_GroupItemDataBound);
RadOrgChart1.DrillDown += RadOrgChart1_DrillDown;
}
void
RadOrgChart1_DrillDown(
object
sender, OrgChartDrillDownEventArguments e)
{
isDrillDown =
true
;
}
void
RadOrgChart1_GroupItemDataBound(
object
sender, Telerik.Web.UI.OrgChartGroupItemDataBoundEventArguments e)
{
var panel = (Panel)e.Item.FindControl(
"Panel1"
);
RadToolTipManager1.TargetControls.Add(panel.ClientID, e.Item.Node.ID,
true
);
}
protected
override
void
OnPreRenderComplete(EventArgs e)
{
base
.OnPreRenderComplete(e);
if
(isDrillDown)
{
var nodes = RadOrgChart1.GetAllNodes();
foreach
(var node
in
nodes)
{
var panel = (Panel)node.GroupItems[0].FindControl(
"Panel1"
);
RadToolTipManager1.TargetControls.Add(panel.ClientID, node.ID,
true
);
}
}
}
public
void
OnAjaxUpdate(
object
sender, ToolTipUpdateEventArgs e)
{
Control ctrl = Page.LoadControl(
"OrgChartUC.ascx"
);
ctrl.ID =
"OrgChartUC"
;
e.UpdatePanel.ContentTemplateContainer.Controls.Add(ctrl);
OrgChartUC details = (OrgChartUC)ctrl;
details.Hijo = e.Value;
}
}
}
OrgChartUC.ascx:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="OrgChartUC.ascx.cs" Inherits="RadOrgChart3.OrgChartUC" %>
<
asp:Repeater
runat
=
"server"
ID
=
"Repeater1"
>
<
ItemTemplate
>
<
div
class
=
"rtCustomTemplate"
>
<
h3
class
=
"title"
>
<
asp:Literal
runat
=
"server"
ID
=
"ltrEdad"
Text='<%# Eval("edad")%>' />
</
h3
>
<
p
class
=
"phone"
>
<
asp:Literal
runat
=
"server"
ID
=
"ltrColor"
Text='<%# Eval("color")%>' />
</
p
>
</
div
>
</
ItemTemplate
>
</
asp:Repeater
>
<
asp:SqlDataSource
ID
=
"EmployeesDataSource"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:masterConnectionString %>"
ProviderName="System.Data.SqlClient" SelectCommand="SELECT [edad], [color] FROM [PADREHIJOTABLETEST] WHERE hijo = @hijo">
<
SelectParameters
>
<
asp:Parameter
Name
=
"hijo"
Type
=
"Int32"
/>
</
SelectParameters
>
</
asp:SqlDataSource
>
OrgChart.ascx.cs:
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Web;
using
System.Web.UI;
using
System.Web.UI.WebControls;
namespace
RadOrgChart3
{
public
partial
class
OrgChartUC : System.Web.UI.UserControl
{
public
string
Hijo {
get
;
set
; }
protected
void
Page_Load(
object
sender, EventArgs e)
{
EmployeesDataSource.SelectParameters[
"hijo"
].DefaultValue = Hijo;
Repeater1.DataSource = EmployeesDataSource;
Repeater1.DataBind();
}
}
}
Thanks for your help ^^!!!
I have a DropDownTree displaying within a popup window whose contents can be lengthy and scroll. If the DropDownTree element is near the bottom of the window (due to the scroll position) and the user activates the tree, it is possible for only a tiny bit to show (sometimes even just the "Filter" area). The control is seems to properly restricting size to keep it within the screen bounds.
Is there any way to have it pop "up" when it would be too small to fit going down (this would be similar to how the RadComboBox would work)?
Thanks for any input or suggestions!
Adam
When I move tasks around it ends up with an error. Especially when I move a task to an earlier point in time.
The problem is: Telerik (let's call it like that) updates automaticly, but a NULL-value is assigned to a random record in the Expanded column.
And the Gantt doesn't allow this value because its a bit so. 1 or 0
Help please.
Here's the situation:
I am testing a form using Telerik Test Studio.
There are 3 drop downs (State, City, Building) and what you choose on the previous box decides what is in the next box. Before you choose what is in the drop down box number one, two and three are empty (no choices). When you choose a State, it gives you options for cities, then once you choose a city, the building drop down gets populated with options.
The problem is, when I am testing this with the drop downs, it chooses the state correctly, but it, for some reason, doesn't register that there is a state chosen, so the city drop down does not get populated. I slowed the process down while the test is running to try and see if it was something simple, but I saw myself that it DOES choose a state, so I tried to manually choose the city but there was nothing to populate the drop down options. But, if I choose the state myself, then the cities populate.
Thank you for your help.
M
Hi, I have created a custom SharePoint 2010 web part using a scheduler with some custom attributes. Everything is working fine except for validation of the custom attributes on the advanced edit/insert form. There are two text boxes which should not be empty and save should not allow the advanced form to be saved back to the SP list.
I have the following code in the FormCreated event:
RadScheduler scheduler = (RadScheduler)sender;
CustomValidator validatorForAttributePhone =
new
CustomValidator();
validatorForAttributePhone.ValidationGroup = scheduler.ValidationGroup;
validatorForAttributePhone.ControlToValidate =
"AttrPhone"
;
validatorForAttributePhone.ErrorMessage =
"Cannot be blank!"
;
validatorForAttributePhone.ClientValidationFunction =
"validationFunctionPhone"
;
(e.Container.FindControl(
"AttrPhone"
)
as
RadTextBox).Parent.Controls.Add(validatorForAttributePhone);
And the jsavascript function is
function
validationFunctionPhone(source, arguments)
{
i
f
(arguments.Value.length != 0)
{
arguments.IsValid =
true
; }
else
{arguments.IsValid =
false
;
}}
All the validation seems to be created OK but this never fires when the 'Save' button is clicked on the advanced edit/insert form which means that the appointment can be saved when there is no text in the phone field on the form.
What am I missing?
Thanks,
Jonathan
I tried to have Inline editing for radgrid, but when we edit Textboxes are not showing.I need datasource from codebehind. Any sample code is needed.
<telerik:RadGrid ID="RGDCountry" runat="server" ShowStatusBar="true" EnableLinqExpressions="false" RenderMode="Lightweight" AllowPaging="false" AutoGenerateColumns="false" AllowFilteringByColumn="true" MasterTableView-AllowSorting="true"
AllowAutomaticDeletes="false" AllowAutomaticInserts="True"
CellPadding="1" OnNeedDataSource="RGDCountry_NeedDataSource"
PageSize="20" >
<GroupingSettings CaseSensitive="false" />
<ExportSettings Excel-Format="ExcelML"
HideStructureColumns="true"
ExportOnlyData="true"
IgnorePaging="true"
OpenInNewWindow="true">
</ExportSettings>
<MasterTableView ItemStyle-HorizontalAlign="Left" AllowFilteringByColumn="true" HeaderStyle-HorizontalAlign="Left" DataKeyNames="Id" CommandItemDisplay="Top" EditMode="InPlace" >
<CommandItemSettings ShowExportToExcelButton="false" ShowAddNewRecordButton="false" ShowRefreshButton="false" />
<Columns>
<telerik:GridTemplateColumn HeaderText="Sl.No" UniqueName="SlNo" HeaderStyle-Width="20px" FilterControlWidth="20px">
<ItemTemplate>
<asp:Label ID="lblRowNumber" Text='<%#Container.ItemIndex+1%>' runat="server" />
</ItemTemplate>
</telerik:GridTemplateColumn>
<%--<telerik:GridBoundColumn UniqueName="Id" DataField="Id" HeaderText="Id" ReadOnly="true" DataType="System.Int64" HeaderStyle-Width="20px" FilterControlWidth="20px" HeaderTooltip="Auto Generate Id From System"></telerik:GridBoundColumn>--%>
<telerik:GridTemplateColumn UniqueName="CountryName" DataField="CountryName" ReadOnly="true" HeaderText="Country Name" DataType="System.String" HeaderStyle-Width="50px" FilterControlWidth="50px">
<ItemTemplate>
<asp:Label ID="lblCountry" runat="server" CssClass="control-label" Text='<%#Eval("CountryName") %>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadTextBox ID="TBEditCountry" CssClass="form-control" MaxLength="200" Text='<%#Eval("CountryName") %>' runat="server"></telerik:RadTextBox>
</EditItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn UniqueName="Nationality" DataField="Nationality" ReadOnly="true" HeaderText="Nationality" DataType="System.String" HeaderStyle-Width="50px" FilterControlWidth="50px">
<ItemTemplate>
<asp:Label ID="lblNationality" runat="server" CssClass="control-label" Text='<%#Eval("Nationality") %>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadTextBox ID="TBEditNationality" CssClass="form-control" MaxLength="200" Text='<%#Eval("Nationality") %>' runat="server"></telerik:RadTextBox>
</EditItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn UniqueName="Abbrv" DataField="Abbrv" ReadOnly="true" HeaderText="Abbrv" DataType="System.String" HeaderStyle-Width="30px" FilterControlWidth="30px">
<ItemTemplate>
<asp:Label ID="lblAbbrv" runat="server" CssClass="control-label" Text='<%#Eval("Abbrv") %>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadTextBox ID="TBEditAbbrv" CssClass="form-control" MaxLength="50" Text='<%#Eval("Abbrv") %>' runat="server"></telerik:RadTextBox>
</EditItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn UniqueName="Status" ReadOnly="true" HeaderText="Status" DataType="System.String" HeaderStyle-Width="40px" FilterControlWidth="40px">
<ItemTemplate>
<asp:Label ID="lblStatus" runat="server" CssClass="control-label" Text='<%#Eval("Active") %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridEditCommandColumn UniqueName="EditCommandColumn" EditText="Edit" />
</Columns>
</MasterTableView>
</telerik:RadGrid>