Telerik Forums
UI for ASP.NET AJAX Forum
13 answers
216 views
hi all,
i have a grid, which the EditFormType is set to WebUserControl. On edit i need a combobox that contains a treeview, so i followed this example http://demos.telerik.com/aspnet-ajax/treeview/examples/functionality/treeviewcombobox/defaultcs.aspx?product=treeview

the problem is that when i select a node from the combobox it doesn't respond at the first time, i need to re-select a node again
here is my code
<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="Edit.ascx.vb" Inherits="UCMS.LinksEdit" %>  
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>  
 
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">  
    <script type="text/javascript">  
        function OpenFileExplorerDialog()  
        {  
            var wnd = $find("<%= ExplorerWindow.ClientID %>");  
            wnd.show();  
        }  
 
        //This function is called from the Explorer.aspx page  
        function OnFileSelected(wnd, fileSelected)  
        {  
            var textbox = $get("<%= fileName.ClientID %>");  
            textbox.value = fileSelected;  
        }     
          
        function nodeClicking(sender, args)  
        {  
            var comboBox = $find("<%= RadComboBox1.ClientID %>");  
 
            var node = args.get_node()  
 
            comboBox.set_text(node.get_text());  
 
            comboBox.trackChanges();  
            comboBox.get_items().getItem(0).set_value(node.get_text());  
            comboBox.commitChanges();  
 
            comboBox.hideDropDown();  
        }  
 
        function StopPropagation(e)  
        {  
            if(!e)  
            {  
                e = window.event;  
            }  
 
            e.cancelBubble = true;  
        }  
          
        function OnClientDropDownOpenedHandler(sender, eventArgs)  
        {  
            var tree = sender.get_items().getItem(0).findControl("RadTreeView1");  
            var selectedNode = tree.get_selectedNode();  
            if (selectedNode)  
            {  
                selectedNode.scrollIntoView();  
            }  
        }  
    </script>  
</telerik:RadScriptBlock>  
 
<telerik:RadWindow runat="server" Width="550px" Height="560px" VisibleStatusbar="false" 
    NavigateUrl="/Components/Links/Explorer.aspx" ID="ExplorerWindow" Modal="true" Behaviors="Close,Move">  
</telerik:RadWindow>  
 
<telerik:RadFormDecorator ID="FormDecorator1" runat="server" DecoratedControls="all" Skin="Default"></telerik:RadFormDecorator>  
 
<br />  
<table cellpadding="3" cellspacing="0" border="0" width="100%">  
    <tr>  
        <td width="12%">Title:</td>  
        <td width="88%">  
            <telerik:RadTextBox ID="txtTitle" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.title") %>'></telerik:RadTextBox>  
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="txtTitle" ErrorMessage="*" runat="server" Display="Dynamic"></asp:RequiredFieldValidator>  
            <asp:CustomValidator ID="CustomValidator1" runat="server" ErrorMessage="This title is already used" ControlToValidate="txtTitle" Display="Dynamic" OnServerValidate="checkTitle"></asp:CustomValidator>          
        </td>  
    </tr>  
    <tr>  
        <td>Link to:</td>  
        <td>  
            <telerik:RadComboBox ID="RadComboBox2" runat="server" MarkFirstMatch="true" AutoPostBack="true">  
                <Items>  
                    <telerik:RadComboBoxItem Text="Select type" Value="0" />  
                    <telerik:RadComboBoxItem Text="Page on the website" Value="1" />  
                    <telerik:RadComboBoxItem Text="File on the website" Value="2" />  
                    <telerik:RadComboBoxItem Text="External URL" Value="3" />  
                </Items>  
            </telerik:RadComboBox>  
            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" ControlToValidate="RadComboBox2" ErrorMessage="*" runat="server" Display="Dynamic" InitialValue="Select type"></asp:RequiredFieldValidator>  
        </td>  
    </tr>  
    <tr id="trPages" runat="server" visible="true">  
        <td>Destination:</td>  
        <td>  
            <div>  
                <telerik:RadComboBox ID="RadComboBox1" runat="server" Height="140px" Width="215px" 
                    ShowToggleImage="True" Style="vertical-align: middle;" OnClientDropDownOpened="OnClientDropDownOpenedHandler" 
                    EmptyMessage="Choose a destination" ExpandAnimation-Type="None" CollapseAnimation-Type="None">  
                    <ItemTemplate>  
                        <div id="div1">  
                            <telerik:RadTreeView runat="server" ID="RadTreeView1" OnClientNodeClicking="nodeClicking" Height="138px" Width="212px">  
                                <Nodes>  
                                    <telerik:RadTreeNode runat="server" Text="Africa" Expanded="true">  
                                        <Nodes>  
                                            <telerik:RadTreeNode runat="server" Text="Egypt">  
                                                <Nodes>  
                                                    <telerik:RadTreeNode runat="server" Text="Cairo">  
                                                    </telerik:RadTreeNode>  
                                                </Nodes>  
                                            </telerik:RadTreeNode>  
                                            <telerik:RadTreeNode runat="server" Text="South Africa">  
                                                <Nodes>  
                                                    <telerik:RadTreeNode runat="server" Text="Cape Town">  
                                                    </telerik:RadTreeNode>  
                                                </Nodes>  
                                            </telerik:RadTreeNode>  
                                            <telerik:RadTreeNode runat="server" Text="Kenya">  
                                                <Nodes>  
                                                    <telerik:RadTreeNode runat="server" Text="Nairobi" Value="1999">  
                                                    </telerik:RadTreeNode>  
                                                </Nodes>  
                                            </telerik:RadTreeNode>  
                                        </Nodes>  
                                    </telerik:RadTreeNode>  
                                    <telerik:RadTreeNode runat="server" Text="North America" Expanded="true">  
                                        <Nodes>  
                                            <telerik:RadTreeNode runat="server" Text="USA">  
                                                <Nodes>  
                                                    <telerik:RadTreeNode runat="server" Text="New York">  
                                                    </telerik:RadTreeNode>  
                                                    <telerik:RadTreeNode runat="server" Text="Los Angeles">  
                                                    </telerik:RadTreeNode>  
                                                    <telerik:RadTreeNode runat="server" Text="Boston">  
                                                    </telerik:RadTreeNode>  
                                                </Nodes>  
                                            </telerik:RadTreeNode>  
                                            <telerik:RadTreeNode runat="server" Text="Canada">  
                                                <Nodes>  
                                                    <telerik:RadTreeNode runat="server" Text="Toronto">  
                                                    </telerik:RadTreeNode>  
                                                    <telerik:RadTreeNode runat="server" Text="Ottawa">  
                                                    </telerik:RadTreeNode>  
                                                    <telerik:RadTreeNode runat="server" Text="Vancouver">  
                                                    </telerik:RadTreeNode>  
                                                </Nodes>  
                                            </telerik:RadTreeNode>  
                                            <telerik:RadTreeNode runat="server" Text="Mexico">  
                                                <Nodes>  
                                                    <telerik:RadTreeNode runat="server" Text="Mexico City">  
                                                    </telerik:RadTreeNode>  
                                                    <telerik:RadTreeNode runat="server" Text="Cancun">  
                                                    </telerik:RadTreeNode>  
                                                </Nodes>  
                                            </telerik:RadTreeNode>  
                                        </Nodes>  
                                    </telerik:RadTreeNode>  
                                </Nodes>  
                            </telerik:RadTreeView>  
                        </div>  
                    </ItemTemplate>  
                    <Items>  
                        <telerik:RadComboBoxItem Text="" />  
                    </Items>  
                </telerik:RadComboBox>  
 
                <script type="text/javascript">  
                    var div1 = document.getElementById("div1");  
                    div1.onclick = StopPropagation;  
                </script>  
 
                <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator3" ErrorMessage="Choose a destination first" ControlToValidate="RadComboBox1" />  
            </div>  
        </td>  
    </tr>  
    <tr id="trFiles" runat="server" visible="false">  
        <td></td>  
        <td>  
            <asp:TextBox ID="fileName" runat="server" Width="350px"></asp:TextBox>  
            <asp:Button ID="selectFile" OnClientClick="OpenFileExplorerDialog(); return false;" Text="Browse" runat="server" />  
        </td>  
    </tr>  
    <tr id="trURL" runat="server" visible="false">  
        <td></td>  
        <td>  
            <telerik:RadTextBox ID="txtURL" runat="server" Width="350px" Text="http://"></telerik:RadTextBox>  
        </td>  
    </tr>          
    <tr>  
        <td>Start Date:</td>  
        <td>  
            <telerik:RadDatePicker ID="RadDatePicker1" runat="server" ></telerik:RadDatePicker>  
            <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="RadDatePicker1" ErrorMessage="Date can't be earlier than today" Operator="GreaterThanEqual" Type="Date" ValueToCompare='<%# DateTime.Now.ToShortDateString() %>' Display="Dynamic"></asp:CompareValidator>  
        </td>  
    </tr>  
    <tr>  
        <td>End Date:</td>  
        <td>  
            <telerik:RadDatePicker ID="RadDatePicker2" runat="server"></telerik:RadDatePicker>  
            <asp:CompareValidator ID="CompareValidator2" runat="server" ControlToValidate="RadDatePicker2" ErrorMessage="End date can't be earlier than today or earlier than start date" Operator="GreaterThanEqual" Type="Date" ValueToCompare='<%# DateTime.Now.ToShortDateString() %>' ControlToCompare="RadDatePicker1" Display="Dynamic"></asp:CompareValidator>  
        </td>  
    </tr>  
    <tr>  
        <td>Publish:</td>  
        <td>  
            <asp:CheckBox ID="CheckBox1" runat="server"  />  
        </td>  
    </tr>  
    <tr>  
        <td>Category:</td>  
        <td>  
            <telerik:RadComboBox ID="RadComboBox3" runat="server" MarkFirstMatch="true" OnLoad="RadComboBox3_Load" DataTextField="categoryName" DataValueField="categoryID" SelectedValue='<%# DataBinder.Eval(Container, "DataItem.categoryID") %>' AppendDataBoundItems="true"></telerik:RadComboBox>  
            <asp:RequiredFieldValidator ID="RequiredFieldValidator6" ControlToValidate="RadComboBox3" ErrorMessage="*" runat="server" Display="Dynamic" InitialValue="Select category"></asp:RequiredFieldValidator>  
        </td>  
    </tr>  
    <tr>  
        <td align="right" colspan="2">  
            <asp:ImageButton ID="btnUpdate" runat="server" CommandName="Update" Visible='<%# Not (TypeOf DataItem Is Telerik.Web.UI.GridInsertionObject) %>' ImageUrl="/Themes/images/Update.gif" />  
            <asp:ImageButton ID="btnInsert" runat="server" CommandName="PerformInsert" Visible='<%# (TypeOf DataItem Is Telerik.Web.UI.GridInsertionObject) %>' ImageUrl="/Themes/images/Update.gif" />  
            <asp:ImageButton ID="btnCancel" runat="server" CommandName="Cancel" CausesValidation="false" ImageUrl="/Themes/images/Cancel.gif" />  
        </td>  
    </tr>                              
</table> 

wht would be causing it??
any hint is really appreciated
Veronica
Telerik team
 answered on 11 Oct 2010
1 answer
144 views
I've read many posts here and elsewhere on this topic, that discuss the shenannigans people have to go through to get templates to properly render on the destination side based on whatever thing they are doing with their source RadListBox, but something I have not been able to discern, is whether or not there is any instance where a simple databound list box with no fancy components embedded in the templates can still be implemented without a postback (just client-side).

For example, given this very simple example below where I have the two RadListBoxes hooked up and I want them to show the same format in both boxes :

<telerik:RadListBox runat="server" ID="RadListBoxSource" Height="200px" Width="200px"
    AllowTransfer="True" TransferToID="RadListBoxDestination" DataSourceID="SqlDataSource1"
    DataValueField="USR_SEQ" DataTextField="USR_LOGINID"
    SelectionMode="Multiple">
     
    <ItemTemplate>
        <div class="ld1">
            <%# DataBinder.Eval(Container.DataItem, "USR_LOGINID")%></div>
        <div class="ld2">
            <%# DataBinder.Eval(Container.DataItem, "USR_NAME")%></div>
    </ItemTemplate>
    
</telerik:RadListBox>
 
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:MyConnectionString %>"
    SelectCommand="SELECT [USR_LOGINID], [USR_SEQ], (USR_NAME_FIRST + ' ' + USR_NAME_LAST) USR_NAME FROM [USR] order by usr_loginid">
</asp:SqlDataSource>
 
<telerik:RadListBox runat="server" ID="RadListBoxDestination" Height="200px" Width="200px">
 
    <ItemTemplate>
        <div class="ld1">
            <%# DataBinder.Eval(Container.DataItem, "USR_LOGINID")%></div>
        <div class="ld2">
            <%# DataBinder.Eval(Container.DataItem, "USR_NAME")%></div>
    </ItemTemplate>
 
</telerik:RadListBox>

What am I missing to get this to work?  Does there absolutely have to be a postback to just get the second listbox to use the same template format as the first list box?  Does the fact that it is a databound list force my hand?  For what it is worth, I also downloaded a number of examples posted by Telerik developers and even with the post-back versions, could not get my simple example to work correctly, but I assume that is because I am missing some painfully obvious clue.



Genady Sergeev
Telerik team
 answered on 11 Oct 2010
3 answers
40 views
HI,

 We encountered this problem when we upgraded to IE8 on two of our three computers. The other computer has IE7 and Firefox, and it's fine with both. 

- Click the Insert Table icon, which expands to a pull-down selection. The botton third of the pull-down is 3 rows of 4 table manipulation icons. With IE7 and Firefox, all 12 icons are active. With IE8, the first 10 icons are greyed out; only Set Cell Properties and Set Table Properties are active.

Bottom Line: We can't manipulate tables on our web pages.
 
we are woking with radeditor 2007  for ASP.net 1.0


please help!!!!!

thanks
tintu

Rumen
Telerik team
 answered on 11 Oct 2010
12 answers
250 views
Hi all,

I have a problem with filtering by GridMaskedColumn.
This is my code:
<telerik:GridMaskedColumn DataField="Customer.PhoneNumbers" DataType="System.String"
                Mask="(###) ###-####" HeaderText="Phone Number" SortExpression="Customer.PhoneNumbers"
                UniqueName="CustomerPhone">
                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="15%" />
                <ItemStyle HorizontalAlign="Left" VerticalAlign="Top" Width="15%" />
            </telerik:GridMaskedColumn>

The problem is:
- If I enter first three numbers in the filter field - it is filtered fine (see the screenshot ok.jpg)
- but if I enter more then three numbers or whole phone number - the filter does not work at all (see the screenshot fail1.jpg and fail2.jpg)

Any suggestions, please.
Martin
Telerik team
 answered on 11 Oct 2010
3 answers
90 views
Hello.

I've got RadGridView with ObjectDataSource and bind IList<Domains> to grid. Try use automatic dataSource operations. I need init some field of new(updated) entity, which are not displayed at popup from(I use popup for add\update entities). But I can't interrupt save\update operations and get my entity for changing. At OnInsertCommand e.Item.DataItem is null, so how can i resolve my issue?

Thanks.
Mira
Telerik team
 answered on 11 Oct 2010
1 answer
44 views
Hello
We use the Editor in a Wiki Site inside MOSS 2007
When I insert a link with a target _top in the HTML, and switch back to normal, the target is gone

The only target that remain is the _blank

Could you please help on that
Thank you
Yasser
Rumen
Telerik team
 answered on 11 Oct 2010
1 answer
96 views
Hi,

I have a grid with autogenerate columns set to true.

In ItemDataBound I add an image to a cell.

protected

 

 

void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)

 

{

 

 

if (this.reportProvider.HtmParams.ImageColumns.IsConfigColumn("TargetMet"))

 

{

 

 

if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem)

 

{

 

 

if (e.Item.DataItem != null)

 

{

 

 

DataRowView row = (DataRowView)e.Item.DataItem;

 

 

 

string sImg = ImageColumnHandler.GetImage(ImageColumnHandler.KPI_TARGET, System.Convert.ToDouble(row["TargetMet"]));

 

 

 

Image img = new Image();

 

img.ImageUrl =

 

this.Request.ApplicationPath + "/Images/" + sImg;

 

 

 

GridDataItem item = (GridDataItem)e.Item;

 

 

 

TableCell cell = item["TargetMet"];

 

cell.Controls.Clear();

cell.Controls.Add(img);

}

}

}

 

 

}

 

 

 

 

 

 

In Html it looks just wonderfull.
Pdf export fails to display the image. It just shows the value from the datasource.

How can I add images in codebehind to a RadGrid with autogenerate columns set to true in a way it is safe for pdf export?

Daniel
Telerik team
 answered on 11 Oct 2010
1 answer
65 views
I can't seem to get a transparent background for my Radeditor.

I'm dynamically adding the radeditor to a raddock, that is in a radzone.

Here's a project that demonstrates the problem (the actual code is buried deep in my application).

http://www.kensblog.com/uploads/16765/demoproject.zip

-Ken Williams

PS Urgent!!!!
Rumen
Telerik team
 answered on 11 Oct 2010
5 answers
126 views
Hi,

I want to navigate through a recordset, record by record, and show record data by a web form, that contains whatever data controls, like text box, check box, ..etc. I need a kind of asp.net control like record navigators, that contains move next, move previous, move last, etc..
if anybody suggest a third parity tool, please send their info.

Thanks
Kiara
Top achievements
Rank 1
 answered on 11 Oct 2010
1 answer
60 views
In my radgrid i am freezing the first 3 columns, which works fine when it comes to IE7 but when i open the same page in IE8 the columns go out of sync.
is this a know problem or am i doing something wrong in a way where i have to add some style for it to work in IE8.
i refered to the below link
http://www.telerik.com/community/forums/aspnet-ajax/grid/radgrid-column-headers-out-of-sync-ie8.aspx
which suggested me to add compatibility tag to my pag, but if i do this it is affecting the other styles which i have defined in the page.
let me know if you guys know of any workaround for this.
thanks...
Dimo
Telerik team
 answered on 11 Oct 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?