Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
232 views
Hello all,

I am trying to get an event back to the server for deleting.  I have added a GridClientDeleteColumn to my radgrid.  Then I  added OnItemCommand, OnDeleteCommand, OnItemDeleted event handlers, but I am not getting any of these events when the delete is completed.

A work around that I found was using a GridButtonColumn and adding the confirm text to that, but the problem is that I wanted to have an image show for the delete and the GridButtonColumn doesn't seem  to be working with the ImageUrl property set.  Has anyone seen this before?

I would really appreciate it if someone could give me a resolution to either of these problems:

1) Why I can't get the server side event from the GridClientDeleteColumn?
2) Why the GridButtonColumn is not showing my image from the ImageUrl property?

Configuration:
ASP.NET 3.5
VS2008
Telerik.Web.UI.dll 2008.2.826.35

Thanks in advance,
Lee
Vlad
Telerik team
 answered on 14 Oct 2008
1 answer
57 views
I want to add a checkbox list to the details area of a radgrid.   Is there any telerik control that makes this easier, or do a just make a template and user the microsoft checkboxlist control?
Princy
Top achievements
Rank 2
 answered on 14 Oct 2008
2 answers
154 views
hi Telerik
I am trying to open a rad window by selecting an option in the context menu that should be displayed on the right click of rad grid row. I tried opening rad window from code behind but it didnt worked so tried opening it from javascript. What is happening that it didnt show for the first time when i right click the context menu item. However it opens after every next click.Also i m passing the title and id  from the grid to the window,i obsered that it shows the title of the previous clicked row and not the current row on show.
here is the code behind:

protected void RadMenu1_ItemClick(object sender, RadMenuEventArgs e)

{

int radGridClickedRowIndex;

Label labeltitle;

radGridClickedRowIndex =

Convert.ToInt32(Request.Form["radGridClickedRowIndex"]);

string SignpostId= RadGrid1.Items[radGridClickedRowIndex].Cells[4].Text;

GridDataItem current =RadGrid1.Items[radGridClickedRowIndex];

labeltitle = (

Label)current["Ref"].FindControl("Label4");

string STitle = labeltitle.Text;

if (e.Item.Text == "Add Criteria")

{

string arg1 = "AwardId=" + ParentPage.iaward_id;

string arg2 = "&SignpostId=" + SignpostId;

string arg3 = "&STitle=" + STitle;

e.Item.Attributes[

"onclick"] = "return AddCriteria('" + arg1 + "','" + arg2 + "','" + arg3 + "')";

}

if (e.Item.Text == "Edit Criteria")

{

string arg1 = "AwardId=" + ParentPage.iaward_id;

string arg2 = "&SignpostId=" + SignpostId;

string arg3 = "&STitle=" + STitle;

e.Item.Attributes[

"onclick"] = "EditCriteria('" + arg1 + "','" + arg2 + "','" + arg3 + "')";

 }
}

 

 and the aspx page for this is:

<%

@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<%

@ Control Language="c#" AutoEventWireup="false" Codebehind="signposts.ascx.cs" Inherits="ecms.custom.cmatters.learningportal.awards.controls.signposts" TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>

<

asp:Label Runat="server" ID="Label1" />

<

asp:label id="SignpostID" Visible="False" runat="server"></asp:label>

<

asp:label id="uiSignpostID" Visible="False" runat="server"></asp:label>

<telerik:RadScriptBlock runat="server" ID="RadScriptBlock1">

<script type="text/javascript">

function RowContextMenu(sender, eventArgs)

{

var menu = $find("<%=RadMenu1.ClientID %>");

var evt = eventArgs.get_domEvent();

if(evt.target.tagName == "INPUT" || evt.target.tagName == "A")

{

return;

}

var index = eventArgs.get_itemIndexHierarchical();

document.getElementById(

"radGridClickedRowIndex").value = index;

sender.get_masterTableView().selectItem(sender.get_masterTableView().get_dataItems()[index].get_element(),

true);

menu.show(evt);

evt.cancelBubble =

true;

evt.returnValue =

false;

if (evt.stopPropagation)

{

evt.stopPropagation();

evt.preventDefault();

}

return true;

}

function AddCriteria(msgId1,msgid2,msgid3)

{

var oWnd = radopen("SelectCriteria.aspx/?" + msgId1 + msgid2 + msgid3, "RadWindow1");

oWnd.visibleonpageload =

true;

oWnd.setSize(800,800);

}

function EditCriteria(msgId1,msgid2,msgid3)

{

var oWnd = radopen("EditCriteria.aspx/?" + msgId1 + msgid2 + msgid3, "RadWindow1");

oWnd.VisibleOnPageLoad =

true;

oWnd.setSize(800,800);

}

</script>

</telerik:RadScriptBlock>

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

<AjaxSettings>

<telerik:AjaxSetting AjaxControlID="RadGrid1">

<UpdatedControls>

<telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="AjaxLoadingPanel1" />

<telerik:AjaxUpdatedControl ControlID="RadMenu1" />

</UpdatedControls>

</telerik:AjaxSetting>

<telerik:AjaxSetting AjaxControlID="RadMenu1">

<UpdatedControls>

<telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="AjaxLoadingPanel1" />

<telerik:AjaxUpdatedControl ControlID="RadMenu1" />

</UpdatedControls>

</telerik:AjaxSetting>

</AjaxSettings>

</telerik:RadAjaxManager>

<Telerik:RadWindowManager VisibleOnPageLoad="true" DestroyOnClose="true" Modal ="true" ID="RadWindowManager1" runat="server" />

<input type="hidden" id="radGridClickedRowIndex" name="radGridClickedRowIndex" />

<telerik:RadGrid id="RadGrid1" width="595" runat="server" OnNeedDataSource="RadGrid1_NeedDataSource" AllowMultiRowSelection=true

Gridlines="None" AllowPaging="True" ShowFooter="False" PageSize="10" EnableAJAX="True" AutoGenerateColumns="False"

EnableAJAXLoadingTemplate="False" LoadingTemplateTransparency="50" AllowAutomaticDeletes="True"

OnUpdateCommand="RadGrid1_UpdateCommand" OnInsertCommand="RadGrid1_InsertCommand" OnDeleteCommand="RadGrid1_DeleteCommand" ShowStatusBar="false">

<PagerStyle Mode="NextPrevAndNumeric" CssClass="RadListPager"></PagerStyle>

<ClientSettings>

<ClientEvents OnRowContextMenu="RowContextMenu"></ClientEvents>

<SELECTING AllowRowSelect="true" />

</ClientSettings>

<MasterTableView GridLines="None" Width="100%" CommandItemDisplay="Top" DataKeyNames="signpost_id">

<CommandItemTemplate>

<asp:LinkButton ID="LinkButton2" runat="server" CommandName="InitInsert" Visible='<%# IsEditable() %>'><img style="border:0px" alt="" src="<%# ParentPage.CMSThemeFolder%>/gridskin/AddRecord.gif" /> Add Signpost &nbsp;&nbsp;&nbsp;</asp:LinkButton>

<asp:LinkButton ID="LinkButton4" runat="server" CommandName="RebindGrid" Visible='<%# IsEditable() %>'><img style="border:0px" alt="" src="<%# ParentPage.CMSThemeFolder%>/gridskin/Refresh.gif" /> Refresh </asp:LinkButton>

<br />

</Columns>

</CommandItemTemplate>

<Columns>

<telerik:GridEditCommandColumn ButtonType="ImageButton" UpdateImageUrl="img/Update.gif" EditImageUrl="img/Edit.gif" InsertImageUrl="img/Insert.gif" CancelImageUrl="img/Cancel.gif" UniqueName="EditCommandColumn">

<ItemStyle HorizontalAlign="Center" />

</telerik:GridEditCommandColumn>

<telerik:GridClientDeleteColumn ConfirmText="Delete this item?" ButtonType="ImageButton" ImageUrl="img/Delete.gif" CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">

<ItemStyle HorizontalAlign="Center" />

</telerik:GridClientDeleteColumn>

<telerik:GridBoundColumn HeaderText="ID" Groupable="False" DataField="signpost_id" ReadOnly="True" Visible="False" Resizable="True" AllowFiltering="False" UniqueName="signpost_id" Reorderable="False"></telerik:GridBoundColumn>

<telerik:GridBoundColumn HeaderText="Ref" Groupable="False" DataField="signpost_ref" ReadOnly="True" Visible="True" Resizable="True" AllowFiltering="False" UniqueName="signpostref" Reorderable="False"></telerik:GridBoundColumn>

<telerik:GridTemplateColumn HeaderText="Title" UniqueName="Ref" EditFormColumnIndex="1">

<ItemTemplate>

<asp:Label runat="server" ID="Label4" Text='<%# DataBinder.Eval(Container.DataItem,"signpost_title") %>'></asp:Label>

</ItemTemplate>

</telerik:GridTemplateColumn>

<telerik:GridTemplateColumn UniqueName="TemplateColumn2" HeaderText="Enabled">

<HeaderStyle ></HeaderStyle>

<ItemStyle Height="25px" HorizontalAlign="Center"></ItemStyle>

<ItemTemplate>

<img src="<%# GetEnabledImage(DataBinder.Eval(Container.DataItem, "enabled")) %>">

</ItemTemplate>

</telerik:GridTemplateColumn>

</Columns>

<EditFormSettings UserControlName="controls/signpostdetail.ascx" EditFormType="WebUserControl">

</EditFormSettings>

<ExpandCollapseColumn ButtonType="ImageButton" Visible="False" UniqueName="ExpandColumn">

<HeaderStyle Width="19px"></HeaderStyle>

</ExpandCollapseColumn>

</MasterTableView>

</telerik:RadGrid>

<telerik:radcontextmenu ID="RadMenu1" runat="server" Skin="Vista"

OnItemClick="RadMenu1_ItemClick" style="top: 415px; left: 10px">

<Items>

<telerik:RadMenuItem Text="Add Criteria" />

<telerik:RadMenuItem IsSeparator="true"/>

<telerik:RadMenuItem Text="Edit Criteria" />

</Items>

</telerik:radcontextmenu>

 

<

asp:Literal id="DBConnectionString" runat="server" Visible="False" />

Kindly help on how to open rad window on the click of context menu by passing paramaters to the rad window. I am new to teleik and have tried all combinations that i know. 
Also wanted to share that i am able to open the rad window from code behind on the rad tree view context menu click. The code behind for the code its working fine in tree view is :


protected void ContextClicked(object sender, RadTreeViewContextMenuEventArgs e)

{

string s = String.Format("You clicked the <b>'{0}'</b> context item for node <b>'{1}'</b>", e.Node.ContextMenuID, e.Node.Text);

string sSelectedText = e.MenuItem.Text;

ParentPage.GeneralFunctions.AssignLabelText(Page.Controls,

"StatusText", s);

ViewUnitsPanel.Visible =

false;

 if (sSelectedText == "Add Units")

{

string arg1 = "AwardBodyId=" + ParentPage.iawardbody_id + "&GroupId= " + e.Node.Value + "&Title= " + e.Node.Text + "&Action=Add";

Telerik.Web.UI.

RadWindow newwindow = new Telerik.Web.UI.RadWindow();

newwindow.ID = "SearchWnd";

newwindow.VisibleOnPageLoad = true;

newwindow.Width = 1100;

newwindow.Height = 800;

newwindow.NavigateUrl = "~/custom/cmatters/learningportal/awards/GroupUnits.aspx?" + arg1;

RadWindowManager1.Windows.Add(newwindow);

ViewUnitsPanel.Visible =

true;

}

.}

 However when i use the above code to open window on the context click of  rad grid from code behind nothing happens. The ASP.Net version is 2.0 and Telerik version is :RadControls for ASPNET AJAX Q1 2008

Kindly help.Many thanks.

Best Regards
Ash

jincy
Top achievements
Rank 1
 answered on 14 Oct 2008
1 answer
350 views
Hi everyone, I have a webpage includes RadGrid and it has several columns, one of the column shows us the member's e-mail addresses, and each row has a hyperlink attribute ( to send instant mail with outlook or etc.) But All RadGrid also exportable with Excel. Here is a little bit problem, because when I want to use Hyperlink attribute to link outlook I've to change the type of the column,
and it can't appear in the exported file, other columns has not such a problem, they appears stably.

The Normal columns uses : <radG:GridBoundColumn DataField="E_MAIL">
Hyperlinked Columns uses : <radG:GridHyperLinkColumn DataNavigateUrlFields="E_MAIL"> 

So How can I show the E MAIL columns when I export to Excel ?

HyperLinked Code :

<

radG:GridHyperLinkColumn DataNavigateUrlFields="E_MAIL" UniqueName="E_MAIL" DataTextField="E_MAIL" DataNavigateUrlFormatString="mailto:{0}" DataTextFormatString="{0}"
ItemStyle-Width="100px" ItemStyle-Font-Underline="true" HeaderText="E-Mail" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
</radG:GridHyperLinkColumn>

 


Shinu
Top achievements
Rank 2
 answered on 14 Oct 2008
1 answer
91 views
I want to use the drag and drop feature of radgrid to drag from a radgrid and drop it in an aspx form. Are there any examples or demos?
Princy
Top achievements
Rank 2
 answered on 14 Oct 2008
7 answers
119 views
Hi

I am using Telerik controls 2008 Q2 SP2.

When a RadDatePicker or RadTimeView is near the bottom of the page the popup always shows past the bottom of the page. This means that the user has to scroll down to select anything.

I noticed that the RadCombo is intelligent enough to detect the bottom of the page and show the popup above the control.

Is there a way of doing this with the RadDatePicker and RadTimeView?


Kind regards

Mark Eaton
Mark
Top achievements
Rank 1
 answered on 14 Oct 2008
6 answers
240 views
Hi,
I'm new and I need a littel help. :)

I have a gird attached to query.
At _ItemDataBound event I arrive to know the big Total of a field.
I need to update a colum to % of  big Total.

I arrive to do on _ItemDataBound event:

If (TypeOf e.Item Is GridFooterItem) Then
    [...]
   Dim dataitem As GridDataItem = CType(e.Item.OwnerTableView.ParentItem, GridDataItem)
   Dim item As GridDataItem   

   For x = 0 To ? 'where I read hou many row I have on table?

now I need to refer to x value on cell and change it but I'm not able!

someone can help me

Tanks
RRE
Top achievements
Rank 2
Iron
 answered on 13 Oct 2008
6 answers
324 views
Hello,

I would like to use the example here:
http://demos.telerik.com/ASPNET/Prometheus/Slider/Examples/Skinning/DefaultCS.aspx

But, I want the slider to perform like a thermometer where the value at the top of the slider is 100 and the value at the bottom is 0.  Is this easily done?

Thanks.
Tsvetie
Telerik team
 answered on 13 Oct 2008
3 answers
115 views
Hi all,

May any one help me to(wpf windowsapplication)
Remove child record from radgridview(AutoGeneratedHiearchy) based on selection of parent record .I used Tabledefination  to add childtable to radgridview.

I will be thankfull to you if u send response as soon as possible.
Dimitar Dobrev
Telerik team
 answered on 13 Oct 2008
1 answer
128 views
I was looking at this link:

http://www.telerik.com/help/aspnet-ajax/grdexport.html

and I don't see the ExcelExportCellFormatting event.  I need to make sure a certain column gets exported as text rather than a number.

Also, can I exclude some columns from being exported?
Iana Tsolova
Telerik team
 answered on 13 Oct 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?