Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
111 views
I have using a custom filter operation, so after ItemCommond function
if (e.CommandName == RadGrid.FilterCommandName)
I set e.Canceled = true
But I want the datetime filter have the right selected item at the dropdownlist(NoFilter, GreaterThan or so)
I try to change the FilterMenu in Init, but I set it to selected and no use.
part code is

<telerik:RadGrid ID="RGViewMEdia" Skin="someSkin" EnableEmbeddedSkins="false" 
            runat="server" CssClass="list_one" AutoGenerateColumns="False" AllowPaging="True" 
            GridLines="None" Width="800px" DataKeyNames="somefield" AllowAutomaticDeletes="True" 
            AllowSorting="True" ShowStatusBar="True" AllowFilteringByColumn="true" DefaultSortDirection="Descending" 
            DefaultSortExpression="somefield" BorderStyle="None" PageSize="10" AllowCustomPaging="true" OnInit="RGViewMEdia_Init" 
            OnItemCommand="RGViewMEdia_ItemCommand" OnNeedDataSource="RGViewMEdia_NeedDataSource" OnItemDataBound="RGViewMEdia_ItemDataBound" 
            OnSortCommand="RGViewMEdia_ItemSortCommand" OnPageIndexChanged="RGViewMEdia_PageChangeCommand"
 
...... 
...... 
 
<telerik:GridDateTimeColumn DataField="somedatefield" HeaderText="DateTime" ReadOnly="True" UniqueName="PublishDate" DataType="System.DateTime" 
                        SortExpression="somedatefield" DataFormatString="{0:dd.MM.yyyy}" ItemStyle-Width="80px" FilterListOptions="VaryByDataType" 
                        PickerType="DatePicker" FilterControlWidth="60px"/> 
 
...... 
some code behind is
protected void RGViewMEdia_ItemCommand(object sender, GridCommandEventArgs e) 
        { 
            if (e.CommandName == RadGrid.FilterCommandName) 
... 
                RGViewMEdia.CurrentPageIndex = 0; 
                RGViewMEdia.Rebind();                
                e.Canceled = true
 
protected void RGViewMEdia_Init(object sender, EventArgs e) 
        { 
            GridFilterMenu menu = RGViewMEdia.FilterMenu; 
            // Iterate through the items backwards 
            // so that the indexing is not thrown off 
            // when items are removed! 
            for (int i = menu.Items.Count - 1; i >= 0; i--) 
            { 
                if (menu.Items[i].Text.IndexOf("Null")>=0) 
                { 
                    menu.Items.RemoveAt(i); 
                } 
                else if (menu.Items[i].Text.IndexOf("EqualTo") >= 0 && menu.Items[i].Text.IndexOf("Than") < 0) 
                { 
                    menu.Items.RemoveAt(i); 
                } 
                                 
            } 
 
            if (Expression!=null&&Expression.PublicationDateOperate != DateOperate.NoFilter) 
            { 
                string operate; 
                switch (Expression.PublicationDateOperate) 
                { 
                    case DateOperate.GreaterThan: 
                        operate = "GreaterThan"
                        break
                    case DateOperate.GreaterThanOrEqualTo: 
                        operate = "GreaterThanOrEqualTo"
                        break
                    case DateOperate.LessThan: 
                        operate = "LessThan"
                        break
                    case DateOperate.LessThanOrEqualTo: 
                        operate = "LessThanOrEqualTo"
                        break
                    default
                        operate = "NoFilter"
                        break
                } 
                RadMenuItem item = menu.Items.FindItem(i => i.Text == operate); 
                if(item!=null
                    item.Selected = true
            } 
        } 


Radoslav
Telerik team
 answered on 04 Jun 2010
0 answers
85 views
Hi

I am executing the following code to retreive the relevant persistent class so I can pouplate the items in my RadComboBox..

However, no data seems to be pulled back.

Please can you point out where I am going wrong.

protected void cboContactDB_ItemDataBound(object sender, Telerik.Web.UI.RadComboBoxItemEventArgs e)  
        {  
            try  
            {  
                Heron.PersistentClasses.Entity loEntity = (Heron.PersistentClasses.Entity)e.Item.DataItem;  
                ((Label)e.Item.FindControl("lblID")).Text = loEntity.ENTSID;  
                ((Label)e.Item.FindControl("lblName")).Text = loEntity.ENTSName;  
            }  
            catch (Exception loException)  
            {  
                Heron.App_Code.L.Exception("ContactReminder.ascx.cs: Error! cboContactDB_ItemDataBound.", loException);  
            }  
        } 

Kind Regards

David
hkdave95
Top achievements
Rank 2
Iron
 asked on 04 Jun 2010
2 answers
298 views
Hi Telerik,

 I observed that there are two assemblies for the RadGrid usercontrol namely:

Telerik.Web.UI.dll
Telerik.WebControls.dll (RadGrid.Net2)

Why are there two dlls for the same usercontrol. Or are they different usercontrols with the same name. 

Please help me out on this.

Thanks in advance
Akhila
Akhilaa
Top achievements
Rank 1
 answered on 04 Jun 2010
2 answers
223 views
hi,
  I am using radtextbox to enter text. I need to show confirm box when user changed the value in the textbox. So i added onvaluechanging method like as fowllows:
            function ConfirmUpdate(sender, eventArgs) {  
                var oldvalue = eventArgs.get_oldValue()  
                if (confirm('Are you want to Continue? ') != true)  
                    eventArgs.set_newValue(oldvalue)   
            } 

This work correctly. But i need to add this function from the code behind because of 2 reasons
1. I use this textbox for insert and update functions. When update only need to ask the confirm.
               - i can handle this in script itself by comparing oldvalue and newvale
2. I need to pass myown message t the confrm box.
               - For this i want to add this event from the code behind.

How can i add this function to the textbox attribute?
How can i pass message without affect the eventArgs values?

Akhil Raj
Top achievements
Rank 1
 answered on 04 Jun 2010
0 answers
86 views
Hi There,

I would really like to create a menu (i think using the treeview control) like the one on this page:

http://demos.telerik.com/aspnet-ajax/treeview/examples/overview/defaultcs.aspx

It is the tree like menu that appears under the title "TreeView" on the left hand side, with the little triangles.

I am using SharePoint.

could you point me in the right direction

Shaun
shaun pitt
Top achievements
Rank 1
 asked on 04 Jun 2010
3 answers
198 views

Hello,

I am pretty much how to populate the asp:menu from xml directly. But my issue is to do everything from server side. I am using dom model in my dev and so I have to get the nodes from xml dynamically and populate into the Menu and create a flyout with 2 columns on hover of each menu item. Would be great if someone can provide with a custom code to achieve this.

Pls find the screenshot here: http://www.imgplace.com/viewimg80/1153/812col.jpg

smith spd
Top achievements
Rank 1
 answered on 04 Jun 2010
3 answers
340 views
Hi,
I would like to change the background color of my RadEditor. I've seen all of the posts where they say to use the code below and put the classes in the newly created css file. I've tried this and it doesn't work...it still picks up the background color of the parent page. Does anyone know a workaround for this?

Thanks

<telerik:RadEditor ID="RadEditor1" Runat="server">
   
<CssFiles>
       
<telerik:EditorCssFile Value="~/EditorContentArea.css" />
   
</CssFiles>
</
telerik:RadEditor>
Rob Venable
Top achievements
Rank 1
 answered on 03 Jun 2010
0 answers
134 views
Hey guys, i've been using your Telerik products for ASP.NET and AJAX development for the past two months about, and have enjoyed them very much. Usually i can solve my problems by reading extensively through the content on your site and forums, but as several hours have gone by i'm feeling a little helpless.

I have a three-tierd heirarchy grid. The first two tiers work perfectly, when expanding to the third, the grid closes back up to the first tier and never hits the DeatailTableDataBind event. I have tried this every way i can think of (programatically + declaritive) without success.

Here are my code snippets, any help is appreciated.
EDITED OUT
EDITED OUT


Once again, any help is appreciated.


EDIT --- I have found the source of my problem, i was using the pageload event to populate my grid instead of the needsdatasource event. This has fixed my problem, thanks to anyone who attempted to help!
Mitchell
Top achievements
Rank 1
 asked on 03 Jun 2010
2 answers
152 views
Hi,
In this example, instead of the label, if I have a dropdown list, how do I databind it?
http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/nestedviewtemplatedeclarativerelations/defaultcs.aspx

Here's my code:
<NestedViewSettings DataSourceID="odsContactDetails">  
 <ParentTableRelation> 
   <telerik:GridRelationFields DetailKeyField="CrmEntityId" MasterKeyField="CrmEntityId" /> 
  </ParentTableRelation> 
 </NestedViewSettings> 
<NestedViewTemplate> 
  <asp:Panel ID="pnlContactInfo" runat="server">  
  <asp:DropDownList ID="ddlPhones" runat="server"  DataTextField="Phone" DataValueField="Phone"/>  
  <asp:DropDownList ID="ddlEmails" runat="server" DataTextField="Email" DataValueField="Email"/>  
  </asp:Panel> 
</NestedViewTemplate> 
 
 
.....  
 
 
 <asp:ObjectDataSource ID="odsContactDetails" runat="server"   
  SelectMethod="GetContactInfo" TypeName="FVS.ControllerCRM.CRMDataControl">  
     <SelectParameters> 
        <asp:Parameter Name="crmEntityId" Type="String" /> 
        </SelectParameters> 
</asp:ObjectDataSource> 
 
 

I have got it to work, the data is returned by the datalayer, but it is not getting bound to the dropdownlist.
Thanks in advance!
saritha78
Top achievements
Rank 1
 answered on 03 Jun 2010
0 answers
97 views
I get the following error on a numeric text box once it gets focus after I disable the text box and then re-enable it and then of course click it to give it focus.
Once I click it I get this in firebug

uncaught exception: [Exception... "Not enough arguments [nsIDOMRange.collapse]" nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" location: "JS frame :: http://localhost/webber/admin/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d3.5.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a3bbfe379-348b-450d-86a7-bb22e53c1978%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2009.3.1314.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3a603d133a-f943-435d-a80d-57457cc55f4a%3a16e4e7cd%3af7645509%3a24ee1bba%3a1e771326%3aa7e79140%3a11a04f7e%3ae330518b%3a8e6f0d33%3a6a6d718d%3ae524c98b%3ac8618e41%3ae4f8f289%3ab7778d6c%3ae085fe68%3a58366029%3aed16cbdc%3aaa288e2d%3ac08e9f8a%3a1bb784d4%3a19620875%3a874f8ea2%3a33108d14%3abd8f85e4%3bAjaxControlToolkit%2c+Version%3d3.0.20229.20843%2c+Culture%3dneutral%2c+PublicKeyToken%3d28f01b0e84b6d53e%3aen-US%3a3b7d1b28-161f-426a-ab77-b345f2c428f5%3ab14bb7d5%3a13f47f54%3a3c55b13e%3adc2d6e36%3ade51bc8f%3a1d056c78%3aa3e10fa2%3a701e375f%3aa4313c7a :: anonymous :: line 18549" data: no] 

thanks
towpse
Top achievements
Rank 2
 asked on 03 Jun 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?