Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
152 views
I have XP Pro, SP3, Visual Studio 2008, SP1, IE 8, Current release of Telerik

When Child Items are initially displayed, as expected, all items are left aligned, having the same width.

When I roll the mouse over the top level parent:
- The width of both the parent and child menu items increase by about 9 pixels and overflows out of the containing
   "div" tag.

When I roll the mouse over a child menu item, its width expands another 9 pixes on the left giving the width of the child menu item being approximately 9 pixels larger than all other child menu items.

BTW, you have a very nice product. Just bought this a coupl of days ago.
  
Paul
Telerik team
 answered on 10 Sep 2009
1 answer
153 views
I have a Listbox on my page which I add RadListBoxitems to on page.load , however when I try read these items from a button.click event they disappear. I can add the items back on page.load but this wont solve the problem as the items the user selected are lost. I guess this is more of an ASP.NET issue but I am stumped as to how I should solve it (I enabled viewstate and presistclientchanges but with no luck).

aspx code:
 <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> 
        </telerik:RadScriptManager> 
        <telerik:RadListBox ID="RadListBox1" runat="server" Style="left: 0px; top: 0px" EnableViewState="true" 
            ButtonSettings-ShowTransferAll="False" CheckBoxes="True"> 
            <ButtonSettings ShowTransferAll="False" /> 
        </telerik:RadListBox> 
        <asp:Button ID="submitBtn" runat="server" Text="Submit" /> 

code behind:
  Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 
        If Not Page.IsPostBack Then 
            populateUserListing() 
 
        End If 
    End Sub 
 
    Protected Sub submitBtn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles submitBtn.Click 
          
        For i As Integer = 0 To RadListBox1.Items.Count - 1 
            If RadListBox1.Items(i).Checked Then 
                'do actions here 
            End If 
        Next 
          
  
    End Sub 
 
 
    Sub populateUserListing() 
  
        For i As Integer = 0 To item.Count - 1 
            Dim dummyListItem As New RadListBoxItem("xxx", "xxx") 
            RadListBox1.Items.Add(dummyListItem) 
  
        Next 
 
    End Sub 

Thanks



Genady Sergeev
Telerik team
 answered on 10 Sep 2009
1 answer
111 views
Hello,

I'm not sure if this question has been asked before, but anyway;

I have an ObjectDataSource that I want to bind to a Grid. The objects in the data source has one property that is a list, and I would like all of the items in that list to become their own columns. Lets pretend it looks like this:

public class Foo
{
   public int Id { get; set; }
   public string X { get; set; }
   public List<Bar> Bars { get; set; }
}

public class Bar
{
   public int Id { get; set; }
   public string Y { get; set; }
}

If my data source has a collection of Foo objects, can I make the grid show columns for the following values?
Foo.Id, Foo.X, Foo.Bars[0].Y, Foo.Bars[1].Y, ..., Foo.Bars[n].Y

Thanks a lot!
Tsvetoslav
Telerik team
 answered on 10 Sep 2009
5 answers
170 views
Okay,

What I'm trying to do is this ... I'm trying to create a radpanel dynamically depending on the data, but when the user hovers on the second level items, I'm trying to show some imagebuttons that allow the user to quickly perform operations on that item.

So, here's the panel before the user hovers:

Category A (open)
- Item 1
- Item 2
- Item 3
Category B (closed until clicked 'FullExpandItem')

When a user hovers over Item 1 - show this:

Category A (still open)
- Item 1        +  X
- Item 2
- Item 3
Category B (still closed)

An item template that I'll need is something like this:
<ItemTemplate> 
<div class="floatbox" onmouseout="onMouseOut(this)" onmouseover="onMouseOver(this)"> 
   <%# Eval("Text") %> 
   <asp:ImageButton ID="addImgBtn" runat="server" OnPreRender="addImgBtn_PreRender" title='<%# Eval("ID") %>' ImageUrl="~/Images/Add.png" style="display:none; visibility: hidden;" /> 
   <asp:ImageButton ID="openImgBtn" runat="server" OnPreRender="openImgBtn_PreRender" title='<%# Eval("ID") %>' ImageUrl="~/Images/Open.png" style="display:none; visibility: hidden;" /> 
</div> 
<ItemTemplate> 

the code for one of the image buttons does this: (right now, i'm just alerting what the ID is and the command, but I will be opening a radwindow to a page and set the ID=whatever in the querystring so I can dynamically show the data for that specific item.
Protected Sub addItemBtn_PreRender(ByVal sender As Object, ByVal e As EventArgs) 
        Dim addItemBtn As ImageButton = CType(sender, ImageButton) 
        If addItemBtn IsNot Nothing Then 
            addItemBtn.Attributes("onclick") = "alert('add: " & addItemBtn.Attributes("title") & "'); return false;" 
        End If 
    End Sub 

with the following javascript:
function onMouseOut(lblCtrl) { 
            if (lblCtrl !== null) { 
                if (lblCtrl.children.length > 2) { 
                    for (i = 1; i < lblCtrl.children.length; i++) 
                    { 
                        var imgCtrl = lblCtrl.children[i]; 
                        if (imgCtrl !== null) { 
                            imgCtrl.style.display = 'none'; 
                            imgCtrl.style.visibility = 'hidden'; 
                        } 
                    } 
                } 
            } 
        } 
        function onMouseOver(lblCtrl) { 
            if (lblCtrl !== null) { 
                if (lblCtrl.children.length > 2) { 
                    for (i = 1; i < lblCtrl.children.length; i++) 
                    { 
                        var imgCtrl = lblCtrl.children[i]; 
                        if (imgCtrl !== null) { 
                            imgCtrl.style.display = 'block'; 
                            imgCtrl.style.visibility = ''; 
                        } 
                    } 
                } 
            } 
        } 

Curious thing happens if I set that to the item template though - my items (the ones that have that inline hover menu) appear for every item (obviously, since there is no checking for which level (level = 1)) but that the regular databound items ALSO get put there.

What's a potentially correct way to go about this? I simply want to be able to specify what is in the second level items so I can put my inline hover menu there.

Help!
Kori
Yana
Telerik team
 answered on 10 Sep 2009
2 answers
119 views
I want to dynamic to create a RadListbox with javascript , just like follows:

//for example: 
var oListBox = CreateListBox(); 
body.append(oListBox); 


Or how can I dynamic to get the RadListBox id in client side ?

for example , I have 10 RadListBox controls in the page, and their id is "listbox1, listbox2,listbox3...." , I want to loop these RadListbox,   I cannot use $find() , because my RadListBox are in the masterpage(or usercontrol page) , how can I do that ?

thanks!
Winson qiu
Top achievements
Rank 1
 answered on 10 Sep 2009
4 answers
109 views
I was told that the rad controls came with all the cities for countries.

Paul
Telerik team
 answered on 10 Sep 2009
4 answers
200 views
Hi,

I'm using a RadGrid with advanced data binding, sorting and custom paging.
For the custom paging I dynamically build my query to the database (with Linq) so that only the results for the current page are retrieved.
But in order for the sorting to be correct when using paging the sorting has to be incorporated in the query as well (and before the paging). I also do this dynamically because the columns of the grid are created dynamically. So I read the lambda function to be used as an argument for the sorting from a data source.
So far everything is fine. But! As the column in question contains strings the grid knows how to order the page alphabetically on this column. And it does!, on top of the sorting I incorporated in the query...

For example, let's say I have a grid with only one column, containing first names. And let's say the only first names in the database are "Alice", "Bob" and "Claire" and that the page size of the grid is 2. I define the lambda function for ordering first names such that they are ordered by length rather than by alphabet (something like x => x.Length).
Now if I would let the grid be ordered in ascending order on the first names column I would like to have the following result:
1st page: Bob, Alice. 2nd page: Claire.
 However, the result is:
1st page: Alice, Bob. 2nd page: Claire.
It may not be immediately clear from this small example, but the result is that per page the records on it are exactly the records I want, but the order within the page is wrong due to unwanted extra automatic sorting, in this case in alphabetic order.

To be clear, I only use the NeedDataSource event and when creating the query for the data source I take care of the sorting and paging. I do not use the SortCommand event. I have tried this but I still couldn't get rid of the unwanted automatic sorting (this could very well be my inexpertice) and I started to have problems with my own implemented sorting to be one step behind. So when ASCending was requested you would get NONE, when DESCending was requested you get ASCending and when NONE was requested you get DESCending. This hase something to do with me reading from MasterTable.SortExpressions what sort is requested and using this information to dynamically get the right lambda function.

It would be really great if I could leave everything as I have it and only turn of the automatic sorting, without having to use the SortCommand event, because we have set up the project such that almost all code for using the grid is in seperate classes (such as a child class of RadGrid) so that a page using the grid only has to have minimal code (such as telling wich columns should be displayed, making the base query for the data source and define the lambda functions for sorting).
If it is unavoidable to use the SortCommand event please be very specific how this event and the NeedDataSource have to work together to avoid the sorting to be one step behind.
I rather have some extra code in the classes that take care of most things around the grid than any extra code in the pages using the grid because then I only have to write this code once instead of each time I use the grid on a page (which is going to happen a lot!).

Regards,

Mink
Mink
Top achievements
Rank 1
 answered on 10 Sep 2009
2 answers
112 views
I have a grid and use a popup edit form that I have created a template for.  On the edit event it will bind my fields just fine but now I am trying to add insert functionality as well. The problem is that I have a radio button list on the edit form that I set using the following:

<

 

asp:RadioButtonList ID="rbAnalyst" runat="server" RepeatDirection="Horizontal" SelectedValue='<%# Bind("ANALYST_IND")%>'>

 

 

<asp:ListItem Value="Y">Yes</asp:ListItem>

 

 

<asp:ListItem Value="N">No</asp:ListItem>

 

 

</asp:RadioButtonList>

 


I am not positive but I think it is trying to bind a non-breaking space... &nbsp;

Obviously adding a new record will not be able to bind a N or Y.  Can I capture the "InitInsert" on the ItemCommand event and set the value of the new grid row record to a default of say 'N' before the edit form binding occurs?  If so, how do I do this?
Robert
Top achievements
Rank 1
 answered on 10 Sep 2009
2 answers
134 views
Hello I am having a problem with my rad editor.  I need the content area to show up in white.  It seems to be picking up the background color from my page which is red.  I have tried several different settings but can't seem to get it to work right.

Thanks
Rumen
Telerik team
 answered on 10 Sep 2009
3 answers
178 views

 

Hello,

My goal is to have a list of thumbnail images, on "onMouseOver" event it will show the tooltip (working).
However, when the user click on the image (div) then display a larger/print size image. I've tried various things such as by adding the onclick event in the div tag with no success.
Please advise.

Thanks,
Quan



Here's the code snippet:

<
telerik:RadToolTipManager runat="server" ID="RadToolTipManager1" Width="700px"

 

 

Height="370px" RelativeTo="Element" Animation="Slide" Position="BottomCenter"

 

 

OnAjaxUpdate="OnAjaxUpdate"

 

 

HideEvent="LeaveTargetAndToolTip" AutoCloseDelay="15000" />

 

 

 

<asp:Repeater ID="Repeater1" runat="server" OnItemDataBound="Repeater1_ItemDataBound">

 

 

<ItemTemplate>

 

 

 

<div style="float: left; text-align: center;" id="smallImage" runat="server">

 

 

<div style="border: 1px solid #999999; margin: 5px; width: 100px; height: 100px; background-position: center; background-repeat: no-repeat; background-image: url('<%# Eval("Thumbnail", "../../../Images/Thumbs/{0}") %>');">

 

 

</div>

 

 

</div>

 

 

</ItemTemplate>

 

 

</asp:Repeater>

 

Svetlina Anati
Telerik team
 answered on 10 Sep 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?