Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
128 views
Hi ,

How to set edit mode on click of image button in the Radgrid. On Click of "ImgDemote" button i need enable the EditItemTemplate in the "Pending Status " Column. Which as RadComboBox and Save And Cancel Button in it. How enable edit mode and hide the Label field when edit is true. Please give me solution


<telerik:RadGrid ID="rgAchCashTransfer" runat="server" AllowMultiRowSelection="false"
                                                AllowPaging="true" ShowHeader="true" AutoGenerateColumns="False" loadingtemplatetransparency="25"
                                                Width="750px" OnItemDataBound="rgAchCashTransfer_ItemDataBound" Visible="false"
                                                OnNeedDataSource="rgAchCashTransfer_NeedDataSource"  OnItemCommand="rgAchCashTransfer_ItemCommand" GridLines="None" AllowSorting="True"
                                                Height="235px" AlternatingItemStyle-BackColor="AliceBlue" Skin="Office2007">
                                                <AlternatingItemStyle BackColor="AliceBlue"></AlternatingItemStyle>
                                                <MasterTableView TableLayout="Fixed" EditMode="InPlace" EnableNoRecordsTemplate="true">
                                                    <PagerStyle Mode="NextPrevAndNumeric" Visible="true" />
                                                    <NoRecordsTemplate>
                                                        <div>
                                                            No records to display</div>
                                                    </NoRecordsTemplate>
                                                    <Columns>
                                                        <telerik:GridBoundColumn DataField="OfficeCode" HeaderButtonType="TextButton" Visible="true"
                                                            HeaderText="Off" SortExpression="OfficeCode" UniqueName="OfficeCode">
                                                            <HeaderStyle HorizontalAlign="left" Width="30px" />
                                                            <ItemStyle HorizontalAlign="left" />
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridTemplateColumn DataField="AccountNumber" HeaderButtonType="TextButton"
                                                            HeaderText="Account" UniqueName="AccountNumber" Visible="true">
                                                            <HeaderStyle HorizontalAlign="left" Width="50px" />
                                                            <ItemStyle HorizontalAlign="left" />
                                                            <ItemTemplate>
                                                                <asp:Label runat="server" ID="lblAccount" Text='<%# DataBinder.Eval(Container.DataItem, "AccountNumber")%>'></asp:Label>
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridTemplateColumn DataField="CashTransferID" HeaderButtonType="TextButton"
                                                            HeaderText="CashTransferID" UniqueName="CashTransferID" Visible="false">
                                                            <HeaderStyle HorizontalAlign="left" Width="0px" />
                                                            <ItemStyle HorizontalAlign="left" />
                                                            <ItemTemplate>
                                                                <asp:Label runat="server" ID="lblCashTransferID" Text='<%# DataBinder.Eval(Container.DataItem, "CashTransferID")%>'></asp:Label>
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridBoundColumn DataField="AccountName" HeaderButtonType="TextButton" Visible="true"
                                                            HeaderText="Name" SortExpression="AccountName" UniqueName="AccountName">
                                                            <HeaderStyle HorizontalAlign="left" Width="50px" />
                                                            <ItemStyle HorizontalAlign="left" />
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="CashTransferTypeDescription" HeaderButtonType="TextButton"
                                                            Visible="true" HeaderText="Type" SortExpression="CashTransferTypeDescription"
                                                            UniqueName="CashTransferTypeDescription">
                                                            <HeaderStyle HorizontalAlign="left" Width="70px" />
                                                            <ItemStyle HorizontalAlign="left" />
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridTemplateColumn DataField="Amount" HeaderButtonType="TextButton" HeaderText="Amount"
                                                            UniqueName="Amount" Visible="true">
                                                            <HeaderStyle HorizontalAlign="left" Width="60px" />
                                                            <ItemStyle HorizontalAlign="left" />
                                                            <ItemTemplate>
                                                                <asp:Label runat="server" ID="lblAmount" Text='<%# DataBinder.Eval(Container.DataItem, "Amount")%>'></asp:Label>
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridTemplateColumn DataField="TotalFee" HeaderButtonType="TextButton" HeaderText="Fee"
                                                            UniqueName="TotalFee" Visible="true">
                                                            <HeaderStyle HorizontalAlign="left" Width="50px" />
                                                            <ItemStyle HorizontalAlign="left" />
                                                            <ItemTemplate>
                                                                <asp:Label runat="server" ID="lblTotalFee" Text='<%# DataBinder.Eval(Container.DataItem, "TotalFee")%>'></asp:Label>
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridBoundColumn DataField="CurrencyCode" HeaderButtonType="TextButton" Visible="true"
                                                            HeaderText="Cur" SortExpression="CurrencyCode" UniqueName="CurrencyCode">
                                                            <HeaderStyle HorizontalAlign="left" Width="30px" />
                                                            <ItemStyle HorizontalAlign="left" />
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridTemplateColumn DataField="ValidationCode" HeaderButtonType="TextButton"
                                                            HeaderText="Exc" UniqueName="ValidationCode" Visible="true">
                                                            <HeaderStyle HorizontalAlign="left" Width="30px" />
                                                            <ItemStyle HorizontalAlign="left" />
                                                            <ItemTemplate>
                                                                <asp:Label runat="server" ID="lblExec" Text='<%# DataBinder.Eval(Container.DataItem, "ValidationCode")%>'></asp:Label>
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridTemplateColumn DataField="BeneficiaryIndicator" HeaderButtonType="TextButton"
                                                            HeaderText="Ben." UniqueName="BeneficiaryIndicator" Visible="true">
                                                            <HeaderStyle HorizontalAlign="left" Width="50px" />
                                                            <ItemStyle HorizontalAlign="left" />
                                                            <ItemTemplate>
                                                                <asp:Label runat="server" ID="lblBen" Text='<%# DataBinder.Eval(Container.DataItem, "BeneficiaryIndicator")%>'></asp:Label>
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridTemplateColumn DataField="AccountIRAAdvancedTax" HeaderButtonType="TextButton"
                                                            HeaderText="IRA" UniqueName="AccountIRAAdvancedTax" Visible="true">
                                                            <HeaderStyle HorizontalAlign="left" Width="30px" />
                                                            <ItemStyle HorizontalAlign="left" />
                                                            <ItemTemplate>
                                                                <asp:Label runat="server" ID="lblIRA" Text='<%# DataBinder.Eval(Container.DataItem, "AccountIRAAdvancedTax")%>'></asp:Label>
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridBoundColumn DataField="WorkFlowStateDescription" HeaderButtonType="TextButton"
                                                            HeaderText="Pending Status" SortExpression="WorkFlowStateDescription" UniqueName="WorkFlowStateDescription">
                                                            <HeaderStyle HorizontalAlign="Center" Width="150px" />
                                                            <ItemStyle HorizontalAlign="Right" />
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridTemplateColumn DataField="WorkFlowStateDescription" HeaderButtonType="TextButton" HeaderText="Pending Status"
                                                            UniqueName="WorkFlowStateDescription" SortExpression="WorkFlowStateDescription" Visible="false">
                                                            <HeaderStyle HorizontalAlign="left" Width="0px" />
                                                            <ItemStyle HorizontalAlign="left" />
                                                            <ItemTemplate>
                                                                <asp:Label runat="server" ID="lblWorkFlowStateDescription" Text='<%# DataBinder.Eval(Container.DataItem, "WorkFlowStateDescription")%>'></asp:Label>
                                                            </ItemTemplate>
                                                              
                                                            <EditItemTemplate>
                                                            <telerik:RadComboBox ID="cmbDemoteComments"  runat="server" EnableEmbeddedSkins="true" Skin="Vista">
                                                                        </telerik:RadComboBox>
                                                            <asp:ImageButton ID="ImgSaveDemote" ToolTip="Click here to Save" CommandName="SaveDemoteComment" ImageUrl="~/Img/savelong.gif"
                                                                    runat="server" />
                                                                <asp:ImageButton ID="ImgCancelDemote" ToolTip="Click here to Cancel"  CommandName="CancelDemoteComment"  ImageUrl="~/Img/cancellong.gif"
                                                                    runat="server" />
                                                            </EditItemTemplate>
                                                              
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridTemplateColumn DataField="Editable" HeaderButtonType="TextButton" HeaderText=""
                                                            UniqueName="Editable" Visible="false">
                                                            <HeaderStyle HorizontalAlign="left" Width="0px" />
                                                            <ItemStyle HorizontalAlign="left" />
                                                            <ItemTemplate>
                                                                <asp:Label runat="server" ID="lblEditable" Text='<%# DataBinder.Eval(Container.DataItem, "Editable")%>'></asp:Label>
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridTemplateColumn DataField="Demote" HeaderButtonType="TextButton" HeaderText=""
                                                            UniqueName="Demote" Visible="false">
                                                            <HeaderStyle HorizontalAlign="left" Width="0px" />
                                                            <ItemStyle HorizontalAlign="left" />
                                                            <ItemTemplate>
                                                                <asp:Label runat="server" ID="lblDemote" Text='<%# DataBinder.Eval(Container.DataItem, "Demote")%>'></asp:Label>
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridTemplateColumn DataField="Promote" HeaderButtonType="TextButton" HeaderText=""
                                                            UniqueName="Promote" Visible="false">
                                                            <HeaderStyle HorizontalAlign="left" Width="0px" />
                                                            <ItemStyle HorizontalAlign="left" />
                                                            <ItemTemplate>
                                                                <asp:Label runat="server" ID="lblPromote" Text='<%# DataBinder.Eval(Container.DataItem, "Promote")%>'></asp:Label>
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                         <telerik:GridTemplateColumn DataField="OverrideIndicator" HeaderButtonType="TextButton" HeaderText=""
                                                            UniqueName="OverrideIndicator" Visible="false">
                                                            <HeaderStyle HorizontalAlign="left" Width="0px" />
                                                            <ItemStyle HorizontalAlign="left" />
                                                            <ItemTemplate>
                                                                <asp:Label runat="server" ID="lblOverrideIndicator" Text='<%# DataBinder.Eval(Container.DataItem, "OverrideIndicator")%>'></asp:Label>
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridTemplateColumn DataField="Action" HeaderButtonType="TextButton" HeaderText="Action"
                                                            UniqueName="Action">
                                                            <HeaderStyle HorizontalAlign="Center" Width="90px" />
                                                            <ItemStyle HorizontalAlign="Center" />
                                                            <ItemTemplate>
                                                                <asp:ImageButton ID="ImgPromote" ToolTip="Click here to Promote" CommandName="Promote" ImageUrl="~/Img/CashDi7.gif"
                                                                    runat="server" />
                                                                <asp:ImageButton ID="ImgEdit" ToolTip="Click here to Edit"  ImageUrl="~/Img/CashDi2.gif"
                                                                    runat="server" />
                                                                <asp:ImageButton ID="ImgDemote" ToolTip="Click here to Demote" CommandName="Demote" ImageUrl="~/Img/CashDi8.gif"
                                                                    runat="server" />
                                                                    <asp:ImageButton ID="ImageOverride" ToolTip="Click here to Override"  CommandName="Override" ImageUrl="~/Img/Override.gif"
                                                                    runat="server" />
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                    </Columns>
                                                </MasterTableView>
                                                <ClientSettings AllowExpandCollapse="true">
                                                    <Scrolling AllowScroll="True" ScrollHeight="50px" UseStaticHeaders="true" />
                                                    <Selecting AllowRowSelect="false" />
                                                </ClientSettings>
                                                <FilterMenu NotSelectedImageUrl="~/Skins/GridSkin/Ice/NotSelectedMenu.gif" SelectedImageUrl="~/Skins/GridSkin/Ice/SelectedMenu.gif">
                                                    <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
                                                </FilterMenu>
                                            </telerik:RadGrid>


protected void rgAchCashTransfer_ItemCommand(object source, GridCommandEventArgs e)
        {
            if (e.CommandName.ToUpper(CultureInfo.InvariantCulture) == "Demote".ToUpper(CultureInfo.InvariantCulture))
            {
                GridColumn editedItem = (GridColumn)rgAchCashTransfer.MasterTableView.GetColumn("WorkFlowStateDescription");
                e.Item.Edit = true;
                  
                 
            }
        }
        protected void rgAchCashTransfer_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                GridDataItem dataItem = (GridDataItem)e.Item;
                ImageButton ImgEdit = dataItem.FindControl("ImgEdit") as ImageButton;
                ImageButton ImgPromote = dataItem.FindControl("ImgPromote") as ImageButton;
                ImageButton ImgDemote = dataItem.FindControl("ImgDemote") as ImageButton;
                ImageButton ImageOverride = dataItem.FindControl("ImageOverride") as ImageButton;
  
                Label lblEditable = dataItem.FindControl("lblEditable") as Label;
                Label lblDemote = dataItem.FindControl("lblDemote") as Label;
                Label lblPromote = dataItem.FindControl("lblPromote") as Label;
                Label lblAmount = dataItem.FindControl("lblAmount") as Label;
                Label lblTotalFee = dataItem.FindControl("lblTotalFee") as Label;
                Label lblCashTransferID = dataItem.FindControl("lblCashTransferID") as Label;
                Label lblAccount = dataItem.FindControl("lblAccount") as Label;
                Label lblExec = dataItem.FindControl("lblExec") as Label;
                Label lblBen = dataItem.FindControl("lblBen") as Label;
                Label lblIRA = dataItem.FindControl("lblIRA") as Label;
                Label lblOverrideIndicator = dataItem.FindControl("lblOverrideIndicator") as Label;
                decimal AmountValue = Convert.ToDecimal(lblAmount.Text);
                lblAmount.Text = FormatCurrency(AmountValue);
  
                decimal TotalFeeValue = Convert.ToDecimal(lblTotalFee.Text);
                lblTotalFee.Text = FormatCurrency(TotalFeeValue);
  
                if (lblIRA.Text.ToString().Equals(Constants.VALUE_1))
                    lblIRA.Text = Constants.YES;
                else
                    lblIRA.Text = Constants.NO;
  
                if (lblExec.Text.ToString().Equals(Constants.VALUE_1))
                    lblExec.Text = Constants.VIEW;
                else
                    lblExec.Text = "";
  
                ChangeForeColor(lblBen);
  
                if (lblPromote.Text.ToString().Equals(Constants.VALUE_1))
                    ImgPromote.Visible = true;
                else
                    ImgPromote.Visible = false;
                if (lblDemote.Text.ToString().Equals(Constants.VALUE_1))
                    ImgDemote.Visible = true;
                else
                    ImgDemote.Visible = false;
                if (lblEditable.Text.ToString().Equals(Constants.VALUE_1))
                    ImgEdit.Visible = true;
                else
                    ImgEdit.Visible = false;
                if (lblOverrideIndicator.Text.ToString().Equals(Constants.VALUE_1))
                    ImageOverride.Visible = true;
                else
                    ImageOverride.Visible = false;
  
  
  
            }
            else
            {
  
                if ((e.Item is GridEditableItem && ((GridEditableItem)e.Item).IsInEditMode))
                {
                   // e.Item.Edit = true;
  
                    GridEditableItem editedItem = (GridEditableItem)e.Item;
                    RadComboBox editor = (RadComboBox)editedItem.FindControl("cmbDemoteComments");
                      
                }
            }
        }
Princy
Top achievements
Rank 2
 answered on 28 Mar 2011
10 answers
150 views
I'm building a module for DNN Pro 5.6.1 using the built in Telerik (version 2010.1.309.35) controls.  The intention of the app is to filter a List(of T) using the radFilter control.  I have the mechanics worked out and everything is working as designed.  I'm building the list of filtered columns dynamically in the page_init method.

Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
    Try
        BindFilterAttributes()
    Catch ex As Exception
        ProcessModuleLoadException(Me, ex)
    End Try
End Sub
Private Sub BindFilterAttributes()
    For Each thisFieldEditor As RadFilterDataFieldEditor In Me.FieldEditors
        rflFilter.FieldEditors.Add(thisFieldEditor)
    Next
End Sub

With each click on the control, whether to add or remove filter conditions or to change the filter in any way the control gets progressively slower.  At first the control completes it's postback in less than one second.  After twenty clicks, the control takes about three seconds to return for each click.   

Has anyone else experienced this behavior?  Are there methods I could use to reduce the number of postbacks, reduce the amount of data going back and forth to the server, or in any other way improve the performance?
Tsvetina
Telerik team
 answered on 28 Mar 2011
1 answer
67 views
I have several admin pages with Radgrids utilizing popup editforms.  Everything was working fine.

I was sent a new set of css files and a new layout, and now the edit popups show, but are disabled along with the rest of the screen.  I am assuming it has something to do with the myriad of div tags being implemented, but since I have very limited experience with this kind of thing, I have no idea where to start figuring this out.  Any thoughts would be appreciated.
Shinu
Top achievements
Rank 2
 answered on 28 Mar 2011
1 answer
67 views
I see showNext which works, but I dont see a showPrev...?
Princy
Top achievements
Rank 2
 answered on 28 Mar 2011
1 answer
179 views
Hi All ,

I use the radcombobox and the event onkeypressing() ,when i type text on radcombobox i can't get the current text completely  ,
Ex:
i set Loadondemand=false ( i can't use this feature bcos everything must process on Client site)
i want to get the whole text , that user has typed.
And in this event i receive 2 parameters , sender  and eventArgs

but i don't know how to get completely the text , it always miss latest characters,

Pls help me .


Shinu
Top achievements
Rank 2
 answered on 28 Mar 2011
9 answers
434 views
Hi,

I'm working on a time sheet application that has a dropdownlist on the first column to select the charge code.  The requirements I have is that this column be read-only in edit mode to disallow the user to change the charge code.  I've seen some code examples online, but they don't completely solve the problem because sometimes the charge codes are inactivated for a user, so they will no longer show up on in the dropdownlist, which throws an error. 

Is there a way to switch this to readonly on the PreRender, or otherwise prevent the dropdownlist from databinding?

Thanks!
Jayesh Goyani
Top achievements
Rank 2
 answered on 28 Mar 2011
1 answer
107 views
how can i get the value in gridnumeric column
Shinu
Top achievements
Rank 2
 answered on 28 Mar 2011
4 answers
190 views
Hi,
In my RadPanelBar, the item text is wrapped if it's too long . The problem is when I hover the mouse over the item, only the first line changes color and this is confusing to user. Is it possible for both(or all) lines of text for that text to change color on mouse over ?

Thanks
Steele
Top achievements
Rank 1
 answered on 28 Mar 2011
1 answer
94 views
I have a RadGrid that is bound on the client-side. It contains a GridTemplateColumn with a label and a tooltip.
Because it's bound on the client i can only assume that I would need to dyanmically set the tooltip text there as well.  My issue is that I cannot get the handle of the tooltip in the OnRowDataBound event.  ...Possibly because it lies within the RadGrid.  Any ideas on how to accomplish this?

The GridTemplatecolumn:

 

<telerik:GridTemplateColumn DataField="dataf1" HeaderText="myheading1" UniqueName="dataf1">

 

 

<ItemTemplate>

 

 

<asp:Label ID="Label1" runat="server" Text='hover'>

 

 

</asp:Label>

 

 

<telerik:RadToolTip ID="RadToolTip1" runat="server" TargetControlID="Label1" Width="150px"

 

 

RelativeTo="Element" Position="MiddleRight" EnableShadow="true">

 

</telerik:RadToolTip>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 


handle to tooltip is null

 

 

 

 

function OnRowDataBound(sender, args)

 

 

{

 

 

 var tooltip = $find("RadToolTip1");
tooltip.set_text = "something new here";        //this is null!
}

Viz
Top achievements
Rank 1
 answered on 27 Mar 2011
1 answer
95 views
Hi,
I have some issues with the RadButton click event. I have an user control that has a ListView and RadButton. On the main page I set the radbutton clicke event in a declarative way by exposing the radbutton as a usercontrol property. when users click on a some other button on main page I am databinding the listview and adding a responsescript that i want to run after the ajax call. But when I click the radbutton on the usercontrol it doesnt work. But, when I take out the reponsescript it works fine. Please let me know if I am missing something.

Thanks in advance!!!
Mammu
Top achievements
Rank 1
 answered on 27 Mar 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?