I'm using the dataform integration with radGrid sample introduced in the demo.
Is it possible to keep insert mode on the page after submit a new record? the user wants to be able to submit multiple records instead of insert one when first come to the page ( I set dataform.isItemInserted == true on PreRender) and then go back to select one in radgrid to get the insert button.
I'm creating a dashboard and have a couple of DIVs defined... chart1, chart2. I would like to fill them with RadCharts.
My problem is that when I draw the chart to the page - I only get one of them... the second on overwrites the first one.
Can you not have more than one radhtmlchart on a page???
I'm using a datatable from an oracle database to create the data... here is how the code is defined:
on ASP page:
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
<div runat="server" id="Chart1">
Chart 1
</div>
<div runat="server" id="Chart2">
Chart 2
</div>
</asp:Content>
In Code Behind:
DataTable lPerson = app.GetPersonDashboard();
RadHtmlChart columnChart = new RadHtmlChart();
columnChart.ID = "ColumnChart";
columnChart.ChartTitle.Text = "EED Person Table Yesterday to Today (6 am)";
columnChart.Width = Unit.Pixel(350);
columnChart.Height = Unit.Pixel(300);
columnChart.Legend.Appearance.Position = Telerik.Web.UI.HtmlChart.ChartLegendPosition.Bottom;
//columnChart.PlotArea.XAxis.TitleAppearance.Text = "Record Type";
//columnChart.PlotArea.YAxis.TitleAppearance.Text = "Records Processed";
ColumnSeries ProcessedRecords = new ColumnSeries();
ProcessedRecords.Name = "Processed Records";
ProcessedRecords.LabelsAppearance.Visible = false;
ProcessedRecords.TooltipsAppearance.Color = System.Drawing.Color.White;
ProcessedRecords.TooltipsAppearance.DataFormatString = "{0} Records";
ColumnSeries ErrorRecords = new ColumnSeries();
ErrorRecords.Name = "Error Records";
ErrorRecords.Appearance.FillStyle.BackgroundColor = Color.Violet;
ErrorRecords.LabelsAppearance.Visible = false;
ErrorRecords.TooltipsAppearance.Color = System.Drawing.Color.White;
ErrorRecords.TooltipsAppearance.DataFormatString = "{0} Records";
foreach (DataRow row in lPerson.Rows)
{
decimal RecCount = (decimal)row["record_count"];
if (row["table_name"].ToString() == "ProcessCount")
{
CategorySeriesItem ProcCount = new CategorySeriesItem(RecCount);
ProcessedRecords.SeriesItems.Add(ProcCount);
}
if (row["table_name"].ToString() == "ErrorCount")
{
CategorySeriesItem ErrCount = new CategorySeriesItem(RecCount);
ErrorRecords.SeriesItems.Add(ErrCount);
}
}
columnChart.PlotArea.Series.Add(ProcessedRecords);
columnChart.PlotArea.Series.Add(ErrorRecords);
Chart1.Controls.Add(columnChart);
// This is the second chart on the page
DataTable lEED = app.GetEEDBulkDashboard();
RadHtmlChart EEDChart = new RadHtmlChart();
EEDChart.ID = "ColumnChart";
EEDChart.ChartTitle.Text = "Bulk Email Table Errors";
EEDChart.Width = Unit.Pixel(350);
EEDChart.Height = Unit.Pixel(300);
EEDChart.Legend.Appearance.Position = Telerik.Web.UI.HtmlChart.ChartLegendPosition.Bottom;
foreach (DataRow row in lEED.Rows)
{
ColumnSeries EEDCol = new ColumnSeries();
EEDCol.Name = row["groupname"].ToString();
EEDCol.LabelsAppearance.Visible = false;
EEDCol.TooltipsAppearance.Color = System.Drawing.Color.White;
EEDCol.TooltipsAppearance.DataFormatString = "{0} Records";
decimal RecCount = (decimal)row["record_count"];
CategorySeriesItem RecCountCol = new CategorySeriesItem(RecCount);
EEDCol.SeriesItems.Add(RecCountCol);
EEDChart.PlotArea.Series.Add(EEDCol);
}
Chart2.Controls.Add(EEDChart);
}
Please help!
Thanks,
Cory
I am attempting to create a custom Edit Item Template using this Telerik demo as a guide:
So far I have created my web form ASCX page and the code behind for that page. I getting the new custom form to display when I click the edit button. However when the form opens I do not see the data from the record I want to edit, all I see is an empty form, plus the update and cancel buttons are not showing. I have attached a screen shot titled EmptyForm.png. showing what I have so far.
Below is the C# code for the ASCX web form:
01.
private
object
_dataItem =
null
;
02.
03.
protected
void
Page_Load(
object
sender, EventArgs e)
04.
{
05.
//Popuate the Gender Dropdown List
06.
if
(!Page.IsPostBack)
//this is required to prevent the slected value of the drop downs being reverted during the data save
07.
{
08.
09.
using
(CADWEntities DDLGender =
new
CADWEntities())
10.
{
11.
var GenderDropDownQuery = from Link
in
DDLGender.GenderViewEFs
12.
select
new
{ Link.GenderDescription, Link.GenderCode };
13.
DropDownListGender.DataValueField =
"GenderCode"
;
14.
DropDownListGender.DataTextField =
"GenderDescription"
;
15.
DropDownListGender.DataSource = GenderDropDownQuery.ToList();
16.
DropDownListGender.DataBind();
17.
}
18.
19.
//Popuate the Race Dropdown List
20.
using
(CADWEntities DDLRace =
new
CADWEntities())
21.
{
22.
var RaceDropDownQuery = from Link
in
DDLRace.RaceViewEFs
23.
select
new
{ Link.RaceDescription, Link.RaceCode };
24.
DropDownListRace.DataValueField =
"RaceCode"
;
25.
DropDownListRace.DataTextField =
"RaceDescription"
;
26.
DropDownListRace.DataSource = RaceDropDownQuery.ToList();
27.
DropDownListRace.DataBind();
28.
}
29.
}
30.
}
31.
32.
public
object
DataItem
33.
{
34.
get
35.
{
36.
return
this
._dataItem;
37.
}
38.
set
39.
{
40.
this
._dataItem = value;
41.
}
42.
43.
}
I am stuck on how to show the data for the selected record. In the demo the code for the ASCX page just shows // Put user code to initialize the page here. Can someone help with an explanation of the code I need to show the selected record to edit, and how I can get the cancel and Update buttons to show when the edit form opens. Or perhaps another example that shows the code needed to display the selected record.
Thanks
Perry
There is a discrepancy on the top position of text between IE and Chrome for buttons rendered with the material skin. This has changed from Q1 where they both worked.
Issue can be seen on this page and in the attached image. Left part of the button is IE and right is Chrome. IE seems to have an extra 2 px above the text.
http://demos.telerik.com/aspnet-ajax/button/examples/overview/defaultcs.aspx?skin=Material
Please supply me with a temporary css fix - I couldn't see where the 2px is coming from....
Regards
Jon
I have a RadGrid that when a row is expanded loads up another user control with a RadGride inside, like so:
<
telerik:RadGrid
OnItemCommand
=
"RadGridList_ItemCommand"
ID
=
"RadGridList"
Width
=
"100%"
runat
=
"server"
AllowPaging
=
"True"
AllowSorting
=
"True"
O
nSortCommand
=
"RadGridList_SortCommand"
OnNeedDataSource
=
"RadGridList_NeedDataSource"
AutoGenerateHierarchy
=
"True"
GroupPanelPosition
=
"Top"
ShowFooter
=
"False"
PageSize
=
"10"
CellSpacing
=
"0"
>
<
MasterTableView
AutoGenerateColumns
=
"False"
AllowMultiColumnSorting
=
"True"
GroupLoadMode
=
"Server"
EditMode
=
"Batch"
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"CompanyID"
HeaderText
=
"Company ID"
UniqueName
=
"CompanyID"
Display
=
"false"
></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"1"
HeaderText
=
"Jan"
UniqueName
=
"Jan"
></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"2"
HeaderText
=
"Feb"
UniqueName
=
"Feb">
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"3"
HeaderText
=
"Mar"
UniqueName
=
"Mar"
></
telerik:GridBoundColumn
>
</
Columns
>
<
NestedViewTemplate
>
<
uc:Forecast
runat
=
"server"
ID
=
"Forecast"
Visible
=
"false"
/>
</
NestedViewTemplate
>
</
MasterTableView
>
</
telerik:RadGrid
>
The nested user control is data bound when the 'ExpandCollapse' item command is fired. When I set EditMode="Batch" in the top level RadGrid it works fine, but I cannot get it to work in the nested RadGrid. The 'Add', 'Save', 'Cancel' and 'Refresh' buttons all appear and fire events, but the cells in the grid don't become editable on click.
Here is the code for the Forecast user control RadGrid:
<
telerik:RadGrid
ID
=
"RadGridForecast"
runat
=
"server"
OnNeedDataSource
=
"RadGridForecast_NeedDataSource"
AllowSorting
=
"True"
CssClass
=
"radGridForecast"
ShowFooter
=
"True"
GridLines
=
"None"
CellSpacing
=
"0"
AllowAutomaticUpdates
=
"True"
AllowAutomaticInserts
=
"True"
AllowAutomaticDeletes
=
"True"
OnItemUpdated
=
"RadGridForecast_ItemUpdated"
OnSortCommand
=
"RadGridForecast_SortCommand"
OnBatchEditCommand
=
"RadGridForecast_BatchEditCommand"
>
<
MasterTableView
CommandItemDisplay
=
"Bottom"
AutoGenerateColumns
=
"False"
GroupLoadMode
=
"Server"
EditMode
=
"Batch"
>
<
BatchEditingSettings
OpenEditingEvent
=
"Click"
EditType
=
"Cell"
/>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"Type"
HeaderText
=
""
UniqueName
=
"ForecastType"
FooterText
=
"Total Sales"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"1"
HeaderText
=
"Jan"
UniqueName
=
"Jan"
Aggregate
=
"Sum"
FooterText
=
" "
>
<
ColumnValidationSettings
>
<
ModelErrorMessage
Text
=
""
/>
</
ColumnValidationSettings
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"2"
HeaderText
=
"Feb"
UniqueName
=
"Feb"
Aggregate
=
"Sum"
FooterText
=
" "
>
<
ColumnValidationSettings
>
<
ModelErrorMessage
Text
=
""
/>
</
ColumnValidationSettings
>
</
telerik:GridBoundColumn
>
</
Columns
>
</
MasterTableView
>
<
ClientSettings
AllowKeyboardNavigation
=
"true"
></
ClientSettings
>
</
telerik:RadGrid
>
Hi!
I have 4-level hierarchical <asp:dropdownlist > items within <telerik:RadListView>, when I change the first level dropdownlist, the function SelectedIndexChanged was triggered, when the dataset returns nothing, I want to add an empty listitem to the dropdown, but, after the function has gone through completed, the listitem of 2nd tier still remain the same before selectedindexchanged, what has I missed? I have attached partial code below.
Thanks in advanced.
SH
-- xxx.aspx
<telerik:RadListView ID="RadLVFbData" DataKeyNames="FormId" runat="server" RenderMode="Lightweight"
ItemPlaceholderID="CSDetailContainer" OnNeedDataSource="RadLVFbData_NeedDataSource" OnItemCommand="RadLVFbData_ItemCommand"
OnItemDataBound="RadLVFbData_ItemDataBound" OnItemCreated="RadLVFbData_ItemCreated"
Skin="Silk">
...
<table style="width:100%;border-collapse:separate" border="0">
<tr>
<td style="width: 25%">Type Category:</td>
<td style="width: 20%"><asp:DropDownList ID="ddlFBTypeL1" Width="100px" runat="server" OnSelectedIndexChanged="ddlFBTypeL1_SelectedIndexChanged" AutoPostBack="true"></asp:DropDownList></td>
<td style="width: 20%"><asp:DropDownList ID="ddlFBTypeL2" Width="120px" runat="server" OnSelectedIndexChanged="ddlFBTypeL2_SelectedIndexChanged" AutoPostBack="true"></asp:DropDownList></td>
<td style="width: 20%"><asp:DropDownList ID="ddlFBTypeL3" Width="120px" runat="server" OnSelectedIndexChanged="ddlFBTypeL3_SelectedIndexChanged" AutoPostBack="true"></asp:DropDownList></td>
<td><asp:DropDownList ID="ddlFBTypeL4" Width="120px" runat="server" OnSelectedIndexChanged="ddlFBTypeL4_SelectedIndexChanged" AutoPostBack="true"></asp:DropDownList></td>
</tr>
</table>
</telerik:RadListView>
---------------------------------------------------------------------------------------------------------------------------
-- xxx.aspx.cs
protected void ddlFBTypeL1_SelectedIndexChanged(object sender, EventArgs e)
{
try
{
DataSet dsChild = new DataSet();
DataSet ds = new DataSet();
DropDownList elemDDLFBTypeL1 = sender as DropDownList;
//get next layer UI element for ddlFBTypeL1
DropDownList elemDDLFBTypeL2 = elemDDLFBTypeL1.NamingContainer.FindControl("ddlFBTypeL2") as DropDownList;
string strFBTypeL1ID = "00001"; //first layer ID
string strFBTypeL1Val = elemDDLFBTypeL1.SelectedValue;
string strFBTypeL2ID = "";
//get data for 2nd layer
dsChild = objChoiceRelLogic.getChoiceRelByParentIdVal(strFBTypeL1ID, strFBTypeL1Val);
if (dsChild != null && dsChild.Tables[0].Rows.Count > 0)
{
....
}
else
{
elemDDLFBTypeL2.DataSource = null;
elemDDLFBTypeL2.DataBind();
elemDDLFBTypeL2.Items.Insert(0, new ListItem("--------", ""));
}
}
catch(Exception ex)
{
LogUtils.ErrorFormat("In ddlFBTypeL1_SelectedIndexChanged, exception: " + ex.Message);
}
}
Hello,
I would like to change the basic header color of rad grid as the default displays GREY color. Can any one suggest CSS or any style that could provide the capablity of giving forced color to the header row of a rad grid? I need it as white jus like anyothr row..
Thanks,
Puri
I have to create a new CommandItem but i need have the function of exporting to excel of the commandItemSetting
I want to create a range bar chart for Task Schedule. I would like to use Rad Html chart for that. I have tasks list and their respective planned start date - end date and Actual start date - end date. So I tried to plot the chart with Rad Html chart but, it's Y-Axis is not accepting date type of value. it is only allowing decimal type of values.
So please help me, how it can be achieved. I have attached image, which shows how the chart should be displayed.