Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
417 views
To whom it may concern;

I have the following RadGrid in my page.  If I want to hide the edit and delete column when data isMatched = true, how to implement it?

thank you in advance for your help.

Brendan

 

<telerik:RadGrid ID="CTADailyReConList" runat="server" GridLines="None" ShowStatusBar="true"

 

 

AllowAutomaticDeletes="True"

 

 

onupdatecommand="CTADailyReConList_UpdateCommand"

 

 

onitemdatabound="CTADailyReConList_ItemDataBound"

 

 

oninsertcommand="CTADailyReConList_InsertCommand"

 

 

onneeddatasource="CTADailyReConList_NeedDataSource"

 

 

ondeletecommand="CTADailyReConList_DeleteCommand" >

 

 

<ExportSettings>

 

 

<Excel Format="Html" />

 

 

</ExportSettings>

 

 

<MasterTableView AutoGenerateColumns="False" CommandItemDisplay="Top" DataKeyNames="CTADailyReCapID" >

 

 

<Columns>

 

 

<telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Edit" Text="Edit"

 

 

UniqueName="EditColumn">

 

 

<ItemStyle HorizontalAlign="Center" />

 

 

</telerik:GridButtonColumn>

 

 

<telerik:GridBoundColumn DataField="CTADailyReCapID" DataType="System.Int32" Visible = "false" ReadOnly="true" UniqueName="CTADailyReCapID">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="CTAImportFileID" DataType="System.Int32" Visible = "false" ReadOnly="true" UniqueName="CTAImportFileID">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="TradeDate" DataType="System.DateTime" DataFormatString="{0:dd/MM/yyyy}"

 

 

HeaderText="Trade Date" SortExpression="TradeDate" UniqueName="TradeDate">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridTemplateColumn DataField="AccountNumber"

 

 

HeaderText="AccountNumber" SortExpression="AccountNumber" UniqueName="AccountNumber">

 

 

<EditItemTemplate>

 

 

<asp:DropDownList ID="drpAccount" runat="server"></asp:DropDownList>

 

 

</EditItemTemplate>

 

 

<ItemTemplate>

 

 

<asp:Label runat="server" ID="lblAccountNumber" Text='<%# Eval("AccountNumber") %>'></asp:Label>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridBoundColumn DataField="BuySellCode" HeaderText="Buy/Sell"

 

 

SortExpression="BuySellCode" UniqueName="BuySellCode">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Quantity" DataType="System.Decimal"

 

 

HeaderText="Quantity" SortExpression="Quantity" UniqueName="Quantity">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="FCMInstrument" HeaderText="FCM Instrument" ReadOnly= "true"

 

 

SortExpression="FCMInstrument" UniqueName="FCMInstrument">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Price" DataType="System.Decimal"

 

 

HeaderText="Price" SortExpression="Price" UniqueName="Price">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="PromptYear" DataType="System.Int32"

 

 

HeaderText="Year" SortExpression="PromptYear" UniqueName="PromptYear">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="PromptMonth" DataType="System.Int32"

 

 

HeaderText="Month" SortExpression="PromptMonth" UniqueName="PromptMonth">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="PromptDay" DataType="System.Int32" Visible = "false" ReadOnly = "true"

 

 

HeaderText="PromptDay" SortExpression="PromptDay" UniqueName="PromptDay">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="ClearingBroker" DataType="System.Int32" Visible = "false" ReadOnly = "true"

 

 

HeaderText="ClearingBroker" SortExpression="ClearingBroker"

 

 

UniqueName="ClearingBroker">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="TransactionType" Visible = "false" ReadOnly = "true"

 

 

HeaderText="TransactionType" SortExpression="TransactionType"

 

 

UniqueName="TransactionType">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="TradeID" HeaderText="TradeID" Visible = "false"

 

 

SortExpression="TradeID" UniqueName="TradeID">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Exchange" HeaderText="Exchange" Visible = "false"

 

 

SortExpression="Exchange" UniqueName="Exchange">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="ExecutingBroker" Visible = "false"

 

 

HeaderText="ExecutingBroker" SortExpression="ExecutingBroker"

 

 

UniqueName="ExecutingBroker">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Instrument" HeaderText="Instrument"

 

 

SortExpression="Instrument" UniqueName="Instrument">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="PricingSystem" HeaderText="PricingSystem" Visible = "false" ReadOnly = "true"

 

 

SortExpression="PricingSystem" UniqueName="PricingSystem">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="TradeType" HeaderText="TradeType" Visible = "false" ReadOnly = "true"

 

 

SortExpression="TradeType" UniqueName="TradeType">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridCheckBoxColumn DataField="IsMatched" DataType="System.Boolean" ReadOnly = "true"

 

 

HeaderText="IsMatched" SortExpression="IsMatched" UniqueName="IsMatched">

 

 

</telerik:GridCheckBoxColumn>

 

 

<telerik:GridCheckBoxColumn DataField="OnHold" DataType="System.Boolean" Visible = "false" ReadOnly = "true"

 

 

HeaderText="OnHold" SortExpression="OnHold" UniqueName="OnHold">

 

 

</telerik:GridCheckBoxColumn>

 

 

<telerik:GridBoundColumn DataField="UpdateDate" DataType="System.DateTime" Visible = "false" ReadOnly = "true"

 

 

HeaderText="UpdateDate" SortExpression="UpdateDate" UniqueName="UpdateDate">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="UpdateUser" HeaderText="UpdateUser" Visible = "false" ReadOnly = "true"

 

 

SortExpression="UpdateUser" UniqueName="UpdateUser">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Comment" HeaderText="Comment"

 

 

SortExpression="Comment" UniqueName="Comment">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="CashAdjustment" DataType="System.Decimal" Visible = "false" ReadOnly = "true"

 

 

HeaderText="CashAdjustment" SortExpression="CashAdjustment"

 

 

UniqueName="CashAdjustment">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Adjustment300120" DataType="System.Decimal" Visible = "false" ReadOnly = "true"

 

 

HeaderText="Adjustment300120" SortExpression="Adjustment300120"

 

 

UniqueName="Adjustment300120">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Adjustment300120Cash" Visible = "false" ReadOnly = "true"

 

 

DataType="System.Decimal" HeaderText="Adjustment300120Cash"

 

 

SortExpression="Adjustment300120Cash" UniqueName="Adjustment300120Cash">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Market" HeaderText="Market" Visible = "false" ReadOnly = "true"

 

 

SortExpression="Market" UniqueName="Market">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="ContractCode" HeaderText="ContractCode" Visible = "false" ReadOnly = "true"

 

 

SortExpression="ContractCode" UniqueName="ContractCode">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="TimeStamp" DataType="System.DateTime" Visible = "false" ReadOnly = "true"

 

 

HeaderText="TimeStamp" SortExpression="TimeStamp" UniqueName="TimeStamp">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="CurrencyCode" HeaderText="CurrencyCode" Visible = "false" ReadOnly = "true"

 

 

SortExpression="CurrencyCode" UniqueName="CurrencyCode">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="SettlementDate" DataType="System.DateTime" Visible = "false" ReadOnly = "true"

 

 

HeaderText="SettlementDate" SortExpression="SettlementDate"

 

 

UniqueName="SettlementDate">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="EffectiveDate" DataType="System.DateTime" Visible = "false" ReadOnly = "true"

 

 

HeaderText="EffectiveDate" SortExpression="EffectiveDate"

 

 

UniqueName="EffectiveDate">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Commission" DataType="System.Decimal" Visible = "false" ReadOnly = "true"

 

 

HeaderText="Commission" SortExpression="Commission" UniqueName="Commission">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="CounterParty" HeaderText="CounterParty" Visible = "false" ReadOnly = "true"

 

 

SortExpression="CounterParty" UniqueName="CounterParty">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="FullPointValue" DataType="System.Decimal" Visible = "false" ReadOnly = "true"

 

 

HeaderText="FullPointValue" SortExpression="FullPointValue"

 

 

UniqueName="FullPointValue">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="InstrumentCode" HeaderText="InstrumentCode" Visible = "false" ReadOnly = "true"

 

 

SortExpression="InstrumentCode" UniqueName="InstrumentCode">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridButtonColumn ConfirmText="Delete this trade?" ConfirmDialogType="RadWindow"

 

 

ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"

 

 

UniqueName="DeleteColumn">

 

 

<ItemStyle HorizontalAlign="Center" />

 

 

</telerik:GridButtonColumn>

 

 

</Columns>

 

 

<EditFormSettings ColumnNumber="3" CaptionFormatString="Edit details" >

 

 

<FormTableItemStyle Wrap="False"></FormTableItemStyle>

 

 

<FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle>

 

 

<FormMainTableStyle GridLines="None" CellSpacing="0" CellPadding="3" Width="100%" />

 

 

<FormTableStyle GridLines="Horizontal" CellSpacing="0" CellPadding="2" CssClass="module" Height="110px" Width="100%" />

 

 

<FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>

 

 

<FormStyle Width="100%" BackColor="#eef2ea"></FormStyle>

 

 

<EditColumn UpdateText="Update record" UniqueName="EditCommandColumn1" CancelText="Cancel edit">

 

 

</EditColumn>

 

 

<FormTableButtonRowStyle HorizontalAlign="Left" CssClass="EditFormButtonRow"></FormTableButtonRowStyle>

 

 

</EditFormSettings>

 

 

</MasterTableView>

 

 

</telerik:RadGrid>

 

Daniel
Telerik team
 answered on 11 Mar 2010
2 answers
171 views
Hello,

I'm trying to build a RadTreeView control programmatically (as part of a CompositeControl). I'm getting the ICallbackEventHandler error when I try to expand the node (ServerSideCallBack mode).

I first tried this on an ASPX page and it's working fine. When I migrated the code to the CompositeControl, I was no longer able to set the ExpandMode property at the TreeView level, only at the node level.

ScriptManager is registered. I implemented ICallbackEventHandler and  INamingContainer (which wasn't necessary in the ASPX version).

I'm not sure what else to do.

Here's what my code looks like. Has anyone else tried creating RadTreeView programmatically?

        protected override void CreateChildControls() 
        { 
            Controls.Clear(); 
 
            try 
            { 
                    if (!Page.IsPostBack) 
                    { 
                        m_Tree = new RadTreeView(); 
                        m_Tree.NodeExpand += new RadTreeViewEventHandler(m_Tree_NodeExpand); 
 
                        foreach (MyDataItem mdi in SomethingThatReturnsItems) 
                        { 
                                RadTreeNode node = CreateNode(mdi); 
 
                                if (node != null
                                    m_Tree.Nodes.Add(node); 
                        } 
 
                        Controls.Add(m_Tree); 
            } 
            catch (Exception ex) 
            { 
                Log.LogEvent("Error building tree.", ex); 
            } 
 
            base.CreateChildControls(); 
        } 
 
 
        void m_Tree_NodeExpand(object sender, RadTreeNodeEventArgs e) 
        { 
            foreach (MyDataItem mdi in SomethingThatReturnsChildItems) 
            { 
                RadTreeNode node = CreateNode(mdi); 
 
                if (node != null
                    e.Node.Nodes.Add(node); 
            } 
 
            e.Node.Expanded = true
        } 
 
        private RadTreeNode CreateNode(MyDataItem kf) 
        { 
            try 
            { 
                RadTreeNode node = new RadTreeNode(); 
                node.Text = kf.HomePage.CmsPage.Title; 
                node.Value = kf.ID.ToString(); 
                node.NavigateUrl = kf.HomePage.DefaultUrl; 
                node.ExpandedImageUrl = EXPANDED_FOLDER; 
                node.ImageUrl = CLOSED_FOLDER; 
 
                if (kf.HasChildren) 
                    node.ExpandMode = TreeNodeExpandMode.ServerSideCallBack; 
 
                return node; 
            } 
            catch (Exception ex) 
            { 
                Log.LogEvent("Error building tree node.", ex); 
                return null
            } 
        } 
 


Jeff
Top achievements
Rank 1
 answered on 11 Mar 2010
1 answer
85 views
     Currently I am using the RadEditor ASP.NET AJAX 2010 Q1 version. I have a RadEditor and the business is dictating that they would like to have indents like on some product pages (example)

CPU                                 2.3GHz
RAM                                 4G
Hard Disk                         60GB

     Which the table functionality does. The problem is when you have to have bullet points or numbered lists within one of the columns, the spacing looks funky because when it puts the <ul> or <ol> tag in, it creates an indent. I have found a way around this by manually removing the <ul> or <ol> tag and I get a lined up version of a bullet or number list. Is there a control on the tool bar which will insert a non-indented version of either list?
     If the answer is no, then is there a way to detect whether the cursor is within a table and they click one of the list buttons to remove either the <ul> or <ol> that is being created? I just need the text to line up properly so if there is another way, please let me know, thanks!
robertw102
Top achievements
Rank 1
 answered on 11 Mar 2010
7 answers
337 views
Hi there,

I am trying to integrate a ContextMenu with a RadListView. However, unlike RadGrid, RadListView does not have the event OnRowContextMenu. The question is then, how do I know which item was the ContextMenu meant to work on?

Cheers,
Alvin
Steven Amani
Top achievements
Rank 1
 answered on 11 Mar 2010
1 answer
139 views
Every once in a while I loose the intellisense associtated with Telerik controls.  This seems to only happen in the .ascx page but only in the source view and not the designer view.  I tried looking for a telerik xsd in C:\Program Files\Microsoft Visual Studio 9.0\Common7\Packages\schemas\xml but didnt see anything that looked like it was from telerik. 

Its weird, everything will be working fine then all of a sudden no telerik options in the intellisense selection.  But I do have the Telerik Assembly registration at the top of the page:
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 and also have
<add assembly="Telerik.Web.UI, Version=2009.3.1314.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4"  /> 
 in the web.config.

Any ideas as to why intellisence might not show up even though i continue to get normal html and asp.net controls to show up?

J
J
Top achievements
Rank 1
 answered on 11 Mar 2010
7 answers
434 views

Hi,

I try to follow RadMenu Template Demo http://demos.telerik.com/aspnet-ajax/menu/examples/functionality/templates/defaultcs.aspx
example.  But instead of using RadMenu, I use RadContextMenu.  The problem I have is I can't get the TextBox control Text in the template.  If I change it back to RadMenu, I am able to see the TextBox control Text.  Can anyone tell me what's the wrong of my code?  or if anyway to get around.  Any suggestion is appreciated.

Here is my code snippet

// Click the image button  to show context menu  
 
<asp:ImageButton ID="ibAdvanced" runat="server" ImageUrl="~/images/icons/16/View.gif" OnClientClick ="showMenu(event)" ImageAlign="AbsMiddle" ToolTip="Advanced Search" />   
 
// Rad Context Menu I defined here with Item Template  
<telerik:RadContextMenu runat="server" ID="rcmSearchMenu" Skin="Vista">    
   <Items>   
      <telerik:RadMenuItem Text="Advanced" CssClass="advSearch" PostBack="false">   
         <ItemTemplate>   
            <asp:ListBox id="lbField" Rows="1" Width="100px" SelectionMode="Single" runat="server">   
               <asp:ListItem> A </asp:ListItem>   
               <asp:ListItem> B </asp:ListItem>   
               <asp:ListItem> C </asp:ListItem>   
            </asp:ListBox>    
            <asp:ListBox id="lbOperator" Rows="1" Width="100px" SelectionMode="Single" runat="server">   
               <asp:ListItem> Greater </asp:ListItem>   
               <asp:ListItem> Less </asp:ListItem>   
            </asp:ListBox>   
            <asp:RequiredFieldValidator ID="rfvAdvSearch" runat="server" ControlToValidate="tbAdvSearch" ValidationGroup="vgAdvSearch" Text="empty*" />   
            <asp:TextBox ID="tbAdvSearch" runat="server" EnableViewState="true" />  
            <asp:LinkButton ID="lkbAdvSearch" runat="server" CssClass="advSearch-button" OnClick="lkbAdvSearch_Click" OnClientClick="searchclick()" ValidationGroup="vgAdvSearch" ToolTip="Click to Search" EnableViewState="true" />   
            <asp:ImageButton ID="ibCancel" runat="server" ImageUrl="~/images/icons/16/Cancel.gif" OnClientClick="hideMenu(event)" ImageAlign="AbsMiddle" ToolTip="Cancel" />   
         </ItemTemplate>   
      </telerik:RadMenuItem>   
   </Items>   
</telerik:RadContextMenu>   
   
 
// the event when user click the Link Button control in template  
 
protected void lkbAdvSearch_Click(object sender, EventArgs e)   
{  
   TextBox AdvSearchTextBox = (TextBox)((LinkButton)sender).NamingContainer.FindControl("tbAdvSearch");   
   ListBox fieldListBox = (ListBox)((LinkButton)sender).NamingContainer.FindControl("lbField");   
   ListBox operatorListBox = (ListBox)((LinkButton)sender).NamingContainer.FindControl("lbOperator");  
 
   // No comiplation, no runtime error  
   // But I am not getting the Text value I enter in Textbox, Also, I am not getting value of ListBox Item I selected either  


Help , please

Thanks

 

kevin yang
Top achievements
Rank 1
 answered on 11 Mar 2010
10 answers
423 views
Hi,

I'd like to get the name of the column who is the column in my filter expression. I persist the filter expression and want to set the filter expression and the selected filter function back, if the user comes back to the page. How can I achieve this?

Regards,
Adi
adi
Top achievements
Rank 1
 answered on 11 Mar 2010
1 answer
113 views
Hi

Maybe having a related title to my post might elicit a response. :-)

I have a master page, which a RadMenu, to which I would like to add a RadRotator.

I am using a custom skin for the menu, so I have EnableEmbeddedBaseStyleSheet set to false.

But when I add the rotator to the master page, it loads the base css for the menu, which then overrides my custom skin.

If I comment out the RadRotator, the menu css works fine.

With the RadRotator in place, even if it has EnableEmbeddedBaseStylesheet="false", the webresource with the base css for the menu gets loaded and trashes the menu.

Does anyone have any ideas? Or is it not possible to use a rotator on a master page with the menu without the css conflicting?
Peter
Telerik team
 answered on 11 Mar 2010
1 answer
130 views
I have 3 custom attributes for the scheduler control. but among them 2 attributes are ID which I can't display to Advance insert form of the scheduler. But 3rd one is the attribute which need to be inputted by user. If I set EnableCustomAttributeEditing = true then all are visible on the screen. So How can I hide 2 attributes and show 1 attribute on the Advance insert form of the scheduler. I don't want to use custom Insert Template cause it is not fit in my requirement in the terms of recurrence.

I am using asp.net ajax scheduler control [Not WPF or Silverlight scheduler]
Genady Sergeev
Telerik team
 answered on 11 Mar 2010
1 answer
123 views
Hi,

I made an application having tabstrip. When i run the application from visual studio every thing is working fine. But after publishing the application into my IIS virtual directory, for the tab strip, the  css and images are not coming.

This problem is occuring in all browsers except mozilla.
The aspx page code is as below.

<

 

telerik:RadTabStrip ID="RadTabStrip1" runat="server" Skin="WebBlue" MultiPageID="RadMultiPage1"

 

 

SelectedIndex="0" Align="Justify" ReorderTabsOnSelect="true" Width="950px" CausesValidation="False">

 

 

<Tabs>

 

 

<telerik:RadTab ImageUrl="images/user.jpg" Text="P">

 

 

</telerik:RadTab>

 

 

<telerik:RadTab ImageUrl="images/user.jpg" Text="C">

 

 

</telerik:RadTab>

 

 

</Tabs>

 

 

</telerik:RadTabStrip>

 

<

 

telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0" CssClass="pageView">

 

 

<telerik:RadPageView ID="RadPageView1" runat="server" Width="100%">

 

 

////content............
</

 

telerik:RadPageView>

 

 

<telerik:RadPageView ID="RadPageView2" runat="server">

 

 

////content............
</
telerik:RadPageView>

 

 

</telerik:RadMultiPage>

 

 

 

Can any one help me please why this is occuring.

I have attached the images for IE8 and firefox, for how it looks in the browser.


Many Thanks,
Sai

Peter
Telerik team
 answered on 11 Mar 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?