Is it possible to customize the range that is displayed on my Yaxis? If the recordset populating the chart has numbers from 75,000,000 - 85,000,000, I don't want to start at 0 but say have my range be 65,000,000 - 95,000,000. But the range can change based upon the data being returned. It would be nice to have my range be 10% of the minimum value and maximum value. Something else is that my values returned may also be a percentage.
Also on my Xaxis I will be displaying dates. How do I only show the labels where the month is a quarter end (3, 6, 9, 12)?
Thanks
What i need to happen is that after a user logs in and the page goes to Home.aspx, I need the Home RadMenuItem to be selected on page load. When they click About it will go to About.aspx page and select the About RadMenuItem on page load. Please advice
MasterPage.master: <telerik:RadMenu runat="server" ID="mnuTopBar" EnableEmbeddedSkins="false" Width="800px"></telerik:RadMenu>
On Home.aspx:
Private Sub SelectMenu()
Dim menu As New RadMenu
Dim currItem As New RadMenuItem
menu = DirectCast(Me.Page.Master.FindControl("mnuTopBar"), RadMenu)
End Sub
Above is all i have so far. I have tried currItem = menu.FindItemByText("Home") but getting nothing on currItem. Please advice...
How can I go about formatting a column when AutoGenerateColumns="true"?
I have a recordset returned from the database and I needed to transpose the data which I have done successfully. Now I would need to format that rows data to either currency or percentage. The number of columns will be dynamic but the number of rows will be static.
Attached is an image of what my data looks like I need formatted.
<
telerik:RadGrid
ID
=
"grdResults"
runat
=
"server"
>
<
ClientSettings
>
<
Scrolling
AllowScroll
=
"true"
UseStaticHeaders
=
"True"
SaveScrollPosition
=
"true"
></
Scrolling
>
<
Selecting
AllowRowSelect
=
"true"
/>
<
Resizing
AllowColumnResize
=
"true"
/>
</
ClientSettings
>
<
MasterTableView
AutoGenerateColumns
=
"true"
HeaderStyle-Width
=
"100px"
>
<
Columns
>
<
telerik:GridTemplateColumn
UniqueName
=
"RowNumber"
Visible
=
"false"
>
<
ItemTemplate
>
<
asp:Label
ID
=
"lblRowNumber"
runat
=
"server"
/>
</
ItemTemplate
>
<
ItemStyle
Font-Bold
=
"true"
Width
=
"20px"
/>
<
HeaderStyle
Width
=
"50px"
/>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
UniqueName
=
"RowText"
>
<
ItemTemplate
>
<
asp:Label
ID
=
"lblRowText"
runat
=
"server"
/>
</
ItemTemplate
>
<
ItemStyle
Font-Bold
=
"true"
Width
=
"20px"
/>
<
HeaderStyle
Width
=
"300px"
/>
</
telerik:GridTemplateColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
Protected
Sub
Page_Load(
ByVal
sender
As
Object
,
ByVal
e
As
System.EventArgs)
Handles
Me
.Load
oConn.Open()
Dim
ocmd
As
New
SqlCommand(
"myStoredProc"
, oConn)
ocmd.CommandType = CommandType.StoredProcedure
With
ocmd.Parameters
.Add(
New
SqlParameter(
"@my_num"
, 95778))
End
With
reader = ocmd.ExecuteReader
If
reader.HasRows
Then
Dim
dt
As
DataTable =
New
DataTable()
dt.Load(reader)
'GetTransposedTable(dt)
grdResults.DataSource = GetTransposedTable(dt)
grdResults.DataBind()
End
If
End
Sub
Function
GetTransposedTable(
ByVal
dtOriginal
As
DataTable)
As
DataTable
Dim
dtReflection
As
New
DataTable(
"Reflection"
)
For
i
As
Integer
= 0
To
dtOriginal.Rows.Count - 1
dtReflection.Columns.Add(dtOriginal.Rows(i)(0))
Next
Dim
row
As
DataRow
For
j
As
Integer
= 1
To
dtOriginal.Columns.Count - 1
row = dtReflection.NewRow
For
k
As
Integer
= 0
To
dtOriginal.Rows.Count - 1
row(k) = dtOriginal.Rows(k)(j)
Next
dtReflection.Rows.Add(row)
Next
Return
dtReflection
End
Function
Private
Sub
grdResults_ItemDataBound(sender
As
Object
, e
As
GridItemEventArgs)
Handles
grdResults.ItemDataBound
'Set Row Count
If
TypeOf
e.Item
Is
Telerik.Web.UI.GridDataItem
Then
Dim
rowCounter
As
Integer
= 0
Dim
lblRowNumber
As
Label = TryCast(e.Item.FindControl(
"lblRowNumber"
), Label)
Dim
lblRowText
As
Label = TryCast(e.Item.FindControl(
"lblRowText"
), Label)
rowCounter = grdResults.MasterTableView.PageSize * grdResults.MasterTableView.CurrentPageIndex
lblRowNumber.Text = (e.Item.ItemIndex + 1 + rowCounter).ToString()
If
lblRowNumber.Text = 1
Then
lblRowText.Text =
"Total Assets"
ElseIf
lblRowNumber.Text = 2
Then
lblRowText.Text =
"Total Shares"
ElseIf
lblRowNumber.Text = 3
Then
lblRowText.Text =
"Net Capital"
ElseIf
lblRowNumber.Text = 4
Then
lblRowText.Text =
"Total Loans"
ElseIf
lblRowNumber.Text = 5
Then
lblRowText.Text =
"Allowance for Loan Losses"
ElseIf
lblRowNumber.Text = 6
Then
lblRowText.Text =
"Total Delinquency - Delinquent Loans (>2 mo)"
ElseIf
lblRowNumber.Text = 7
Then
lblRowText.Text =
"Net Capital Ratio"
ElseIf
lblRowNumber.Text = 8
Then
lblRowText.Text =
"Delinquency Ratio"
ElseIf
lblRowNumber.Text = 9
Then
lblRowText.Text =
"Operating Expenses - Annualized Operating Exp Ratio"
ElseIf
lblRowNumber.Text = 10
Then
lblRowText.Text =
"Net Income/(Loss) - Annualized ROA"
ElseIf
lblRowNumber.Text = 11
Then
lblRowText.Text =
"Net Charge-Offs/Avg. Loans - Annualized Net C/O"
ElseIf
lblRowNumber.Text = 12
Then
lblRowText.Text =
"Coverage Ratio (ALL-to-Delq)"
ElseIf
lblRowNumber.Text = 13
Then
lblRowText.Text =
"Interest Margin"
ElseIf
lblRowNumber.Text = 14
Then
lblRowText.Text =
"Other Income"
ElseIf
lblRowNumber.Text = 15
Then
lblRowText.Text =
"Provision for Loan Losses"
End
If
End
If
End
Sub
What I need to do is set a ​GroupHeaderTemplate link to 1 of 2 URL's based upon the value of a ​GridBoundColumn.
If Section="Marketing" then display 1st URL
else
display 2nd URL
How would I go about doing this?
<
GroupHeaderTemplate
>
<
a
href='/CUTracking/Notes/Default.aspx?
Section
=
FMS
&SearchCharterNum=<%# Eval("Charter_Num") %>' title="View <%# Eval("CUName")%> notes section"><%# Eval("CUName")%></
a
>
</
GroupHeaderTemplate
>
<
telerik:GridBoundColumn
HeaderText
=
"SECTION"
UniqueName
=
"Section"
FilterControlAltText
=
"Filter column column"
DataField
=
"Section"
>
<
ColumnValidationSettings
>
<
ModelErrorMessage
Text
=
""
></
ModelErrorMessage
>
</
ColumnValidationSettings
>
<
ItemStyle
HorizontalAlign
=
"Center"
/>
<
HeaderStyle
HorizontalAlign
=
"Center"
Width
=
"100px"
/>
</
telerik:GridBoundColumn
>
I attempted doing it on RadGrid.ItemDataBound but received an error because it didn't have a dataitem called "Section".
If DataBinder.Eval(e.Item.DataItem, "Section") = "Marketing" Then
After installing the new version Q2 2015 I have some problems launching the procedure converted to Visual Studio 2013.
Using IIS Express using some controls like grid are several errors in JavaScript regarding Telerik.Web.UI.WebResource.axd.
Launching the application with IIS these problems disappear (fortunately).
The message that comes out is always the same: "Cannot use a leading .. to exit above the top directory."
It 'a very serious problem that prevents it from working correctly with Visual Studio 2013.
Thanks in advance.
Good morning Community,
I'm having an issue under Chrome browser that is not allowing me to set the page index and a selected item. The scenario is that I have a main page showing a list of items. I use RadWindow as popup to add & edit actions. At code behind I use try and catch. If no exception is catched I call a javascript function to close RadWindow and pass "ok" as parameter, in case of an exception inside catch I call the same function but with "error" as parameter.
This function looks as follow, depending the parameter I am calling two different javascript functions from parent page:
function CloseWindow(refreshParent) {
GetRadWindow().close();
if (refresh​Parent == "yes") {
CallFunctionOnParentPage("RefreshSuccess");
}
else {
CallFunctionOnParentPage("RefreshError");
}
}​
These functions from parent are used to refresh grids and show message of success or error at the top of the page. A postback is executed, I set the EVENTTARGET (1st value) and EVENTARGUMENT (2nd value):
function RefreshSuccess() {
__doPostBack("<%= uppMain.ClientID %>", "ok");
}
function RefreshError() {
__doPostBack("<%= uppMain.ClientID %>", "error");
}
So, when the postback is executed on parent's Page_Load method (at code behind) I'm checking the value of target & argument and then I can set the color of the message (blue if success, salmon when error)
string eventTarget = Request.Params.Get("__EVENTTARGET");
switch (eventTarget)
{
case "MainCPH_uppMain":
string resultMessage = Request.Params.Get("__EVENTARGUMENT");
if (resultMessage == "ok")
{
lblMessage.Attributes.Add("style", "display:block");
lblMessage.BackColor = System.Drawing.Color.LightSkyBlue;
lblMessage.Text = "The information has been successfully saved.";
}
else
{
lblMessage.Attributes.Add("style", "display:block");
lblMessage.BackColor = System.Drawing.Color.Salmon;
lblMessage.Text = "A problem has ocurred when saving the information.";​
}
}
When adding a new item to the grid (alphabetic order), I require to make the new element appear as selected, including if necessary a change of page. For this, when the save was successful I'm searching for the newest item's ID, page by page and set its selected property to true:
NOTE: I am using multi-tier structure, so I have a Model layer where I have a definition of the model Item, I use a list of those models as datasource of the grid and that is why I cast the items to that model.
int i = 0;
for(i=0; i < gridItems.PageCount; i++)
{
gridItems.CurrentPageIndex = i;
gridItems.MasterTableView.Rebind();
foreach (GridDataItem item in gridItems.Items)
{
Model.​Item ​myItem= (Model.​Item)item.DataItem;
if (​myItem.CompanyID == ​newestID)
{
item.Selected = true;
break; // break, once it is found there is no need to keep searching
}
}
}
And well, here is the issue, everything is working just fine under Firefox and Internet Explorer, but for some reason is not working under chrome, the page of the grid is not changing and the new item does not appear as selected. So, the .CurrentPageIndex and the .Selected seems not to be working. Any ideas?
I tried to simplify my example, the real page is using different tabs (that's why I need the EVENTTARGET, as sometimes I only need to refresh one tab but in some cases I need to refresh multiple tabs). The page is also calling different RadWindows. That is why I would like to keep the solution of the issue at the same level that I have the logic, at Page_Load method under Parent's codebehind.
Thanks in advance, any hint will be highly appreciated. Let me know if more details are required.
Regards,
Oscar