I am using a Scatter Line Chart to graph XY values from a data set. These XY points taken from the data set also have a date associated with them. My code pulls 2 points from the dataset and graphs them to show net XY movement over time. When a user hovers a data point on the graph to display the XY values, I would also like the tooltip to say what date (or essentially any 'Z' value) is associated with that point. This Z value is in the data set which I am graphing, but I do not know any way to clearly display the date information so the user knows the point's associated date. I tried adding a {2} to DataFormatString below, but obviously without a 3rd (DataFieldZ?) Specified, it has nothing to link to.
<telerik:RadHtmlChart runat=
"server"
ID=
"SLCPositionalMultiDevice"
Width=
"1100px"
Height=
"650px"
Visible=
"false"
>
<PlotArea>
<Series>
<telerik:ScatterLineSeries Name=
"0"
DataFieldX=
"x"
DataFieldY=
"y"
>
<TooltipsAppearance Color=
"White"
DataFormatString=
"{0}, {1}, {2}"
></TooltipsAppearance>
<LabelsAppearance Visible=
"false"
>
</LabelsAppearance>
</telerik:ScatterLineSeries>
</Series>
<XAxis>
<LabelsAppearance DataFormatString=
"{0}"
></LabelsAppearance>
<MajorGridLines Width=
"1"
></MajorGridLines>
<MinorGridLines Visible=
"false"
></MinorGridLines>
</XAxis>
<YAxis >
<LabelsAppearance DataFormatString=
"{0}mm"
></LabelsAppearance>
<MajorGridLines Width=
"1"
></MajorGridLines>
<MinorGridLines Visible=
"false"
></MinorGridLines>
</YAxis>
</PlotArea>
</telerik:RadHtmlChart>
I want to make the Spreadsheet control the same size as the browser window. So I am trying to use the RadSplitter/RadPane method to do this. However, it's not really working and there are several weird things happening.
<telerik:RadSplitter ID="splitter" runat="server" OnClientLoaded="SplitterLoaded"
BorderSize="1" PanesBorderSize="1" Width="99%">
<telerik:RadPane ID="pane" runat="server" Width="100%">
<telerik:RadSpreadsheet runat="server" ID="radSheet" Height="99%" Width="99%" />
</telerik:RadPane>
</telerik:RadSplitter>
1. As seen in the "sheet_before_event" image, the control doesn't initially fill the RadPane.
2. However, after an event is fired (click in my case) the spreadsheet will then fill the RadPane, as seen in "sheet_after_event" image.
3. Through all of this the sheet view inside the control remains small with scroll bars.
Am I trying to do something that isn't currently supported?
I am badly stuck with using DropDown for Edit/Insert in RadGrid. So far I have been successful in displaying data in dropDown inside RadGrid, but not being able to Update to database. While trying to update, I keep getting error:
Telerik.web.UI.GridException "Cannot find a cell bound to a columns name 'XXXX'
Also we cannot use sqldatasource for security purposes. I searched a lot but can't find solution. If someone could provide me with a working code it will be very helpful.
I need to set dynamic width for my tool tip. If the tool tip is too long it has to go next line.
Also i noticed in this http://demos.telerik.com/aspnet-ajax/tooltip/examples/bindtotarget/defaultcs.aspx
for single line tooltip the skin looks weird(see the attachment) , for multiple line tool tip the skin looks ok. Most of my tooltip has single line it looks not too good .Do you have any workaround?
Thanks.
Eva
Hi,
I am reffering to this demo of Wizard: http://demos.telerik.com/aspnet-ajax/wizard/overview/defaultcs.aspx
Initial disabling of all tabs but first, and then enabling next tab on "Next" button works well until your Wizard do any postback. For example try to add OnNextButtonClick handler to wizard and tabs enabling/disabling works no more.
Could you please provide an example how to achieve correct funcionality of enabling tabs on server side?
Thanks,
P.
Is there a way to set the order the times show up when you click the time icon? For example, when I set the start time to 8:00 am it shows 8am as the first option like I want but then 12:00 am to 7:00 am are not in the selection list anymore. I still need all the options I just want 8am to be the first in the list.
Thanks
Hi,
I am trying to get the Level of the Selected item this way:
Dim node As RadTreeNode
node = rdd_productgroepen.EmbeddedTree.FindNodeByValue(rdd_productgroepen.SelectedValue)
Niveau = node.Level
But the Level value seems not to be there.
How can I achieve this?
Marc
Requirements |
|
Telerik Product and Version |
2017.1.118.40 Telerik.Web.UI |
Supported Browsers and Platforms |
Internet Explorer 11 |
Components/Widgets used (JS frameworks, etc.) |
PROJECT DESCRIPTION
I am new to Telerik. I have to create a RadGrid with Insert/Update/Delete functionality using onneeddatasource. the code is working to some extent, but I need that when Edit template is opened, there should be databound dropdowns rather than textboxes. Similarly functionality for insert.
<%@ PageLanguage="C#"AutoEventWireup="true"CodeBehind="ReviewerMaintenance.aspx.cs"
Inherits="textXslt.ReviewerMaintenance"%>
<%@ RegisterAssembly="Telerik.Web.UI"Namespace="Telerik.Web.UI"TagPrefix="telerik"%>
<!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>Reviewer Maintenance</title>
</head>
<body>
<form id="form1" runat="server">
<telerik:RadAjaxManager ID="RadAjaxManager1"runat="server">
</telerik:RadAjaxManager>
<telerik:RadScriptManager ID="RadScriptManager1"runat="server">
</telerik:RadScriptManager>
<div>
<div>
<telerik:RadGrid ID="RadGrid1"runat="server"AllowFilteringByColumn="True"AllowPaging="True"
AllowSorting="True"AutoGenerateColumns="False"OnNeedDataSource="radGrid_NeedDataSource"
Width="97%"OnDeleteCommand="RadGrid1_DeleteCommand"OnInsertCommand="RadGrid1_InsertCommand"
OnUpdateCommand="RadGrid1_UpdateCommand"EnableAJAX="True"ShowGroupPanel="True"
Skin="Bootstrap">
<PagerStyleMode="NextPrevAndNumeric"></PagerStyle>
<GroupingSettingsCollapseAllTooltip="Collapse
all groups"></GroupingSettings>
<ClientSettingsAllowDragToGroup="True">
<ScrollingAllowScroll="True"UseStaticHeaders="True"/>
</ClientSettings>
<MasterTableViewAutoGenerateColumns="False"DataKeyNames="AccessID"Width="100%"
CommandItemDisplay="Top">
<Columns>
<telerik:GridButtonColumn CommandName="Delete"Text="Delete"UniqueName="Delete">
</telerik:GridButtonColumn>
<telerik:GridBoundColumn DataField="AccessID" DataType="System.Int32" FilterControlAltText="Filter AccessID column"
HeaderText="Access
ID" ReadOnly="True"SortExpression="AccessID"UniqueName="AccessID">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="FirstName"FilterControlAltText="Filter
FirstName column"
HeaderText="First
Name" ReadOnly="True" SortExpression="FirstName" UniqueName="FirstName">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="LastName"FilterControlAltText="Filter
LastName column"
HeaderText="Last
Name" ReadOnly="True" SortExpression="LastName" UniqueName="LastName">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="FormName"FilterControlAltText="Filter
FormName column"
HeaderText="Form
Name" SortExpression="FormName" UniqueName="FormName">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="ContactType"FilterControlAltText="Filter
ContactType column"
HeaderText="Contact
Type" SortExpression="ContactType" UniqueName="ContactType">
</telerik:GridBoundColumn>
<telerik:GridEditCommandColumn>
</telerik:GridEditCommandColumn>
</Columns>
<EditFormSettingsColumnNumber="2"CaptionFormatString="Edit
details for Access ID {0}"
CaptionDataField="AccessID">
<FormTableItemStyle Wrap="False"></FormTableItemStyle>
<FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle>
<FormMainTableStyle CellSpacing="0"CellPadding="3"Width="100%"/>
<FormTableStyle GridLines="Horizontal"CellSpacing="0"CellPadding="2"CssClass="module"
Height="110px"Width="50%"/>
<FormTableAlternatingItemStyleWrap="False"></FormTableAlternatingItemStyle>
<FormStyle Width="50%" BackColor="#EEF2EA"></FormStyle>
<EditColumn UpdateText="Update
record" UniqueName="EditCommandColumn1" CancelText="Cancel
edit">
</EditColumn>
<FormTableButtonRowStyle HorizontalAlign="Right"CssClass="EditFormButtonRow"></FormTableButtonRowStyle>
</EditFormSettings>
<ExpandCollapseColumnVisible="False">
<HeaderStyle Width="19px"></HeaderStyle>
</ExpandCollapseColumn>
<RowIndicatorColumnVisible="False">
<HeaderStyle Width="20px"/>
</RowIndicatorColumn>
</MasterTableView>
</telerik:RadGrid>
</div>
</div>
</form>
</body>
</html>
I am using Telerik.Web.UI version 2017.1.118.40 with Visual studio 2010.
I have an issue using GridDropDownColumn inside RadGrid. In Edit mode when data is displayed in dropdownlist, its data is reset (i.e. it is not displaying the text which was in Item template or on the form for that row). I cannot use SQLDataSource, so please do not give me sample code using that.
Here is the ASPX code :
<telerik:RadGrid ID="RadGrid1"runat="server"AutoGenerateColumns="False"GridLines="None"
AllowMultiRowEdit="True"OnItemDataBound="RadGrid1_ItemDataBound"OnNeedDataSource="RadGrid1_NeedDataSource"
OnUpdateCommand="RadGrid1_UpdateCommand">
<MasterTableViewAutoGenerateColumns="false"DataKeyNames="AccessID"Width="100%"
CommandItemDisplay="Top">
<Columns>
<telerik:GridButtonColumn CommandName="Delete"Text="Delete"UniqueName="Delete">
</telerik:GridButtonColumn>
<telerik:GridBoundColumn DataField="AccessID" DataType="System.Int32" FilterControlAltText="Filter AccessID column"
HeaderText="Access
ID" ReadOnly="True"SortExpression="AccessID" UniqueName="AccessID">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="FirstName"FilterControlAltText="Filter
FirstName column"
HeaderText="First
Name" ReadOnly="True" SortExpression="FirstName" UniqueName="FirstName">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="LastName"FilterControlAltText="Filter
LastName column"
HeaderText="Last
Name" ReadOnly="True" SortExpression="LastName" UniqueName="LastName">
</telerik:GridBoundColumn>
<telerik:GridDropDownColumnFilterControlAltText="Filter
ddlForm column" UniqueName="ddlForm"
ListTextField="FormName"ListValueField="FormID"SortExpression="FormName"
HeaderText="Form
Name"
DataField="FormID"ListDataMember="FormName"DropDownControlType="DropDownList">
</telerik:GridDropDownColumn>
<telerik:GridBoundColumn DataField="ContactType"FilterControlAltText="Filter
ContactType column"
HeaderText="Contact
Type" SortExpression="ContactType" UniqueName="ContactType">
</telerik:GridBoundColumn>
<telerik:GridEditCommandColumn>
</telerik:GridEditCommandColumn>
</Columns>
<EditFormSettingsColumnNumber="2"CaptionFormatString="Edit
details for Access ID {0}"
CaptionDataField="AccessID">
<FormTableItemStyle Wrap="False"></FormTableItemStyle>
<FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle>
<FormMainTableStyle CellSpacing="0"CellPadding="3"Width="100%"/>
<FormTableStyle GridLines="Horizontal"CellSpacing="0"CellPadding="2"CssClass="module"
Height="110px"Width="100%"/>
<FormTableAlternatingItemStyleWrap="False"></FormTableAlternatingItemStyle>
<FormStyle Width="100%"BackColor="#EEF2EA"></FormStyle>
<EditColumn UpdateText="Update
record" UniqueName="EditCommandColumn1" CancelText="Cancel
edit">
</EditColumn>
<FormTableButtonRowStyle HorizontalAlign="Right" CssClass="EditFormButtonRow"></FormTableButtonRowStyle>
</EditFormSettings>
</MasterTableView>
</telerik:RadGrid>
Here is code behind:
protected void RadGrid1_NeedDataSource(object source,
Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
SqlConnection con = newSqlConnection(DataAccess.Connection.StrConn);
SqlCommand cmd = newSqlCommand("dbo.MyStoredProc",
con);
SqlDataAdapter adapter = newSqlDataAdapter();
adapter.SelectCommand = cmd;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandTimeout = 90;
DataTable myDataTable = newDataTable();
con.Open();
try
{
adapter.Fill(myDataTable);
}
finally
{
con.Close();
}
RadGrid1.DataSource = myDataTable;
}
protected void RadGrid1_ItemDataBound(object sender,
Telerik.Web.UI.GridItemEventArgs e)
{
if (e.Item is GridEditableItem && e.Item.IsInEditMode)
{
GridEditableItem editedItem = e.Item as GridEditableItem;
GridEditManager editMan =
editedItem.EditManager;
GridDropDownListColumnEditor editor =
editMan.GetColumnEditor("ddlForm") as GridDropDownListColumnEditor;
DropDownList ddList =
editor.DropDownListControl;
ddList.DataSource = GetDataTable("SELECT
[FormID], FormName FROM dbo.[Table_FormList]"); //ds;
ddList.DataTextField = "FormName";
ddList.DataValueField = "FormID";
ddList.DataBind();
}
}
public DataTable GetDataTable(string query)
{
SqlConnection con = new SqlConnection(DataAccess.Connection.StrConn);
SqlDataAdapter adapter = new SqlDataAdapter();
adapter.SelectCommand = new SqlCommand(query, con);
DataTable myDataTable = new DataTable();
con.Open();
try
{
adapter.Fill(myDataTable);
}
finally
{
con.Close();
}
return myDataTable;
}
I am trying to retrieve value of the selected item in GridDropDownColumn on RadGrid1_UpdateCommand event. I get
Error: "Cannot find a cell bound to column name 'FormID'". I am giving all the code, but the issue is in RadGrid1_UpdateCommand when it tries to get the FormID.
<telerik:RadGrid ID="RadGrid1"runat="server"AutoGenerateColumns="False"GridLines="None"
AllowMultiRowEdit="True"OnItemDataBound="RadGrid1_ItemDataBound"OnNeedDataSource="RadGrid1_NeedDataSource"
OnUpdateCommand="RadGrid1_UpdateCommand">
<MasterTableViewAutoGenerateColumns="false"DataKeyNames="AccessID"Width="100%"
CommandItemDisplay="Top">
<Columns>
<telerik:GridButtonColumn CommandName="Delete"Text="Delete"UniqueName="Delete">
</telerik:GridButtonColumn>
<telerik:GridBoundColumn DataField="AccessID" DataType="System.Int32" FilterControlAltText="Filter AccessID column"
HeaderText="Access
ID" ReadOnly="True"SortExpression="AccessID" UniqueName="AccessID">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="FirstName"FilterControlAltText="Filter
FirstName column"
HeaderText="First
Name" ReadOnly="True" SortExpression="FirstName" UniqueName="FirstName">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="LastName"FilterControlAltText="Filter
LastName column"
HeaderText="Last
Name" ReadOnly="True" SortExpression="LastName" UniqueName="LastName">
</telerik:GridBoundColumn>
<telerik:GridDropDownColumnFilterControlAltText="Filter
ddlForm column" UniqueName="ddlForm"
ListTextField="FormName"ListValueField="FormID"SortExpression="FormName"
HeaderText="Form
Name"
DataField="FormID"ListDataMember="FormName"DropDownControlType="DropDownList">
</telerik:GridDropDownColumn>
<telerik:GridBoundColumn DataField="ContactType"FilterControlAltText="Filter
ContactType column"
HeaderText="Contact
Type" SortExpression="ContactType" UniqueName="ContactType">
</telerik:GridBoundColumn>
<telerik:GridEditCommandColumn>
</telerik:GridEditCommandColumn>
</Columns>
<EditFormSettingsColumnNumber="2"CaptionFormatString="Edit
details for Access ID {0}"
CaptionDataField="AccessID">
<FormTableItemStyle Wrap="False"></FormTableItemStyle>
<FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle>
<FormMainTableStyle CellSpacing="0"CellPadding="3"Width="100%"/>
<FormTableStyle GridLines="Horizontal"CellSpacing="0"CellPadding="2"CssClass="module"
Height="110px"Width="100%"/>
<FormTableAlternatingItemStyleWrap="False"></FormTableAlternatingItemStyle>
<FormStyle Width="100%"BackColor="#EEF2EA"></FormStyle>
<EditColumn UpdateText="Update
record" UniqueName="EditCommandColumn1" CancelText="Cancel
edit">
</EditColumn>
<FormTableButtonRowStyle HorizontalAlign="Right" CssClass="EditFormButtonRow"></FormTableButtonRowStyle>
</EditFormSettings>
</MasterTableView>
</telerik:RadGrid>
Here is code behine:
protected void RadGrid1_NeedDataSource(object source,
Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
SqlConnection con = newSqlConnection(DataAccess.Connection.StrConn);
SqlCommand cmd = newSqlCommand("dbo.MyStoredProc",
con);
SqlDataAdapter adapter = newSqlDataAdapter();
adapter.SelectCommand = cmd;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandTimeout = 90;
DataTable myDataTable = newDataTable();
con.Open();
try
{
adapter.Fill(myDataTable);
}
finally
{
con.Close();
}
RadGrid1.DataSource = myDataTable;
}
protected void RadGrid1_ItemDataBound(object sender,
Telerik.Web.UI.GridItemEventArgs e)
{
if (e.Item is GridEditableItem && e.Item.IsInEditMode)
{
GridEditableItem editedItem = e.Item as GridEditableItem;
GridEditManager editMan =
editedItem.EditManager;
GridDropDownListColumnEditor editor =
editMan.GetColumnEditor("ddlForm") as GridDropDownListColumnEditor;
DropDownList ddList =
editor.DropDownListControl;
ddList.DataSource = GetDataTable("SELECT
FormID, FormName FROM dbo.[Table_FormList]"); //ds;
ddList.DataTextField = "FormName";
ddList.DataValueField = "FormID";
ddList.DataBind();
}
}
public DataTable GetDataTable(string query)
{
SqlConnection con = new SqlConnection(DataAccess.Connection.StrConn);
SqlDataAdapter adapter = new SqlDataAdapter();
adapter.SelectCommand = new SqlCommand(query, con);
DataTable myDataTable = new DataTable();
con.Open();
try
{
adapter.Fill(myDataTable);
}
finally
{
con.Close();
}
return myDataTable;
}
protected void RadGrid1_UpdateCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
{
if (e.Item isGridEditableItem &&
e.Item.IsInEditMode)
{
GridEditableItem editedItem = e.Item as GridEditableItem;
string AccessID =
editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["AccessID"].ToString();
//error on this line
string FormID = (editedItem["FormID"].Controls[0] as DropDownList).SelectedItem.Text;
string ContactType = (editedItem["ContactType"].Controls[0] as TextBox).Text;
try
{
//do update to database
}
catch (Exception ex)
{
RadGrid1.Controls.Add(new LiteralControl("Unable to update data. Reason: " +
ex.Message));
e.Canceled = true;
}
}
}