Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
161 views
Dear Telerik support team,

In the "Grid / Form Template Edit Form" example on this website, in Default.CS.aspx.cs class, there's a code block which runs when the user updates a record as shown below.



protected void RadGrid1_ItemUpdated(object source, Telerik.Web.UI.GridUpdatedEventArgs e)
{
if (e.Exception != null)
{
e.KeepInEditMode = true;
e.ExceptionHandled = true;
DisplayMessage(true, "Employee " + e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["EmployeeID"] + " cannot be updated. Reason: " + e.Exception.Message);
}
else
{
DisplayMessage(false, "Employee " + e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["EmployeeID"] + " updated");
}
}



The code above displays the notification message "Employee 3 updated"
If I want this notification message to display a message like "Employee Robert King updated"  how do I accomplish this?

I tried to use the code shown below but I don't think the code works correctly because the variable IDNumber gets the value from the field EmployeeID rather than the RadGrid's ItemIndex which starts from 0.

int IDNumber = (int)e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["EmployeeID"];

string EmployeeName = RadGrid1.MasterTableView.Items[IDNumber]["FirstName"].Text;

DisplayMessage(false, "Employee " + EmployeeName + " updated")

 

Many thanks,

ILJIMAE
Top achievements
Rank 1
 answered on 08 Aug 2012
0 answers
121 views
I have a grid that I am trying to add a column to.  Everything works except I need to be able to call a Javascript method, which also works, and pass a value to it, which does not work.  Here is my code:



                columns.Template(x =>
                { %>
                    <% if (SiteContext.Session.IsAdmin) {%>
                       <a href="javascript:void(0);" onclick= "DeleteDisposition('" + id +'");">Delete</a>  
                    <% } %>
                <%
                }).Title("Delete")
                .Width(80)
                .Visible(SiteContext.Session.IsAdmin);

Can someone tell me what I am doing wrong here?  I cannot figure this out.  Thanks...
Greg
Top achievements
Rank 1
 asked on 07 Aug 2012
1 answer
152 views
The client-side function get_textBoxValue(); of radtextbox will return the value of EmptyMessage if the textbox is left empty. Seems like this used to not be the case. I can lo longer determine if the textbox has an empty value on the client-side. Please help.
Psichi
Top achievements
Rank 1
 answered on 07 Aug 2012
1 answer
342 views
When exporting the radgrid using Biff Excel format, the resulting excel file has columns that are far too wide for the data they contain. I am confused because the Biff export demo seems to work just fine. The only major difference between my grid and the grid used in the demo is that I am not auto-generating my columns. Here is an example definition of one of my columns:

<telerik:GridBoundColumn DataField="FirstName" UniqueName="FirstName" HeaderText="First Name"
                    AutoPostBackOnFilter="True" ShowFilterIcon="False" FilterControlWidth="60px">
                    <ItemStyle Width="80px"/>
                    <HeaderStyle Width="80px"/>
</telerik:GridBoundColumn>

I have attached a screenshot of the resulting excel file's extremely wide columns.

Am I doing something wrong? Should I not be setting the ItemStyle and HeaderStyle in this manner? Is there a way for me to fix the column widths on export? The BiffExporting event did not seem to have a means of doing so.
Kyle Smith
Top achievements
Rank 1
 answered on 07 Aug 2012
6 answers
402 views
i have a grid with a checkbox on each row for users to select records for deletion.

however clicking on the row enables the user to edit that record.

checking or deselecting the checkbox is firing the rowclick and showing the edit popup, how do i prevent this happening ?

i dont want this rowclick to fire when the checkbox is ticked or unticked....
Mark
Top achievements
Rank 1
 answered on 07 Aug 2012
2 answers
279 views
I am currently in the eval stage and my company will most likely purchase the product in the near future.

I have two questions and hoping for quick answers thinking someone must have done similar things.

1. I have a tree view in one pane and some fields in the second pane that are related to the selected item in the treeview. Each node click refreshes the field values in the second pane. Clicking on each node causes a partial post back so it can refresh the fields in the second pane - this is expected. However, it doesn't retain the focus and therefore no longer allows arrow-key navigation until focus is manually moved to it.

2. When navigating by the arrow key, I have to hit Enter to actually select the node and to fire the server side click event. Is it possible to select the node and fire the even on just the up-down keys instead of having to hit Enter to select a node?


Thank you so much in advance
Plamen
Telerik team
 answered on 07 Aug 2012
4 answers
235 views
Hi,
i want to  use night-day instead of   hours column
what should i do?
with  ShowHoursColumn="false" property i can hide hours but how can i show day and night? 
thanks
Plamen
Telerik team
 answered on 07 Aug 2012
1 answer
115 views
Hi everyone,

I am working on the page that allows a user to edit text. Everything appear to be fine except that this text has to support fields (that's how they call it in MS word). Basically this text is a template where user can insert fields or variables which will be replaced with actual values when some event occurs. I am able to implement it using contenteditable="false" and unselectable="on". However there some cases when the html i am inserting is modified and I am loosing those attributes. One of such cases is when I try to insert the html code below into empty table cell. Once I do that field seem to appear in the editor, but once I switch to HTML or submit a form i am loosing contenteditable and unselectable attributes 
<span class="editorField" contenteditable="false" unselectable="on" variable="FieldName">Field Text</span>

I am not sure if this is browser issue or telerik specific. Does anyone have any experience with this or anyone knows a control that natively supports such functionality.

Thank you!
Aleksey
Rumen
Telerik team
 answered on 07 Aug 2012
3 answers
134 views
Hello!
How to do that in selected places was the week number. The format "week number/ year"?
Ivana
Telerik team
 answered on 07 Aug 2012
3 answers
306 views
Hi, 
i used Telerik Version 2011.3 and have a  problem when use get_text() in javascript. that retruns Empty in chrome.
thanks,
Azadeh
Ivana
Telerik team
 answered on 07 Aug 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?