Hi All,
Let me start off by saying I am a noob when it comes to using asp.net and telerik. With that being said I am having an issue updating the headers of the rad grid. When I run the application in Visual Studio the headers are correct, however when I build the solution and run the application on the internet the headers still reflect the old text (before the text change).The application in question was built by someone else using asp.net, c#, javascript, ajax, etc. I am pretty sure the version of telerik used originally is much older than the version I am using today which is the most current version as of 9/15/15 . I should also mention there are two versions of the application one being used now by employees and one I am working on a development sever. The header text that should be changed should be both the Approval and Status text.
I added two images below to show you what the app looks like in visual studio vs what it looks when run on the internet.
Code ASCX:
<
telerik:RadGrid
ID
=
"HistoryCard"
runat
=
"server"
OnNeedDataSource
=
"HistoryCard_NeedDataSource"
OnItemDataBound
=
"HistoryCard_ItemDataBound"
>
<
MasterTableView
AutoGenerateColumns
=
"false"
>
<
Columns
>
<
telerik:GridBoundColumn
HeaderText
=
"Due Date"
DataField
=
"due_date"
DataFormatString
=
"{0:MM/dd/yyyy}"
/>
<
telerik:GridBoundColumn
HeaderText
=
"Inspection Dates"
DataField
=
"inspection_date"
DataFormatString
=
"{0:MM/dd/yyyy}"
/>
<
telerik:GridTemplateColumn
HeaderText
=
"Status"
UniqueName
=
"Status"
>
<
ItemTemplate
>
<%# Common.EquipmentStatus.GetLabel(Eval("current_use")) %>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
HeaderText
=
"Approval"
UniqueName
=
"Approval"
>
<
ItemTemplate
>
<%# Common.HistoryStatus.GetLabel(Eval("status")) %>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
HeaderText
=
"Adjusted"
>
<
ItemTemplate
>
<%# GiTools.DataTypes.Bool.Format(Eval("adjusted"), "Yes", "No") %>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridBoundColumn
HeaderText
=
"Remarks:"
DataField
=
"remarks"
ItemStyle-CssClass
=
"history_card_links"
/>
<
telerik:GridTemplateColumn
HeaderText
=
"Inspector"
>
<
ItemTemplate
>
<%# GiTools.Mail.MailHelper.MakeMailToLink(null, null, Eval("email"), Eval("name")) %>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
Hi community,
I have a several RadDatePicker and one RadMonthYearPicker control on a simple page.
I was trying to hide some of them by condition through client side event only, so I write a handler and try to use client object methods to hide them.
My handler looks like:
function
handler(){
alert(
"before"
);
$find(
"<%= RadDatePicker1.ClientID %>"
).set_visible(
false
);
$find(
"<%= RadMonthYearPicker1.ClientID %>"
).set_visible(
false
);
alert(
"after"
);
}
Both alert message pop up without any javascripts error, but none of the control is hidden...
This is my first trial, then I try to work around with get_textBox() and hide the text box rendered.
function
handler2(){
alert(
"before"
);
$($find(
"<%= RadDatePicker1.ClientID %>"
).get_textBox()).hide();
$($find(
"<%= RadMonthYearPicker1.ClientID %>"
).get_textBox()).hide();
alert(
"after"
);
}
Now the DatePicker is hidden but not the MonthYearPicker...
What have I do wrong and how can I achieve such easy tasks?
I am using Telerik Ajax 2012.1.411, and my browser is Chrome & IE8+
Thanks!
I can find no way to properly format my source code samples here on this forum. The painbrush icon (Format Code Block) simply doesn't work, and never has. Begging everyone's pardon, could you please see my question on Stack, which formats code samples nicely. If anyone can tell me how to properly format my code blocks here on this forum, I am happy to learn.
http://stackoverflow.com/questions/32737055/telerik-radgrid-codebehind-doesnt-recognize-rows-added-via-javascript
Thanks very much.​
I have a RadGrid with that works correctly outside of the RadPanelBar. When I put it inside of a RadPanelBar the OnCheckedChanged="ToggleRowSelection" does not fire. Does "protected void ToggleRowSelection(object sender, EventArgs e)" need to be defined differently? It looks like the auto post back works because the check mark disappears. If I remove ToggleRowSelection in the c# section I get a compile error indicating that there is no definition for ToggleRowSelection so I think it is all correct.
Thanks,
Scott
<
telerik:RadPanelBar
ID
=
"RadPanelBar1"
Runat
=
"server"
Width
=
"774px"
>
<
Items
>
<
telerik:RadPanelItem
runat
=
"server"
Text
=
"Web Servers"
>
<
ContentTemplate
>
<
telerik:RadGrid
ID
=
"WebServerRadGrid"
runat
=
"server"
AllowPaging
=
"True"
PageSize
=
"5"
Skin
=
"Silk"
AllowMultiRowSelection
=
"true"
>
<
MasterTableView
>
<
Columns
>
<
telerik:GridTemplateColumn
UniqueName
=
"CheckBoxTemplateColumn"
>
<
ItemTemplate
>
<
asp:CheckBox
ID
=
"CheckBox1"
runat
=
"server"
OnCheckedChanged
=
"ToggleRowSelection"
AutoPostBack
=
"True"
/>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
</
ContentTemplate
>
</
telerik:RadPanelItem
>
</
Items
>
</
telerik:RadPanelBar
>
protected
void
ToggleRowSelection(
object
sender, EventArgs e)
{
((sender
as
CheckBox).NamingContainer
as
GridItem).Selected = (sender
as
CheckBox).Checked;
bool
checkHeader =
true
;
foreach
(GridDataItem dataItem
in
WebServerRadGrid.MasterTableView.Items)
{
if
(!(dataItem.FindControl(
"CheckBox1"
)
as
CheckBox).Checked)
{
checkHeader =
false
;
break
;
}
}
GridHeaderItem headerItem = WebServerRadGrid.MasterTableView.GetItems(GridItemType.Header)[0]
as
GridHeaderItem;
(headerItem.FindControl(
"headerChkbox"
)
as
CheckBox).Checked = checkHeader;
}
Grid is not refreshed after ItemCommand event
Protected Sub Parts_ItemCommand(sender As Object, e As GridCommandEventArgs) Handles Parts.ItemCommand
If e.CommandName = "DeleteInventory" Then
Dim filename As String = _uploadSystemPath & "tree.xml"
Dim XMLDoc As XDocument = XDocument.Load(_uploadSystemPath & "tree.xml")
XMLDoc.Root.Elements("Node")(e.Item.ItemIndex).Remove()
XMLDoc.Save(filename)
XMLBookBuilderSource.DataFile = _uploadSystemPath & "tree.xml"
Parts.DataSource = XMLBookBuilderSource
Parts.DataBind()
End If
End Sub
UI for ASP.NET AJAX version: 2015.1.225
I'm trying to grab information from the radgrid when the user selects a row. The Javascript function fires as expected, but I can't seem to get the right syntax to grab the cell information.
<script type="text/javascript">
function launchDetails(sender, eventArgs) {
}
</script>
If I use 'sender.MasterTableView.getColumnByUniqueName("caseName");' I get the column information as expected.
If I use 'parseInt(eventArgs.get_itemIndexHierarchical());' I get the selected row index as expected.
If I use 'sender.MasterTableView.getCellByColumnUniqueName(parseInt(eventArgs.get_itemIndexHierarchical()),"caseName");' I get the following error:
'Uncaught TypeError: a.get_element is not a function(…)' at 'Telerik.Web.UI.GridTableView.getCellByColumnUniqueName'
I've also tried this line of code without the 'parseInt', but obtain the same results. How can I grab the "caseName" at the designated clicked row?
I have an external button that needs to call my UpdateCommand event, but I am not sure how to do it. Here is what I have so far:
protected
void
RadGrid2_UpdateCommand(
object
sender, GridCommandEventArgs e)
{
String connectionString = System.Configuration.ConfigurationManager.ConnectionStrings[
"KBConnectionString"
].ConnectionString;
try
{
string
answerid = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex][
"AnswerID"
].ToString();
using
(SqlConnection conn =
new
SqlConnection(connectionString))
{
conn.Open();
SqlCommand cmd =
new
SqlCommand(
"UPDATE Answers SET Answer_Name = @prmAnswer_Name, Answer = @prmAnswer, TimeAdded = CURRENT_TIMESTAMP WHERE AnswerID = "
+ answerid, conn);
cmd.Parameters.Add(
new
SqlParameter(
"@prmAnswer_Name"
, RadTextBox1.Text));
cmd.Parameters.Add(
new
SqlParameter(
"@prmAnswer"
, RadEditor.Text));
cmd.ExecuteNonQuery();
conn.Close();
}
}
catch
(Exception)
{
RadScriptManager.RegisterClientScriptBlock(
this
,
this
.GetType(),
"alertMessage"
,
"alert('There was a problem finding the ID, please contact support.')"
,
true
);
}
}
protected
void
RadButton2_Click(
object
sender, EventArgs e)
{
//CommandEventArgs cea = new CommandEventArgs(RadTextBox1.Text, RadEditor.Text);
//GridCommandEventArgs args = new GridCommandEventArgs(null, "Edit", cea);
//RadGrid2_UpdateCommand(sender, args);
}
Hello,
there are nice and proper examples for adding an extra input field for each upload of a file in the onClientFileUploaded event.
Like here: http://demos.telerik.com/aspnet-ajax/asyncupload/examples/additionalfields/defaultcs.aspx
But how do i add a second ?
Tried this but failed with a jQuery error :(
function onClientFileUploaded(radAsyncUpload, args) {
var $row = $(args.get_row());
var inputName = radAsyncUpload.getAdditionalFieldID("TextBox");
var inputID = inputName;
var input = createInput(inputID, inputName);
var label = createLabel(inputID);
$row.append("<br/>");
$row.append(label);
$row.append(input);
var $row2 = $(args.get_row());
var inputName2 = radAsyncUpload.getAdditionalFieldID("SelectBox");
var inputID2 = inputName2;
var input2 = createDocTypeInput(inputID2, inputName2);
$row2.append("<br/>");
$row2.append(label)
$row2.append(input2);
}
Any help is highly appreciated.