Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
248 views
Hi -

My goal is to have a selection of one ComboBox populate a Selection in another ComboBox. 
Example... Box 1 selection is Food, Box 2 selection would then have a collection of Food Items like cheese, bread or soda. 

Here is my code:

        RadPanelItem ProjectSearchItem = (RadPanelItem)RadPanelBar1.FindItemByValue("ProjectSearch");  
 
        RadComboBox projectGroupRadComboBox = (RadComboBox)ProjectSearchItem.FindControl("projectGroupRadComboBox");  
        IQueryable allProjectGroup = ProjectGroup.GetAllBindings();  
        projectGroupRadComboBox.DataSource = allProjectGroup;  
        projectGroupRadComboBox.DataValueField = "ID";  
        projectGroupRadComboBox.DataTextField = "Name";  
        projectGroupRadComboBox.DataBind();  
        projectGroupRadComboBox.Filter = RadComboBoxFilter.Contains;  
 
        if (projectGroupRadComboBox.SelectedValue != null && projectGroupRadComboBox.SelectedValue.Length > 0)  
        {  
          projectGroup = ProjectGroup.Get(Convert.ToInt32(projectGroupRadComboBox.SelectedValue));  
          RadComboBox projectNameRadComboBox = (RadComboBox)ProjectSearchItem.FindControl("projectNameRadComboBox");  
          IQueryable allProjectName = Project.GetAllBindings(projectGroup.DataModel.ID);  
          projectNameRadComboBox.DataSource = allProjectName;  
          projectNameRadComboBox.DataValueField = "ID";  
          projectNameRadComboBox.DataTextField = "Name";  
          projectNameRadComboBox.DataBind();  
          projectNameRadComboBox.Filter = RadComboBoxFilter.Contains;  
        }  
        else 
        {  
          RadComboBox projectNameRadComboBox = (RadComboBox)ProjectSearchItem.FindControl("projectNameRadComboBox");  
          IQueryable allProjectName = Project.GetAllBindings(null);  
          projectNameRadComboBox.DataSource = allProjectName;  
          projectNameRadComboBox.DataValueField = "ID";  
          projectNameRadComboBox.DataTextField = "Name";  
          projectNameRadComboBox.DataBind();  
          projectNameRadComboBox.Filter = RadComboBoxFilter.Contains;  
        } 

The if statement and next line contain my problem.

I am used to using .SelectedValue with DDLs to select the Value, but with ComboBoxes it is not working.  What do I use in place of .SelectedValue, or is it more complicated than that?  I have read other posts pertaining to this and don't know which direction to take.

Thanks!!
wen
Simon
Telerik team
 answered on 26 Jan 2010
1 answer
168 views
I'm using Visual Studio 2005 with the latest Telerik RadGrid component. We have disabled the AutoPostBack on the filter field and used JavaScript to intercept and stop the filter call made by the filter menu click. However we can find no way to then have a button on the page that then simulates the same call. Our attempts just won't work because the postback loses the filter details and when interrogating the grid filter values in the code-behind the select filter item is 'No Filter'.

Scenario:
1. Enter various filter values in columns and select the filter type from menu.
2. Click button that's posts back this detail and allows us to construct SQL to query on all column values.

We have tried a variety of options none of which seems to work (in VS2005 at least), can anyone point us in the right direction? Preferably with a detailed code example? You're help would be greatly appreciated!

CS. 
Tsvetoslav
Telerik team
 answered on 26 Jan 2010
1 answer
104 views

Hi,

I am working on an application generator and I need to code generic "browse" pages that automatically populate a grid with all instances of a given type. Everything in my application is object driven so I use an ObjectDataSource.

Problem : I need to bind some columns to property types that are not on the bindable type list... When the type is not bindable I just need to display the result of the ToSTring() method.

How can I do that ??

Thanks in advance,
Laurent.
Vlad
Telerik team
 answered on 26 Jan 2010
1 answer
85 views
http://demos.telerik.com/aspnet-ajax/splitter/examples/sp_tabview/defaultcs.aspx

We don't appear to have control of the text size nor the text fore color inside the Splitter Tabs. Is it because it's formatted inside of a skin? Can we access the text formatting options for the Splitter Tabs elsewhere?

We've tried many seemingly logical methods, all to no avail.

Thanks for any help you can offer because the text is too small for our particular application.

Svetlina Anati
Telerik team
 answered on 26 Jan 2010
1 answer
129 views
Hi,

I have a custom control type that implements ITemplate and is added to a GridTemplateColumn. I have added an event handler to the literal control that is part of the custom control.
        public void InstantiateIn(System.Web.UI.Control container) 
        { 
            System.Web.UI.LiteralControl c = new System.Web.UI.LiteralControl(); 
            c.DataBinding += new EventHandler(Button_DataBinding); 
 


The first time the page loads, the event handler gets called. However, on Postback the event handler is not called.

Any ideas?

Thanks,
Dewang
Dewang Shah
Top achievements
Rank 1
 answered on 26 Jan 2010
1 answer
121 views
Does anyone have an example of a detailsview or RadGrid that opens a RadWindow from a command button?

Simon
Fiko
Telerik team
 answered on 26 Jan 2010
1 answer
88 views
Hi.
Friends, I can't make sequential loader for My project. I use ascx controls at the project and I need to install them in sequence.

For Example
http://i308.photobucket.com/albums/kk324/EmooTy/ascx.jpg?t=1264004649

-------- My Procect's Codes --------
-Default.aspx-
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="my_project._Default" %> 
<%@ Register src="menu.ascx" tagname="menu" tagprefix="uc1" %> 
<%@ Register src="flash.ascx" tagname="flash" tagprefix="uc2" %> 
<%@ Register src="alt_1.ascx" tagname="alt_1" tagprefix="uc3" %> 
 
<html> 
<body> 
<table > 
        <tr> 
            <td> 
                <uc1:menu ID="menu1" runat="server" /> 
            </td> 
             <td> 
                 <asp:PlaceHolder ID="Ph_flash" runat="server"> 
                 </asp:PlaceHolder> 
            </td> 
            <td > 
                <asp:PlaceHolder ID="Ph_alt1" runat="server"> 
                 </asp:PlaceHolder> 
           </td> 
        </tr> 
    </table> 
</body> 
</html> 
-Default.aspx.Cs -  
 public void yuklendi_flash() 
        { 
            Control flash_ascx = Page.LoadControl("flash.ascx"); 
            Ph_flash.Controls.Add(flash_ascx); 
            ////Panel1.Controls.Add(flash_ascx); 
        } 
 
        


-Menu.ascx-
<script type="text/javascript" language="javascript" > 
window.onload=<%=flash_yukle()%>; 
</script> 
-Menu.ascx.CS-
  _Default _default = new _Default(); 
 
        public string flash_yukle() 
        { 
            _default.yuklendi_flash(); 
            return ""; 
        } 






I did it but it didn't run.

Error : http://i308.photobucket.com/albums/kk324/EmooTy/error.gif?t=1264034869

How Can I do ?
Does Telerik  have a feature or Is there a another method ?

My Project's Link: http://hotfile.com/dl/25093592/f357e5f/my_project.rar.html

Note: I'm learning English at the moment. So My English isn't very good.
And I don't know JavaScricpt.

Please. You help me.
Emre Kurt
Top achievements
Rank 1
 answered on 26 Jan 2010
1 answer
132 views
The setup we have is this: we have a DockZone filled with collapsed docks that the user drags out to one of three main dockZones on the page.  When the dock is dropped into the new zone we are firing the DockPositionChanged event. This event flushes out the dock with all of the controls that it needs and loads the usercontrol into the dock. What we are seeing is whenever any event is triggered, the usercontrol inside the dock does an asynpostback or the expandCollapse event is fired so to is the DockPositionChanged event. Also we would really want the master list per say of docks to be repopulated with a fresh copy of the dock that was just dragged out and placed into one of the three zones.

CODE:
This is the master page that has the RadDockLayout
<asp:UpdatePanel ID="upl_Content" runat="server" UpdateMode="Conditional" > 
   <ContentTemplate> 
      <telerik:RadDockLayout ID="RadDockLayout_Content" runat="server" onloaddocklayout="LoadDockLayout" onsavedocklayout="SaveDockLayout">   
         <asp:ContentPlaceHolder ID="ContentPlaceHolderContent" runat="server"></asp:ContentPlaceHolder> 
      </telerik:RadDockLayout>  
   </ContentTemplate>   
<Triggers> 
</Triggers> 
</asp:UpdatePanel> 

Next we build the dockzone with all the available docks
protected void Page_Init(object sender, EventArgs e) 
{ 
    GetWidgets(); 
} 
 
        private void GetWidgets() 
        // POPULATE WIDGET SELECTION ZONE 
        { 
            if (WidgetList.Controls.Count == 0) 
            { 
                ArrayList _wigetArray = new ArrayList(); 
                _wigetArray.Add("~/Prototype/Modules/CriticalPrinters/CriticalPrinters.ascx"); 
                _wigetArray.Add("~/Prototype/Modules/CriticalPrinters/CriticalPrinters.ascx"); 
                _wigetArray.Add("~/Prototype/Modules/SMIncidentAge/Services/SMIncidentAge.ascx"); 
                _wigetArray.Add("~/Prototype/Modules/Weather/WeatherControl.ascx"); 
 
                int i = 0; 
                foreach (String widgetURL in _wigetArray) 
                { 
                    NCSBlackRadDock dock = new NCSBlackRadDock(); 
                    dock.widgetIcon.ImageUrl = "~/Prototype/Modules/HttpWebRequest/Images/Config.png"; 
                    dock.WidgetTitle.Text = string.Format("RadDock{0}", i); 
                    dock.Tag = widgetURL; 
                    dock.ID = string.Format("RadDock{0}", i); 
                    dock.UniqueName = Guid.NewGuid().ToString(); 
                    dock.Text = dock.ID.ToString(); 
                    dock.statusPanel.Visible = false; 
                    dock.widgetPanel.Visible = false; 
                    dock.EnableViewState = false; 
                    dock.Commands.Remove(dock.CloseCommand); 
                    dock.Commands.Remove(dock.ExpandCommand); 
                    dock.Commands.Remove(dock.SettingsCommand); 
 
 
                    dock.DockPositionChanged += new DockPositionChangedEventHandler(RadDock_DockPositionChanged); 
                    dock.AutoPostBack = true; 
                    dock.Collapsed = true; 
 
                    WidgetList.Controls.Add(dock); 
                    i++; 
                } 
            } 
        } 

Then finally the RadDock_DockPositionChanged
        protected void RadDock_DockPositionChanged(object sender, DockPositionChangedEventArgs e) 
        { 
             
            Site1 pm = (Site1)Page.Master.Master; 
            NCSBlackRadDock dock = (NCSBlackRadDock)sender; 
 
            if (dock.DockZoneID != e.DockZoneID) 
            { 
                try 
                { 
                    dock.DockZoneID = e.DockZoneID; 
                    dock.Collapsed = false; 
                    dock.statusPanel.Visible = true; 
                    dock.widgetPanel.Visible = true; 
                    DockCloseCommand _CloseCommand = new DockCloseCommand(); 
                    DockExpandCollapseCommand _ExpandCommand = new DockExpandCollapseCommand(); 
                    dock.Commands.Add(_CloseCommand); 
                    dock.Commands.Add(_ExpandCommand); 
                    dock.Commands.Remove(dock.PreviewCommand); 
 
 
                    LoadWidget(dock); 
                    pm.CreateSaveStateTrigger(dock);  //save the dock state every time a dock is moved/altered. 
 
                } 
                catch { } 
            } 
        } 

Pero
Telerik team
 answered on 26 Jan 2010
3 answers
109 views
We've found when we use the image manager to add an image into the content placeholder in the middle of other text, the image is always inserted at the top of the HTML, and you have to drag it down manually to the correct place.  Is this standard behaviour - is there any way to get the images to insert at the cursor position rather than right at the top?
Stanimir
Telerik team
 answered on 26 Jan 2010
1 answer
112 views
Hi,

In FF and IE there is a major difference when double clicking on an image.

Please refer to the attached preview screenshots. I prefer the FF way.

BR,
Marc
Fiko
Telerik team
 answered on 26 Jan 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?