Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
157 views
Hello,

I have a need to adjust the scroll height on the client-side.  I was wondering if this was an option?  I couldn't figure out which client-side object was responsible.  This is because some times the results are only a few, and I'd like to adjust the height.  I'd also like to adjust whether scrolling was enabled.

How do you do this on the client, if directly available?

Thanks.
Princy
Top achievements
Rank 2
 answered on 23 Mar 2009
1 answer
209 views
Hi,

I have a treeview that shows folders and documents. For each folder I have the number of child folders and child documents (one level down). How can I loop through the tree and calculate the total number of sub-folders and documents for each node?

For example, this is what I have:

Root (folders: 2, docs: 0)
        Folder 1 (folders: 2, docs: 1)
                Folder 2 (folders: 0, docs: 0)
                Folder 3 (folders: 0, docs: 1)
                        Document1.txt
                Document2.txt
        Folder 4 (folders: 0, docs: 2)
                Document2.txt
                Document3.txt

And this is what I need:

Root (folders: 4, docs: 4)
        Folder 1 (folders: 2, docs: 2)
                Folder 2 (folders: 0, docs: 0)
                Folder 3 (folders: 0, docs: 1)
        Folder 4 (folders: 0, docs: 2)

Thank you,
Julia
Atanas Korchev
Telerik team
 answered on 23 Mar 2009
1 answer
118 views
I am trying to capture all the paging events through the OnItemCommand Event. Currently, I can successfully read the following:

1. Next Page: CommandName = "Page", CommandArgument = "Next"
2. Next Pages: CommandName = "Page", CommandArgument = [Page #]
2. Last Page: CommandName = "Page", CommandArgument = "Last"
3. Specific Page: CommandName = Page", CommandArgument = [Page #]

I cannot capture the Previous pages. They all seem to have an empty CommandName and CommandArgument. How do I capture the Previous Page, Previous Pages, and First Pages events?

Version 311
Yavor
Telerik team
 answered on 23 Mar 2009
3 answers
103 views

I found the following code on this site but it is never making it into the if statement in red below. I need to set the ConnectionString property on the Types combo box but e.Item.IsInEditMode never returns true for any of the rows. Help!


protected void ConfigurationGrid_ItemDataBound(object sender,
GridItemEventArgs e)

{

if ((e.Item is GridEditFormItem) && (e.Item.IsInEditMode))

{

GridEditableItem edititem = (GridEditableItem)e.Item;

TypeComboBox cmb = CommonUtils.FindControlRecursive<TypeComboBox>(edititem, "Types");

cmb.ConnectionString = Globals.Current.ConnectionString;

}

}

<

 

telerik:RadGrid ID="ConfigurationGrid" runat="server" AllowPaging="True" GridLines="None"

 

 

 

 

 

Skin="Sunset" OnNeedDataSource="ConfigurationGrid_NeedDataSource"

 

 

 

 

 

EnableViewState="false" AllowCustomPaging="True" AutoGenerateColumns="False"

 

 

 

 

 

AllowAutomaticInserts="True" AllowAutomaticUpdates="True" AllowAutomaticDeletes="True"

 

 

 

 

 

OnItemDataBound="ConfigurationGrid_ItemDataBound"

 

 

onitemcommand="ConfigurationGrid_ItemCommand"

 

 

onitemcreated="ConfigurationGrid_ItemCreated">

 

 

 

 

 

<HeaderContextMenu>

 

 

 

 

 

<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>

 

 

 

 

 

</HeaderContextMenu>

 

 

 

 

 

<MasterTableView EditMode="EditForms" DataKeyNames="ConfigGuid">

 

 

 

 

 

<RowIndicatorColumn>

 

 

 

 

 

<HeaderStyle Width="20px"></HeaderStyle>

 

 

 

 

 

</RowIndicatorColumn>

 

 

 

 

 

<ExpandCollapseColumn>

 

 

 

 

 

<HeaderStyle Width="20px"></HeaderStyle>

 

 

 

 

 

</ExpandCollapseColumn>

 

 

 

 

 

<Columns>

 

 

 

 

 

<telerik:GridEditCommandColumn />

 

 

 

 

 

<telerik:GridClientDeleteColumn />

 

 

 

 

 

<telerik:GridBoundColumn DataField="TypeName" HeaderText="Type" ItemStyle-Wrap="false" />

 

 

 

 

 

<telerik:GridBoundColumn DataField="RegionName" HeaderText="Region" ItemStyle-Wrap="false" />

 

 

 

 

 

<telerik:GridBoundColumn DataField="EnvironmentName" HeaderText="Environment" ItemStyle-Wrap="false" />

 

 

 

 

 

<telerik:GridBoundColumn DataField="ProjectName" HeaderText="Project" ItemStyle-Wrap="false" />

 

 

 

 

 

<telerik:GridHyperLinkColumn DataTextField="Name" DataNavigateUrlFields="ConfigGuid"

 

 

 

 

 

DataNavigateUrlFormatString="~/edit.aspx?ConfigGuid={0}" Target="_blank" HeaderText="Name"

 

 

 

 

 

ItemStyle-Wrap="false" />

 

 

 

 

 

<telerik:GridBoundColumn DataField="Name" HeaderText="Name" ItemStyle-Wrap="false" />

 

 

 

 

 

<telerik:GridBoundColumn DataField="ConfigGuid" HeaderText="Configuration Guid" ItemStyle-Wrap="false" />

 

 

 

 

 

</Columns>

 

 

 

 

 

 

 

 

<

EditFormSettings EditFormType="Template">

<FormTemplate>

<table cellspacing="2" cellpadding="1" width="100%" border="0" rules="none" class="EditForm">

<tr>

<td valign="top">

Type:

</td>

<td>

<SiteInfo:TypeComboBox ID="Types" runat="server" />

<asp:TextBox ID="Type" runat="server" Text='<%# Bind("TypeName") %>' TabIndex="2"

TextMode="MultiLine" Rows="4" Width="600px" MaxLength="255" />

</td>

</tr>
</table>

 

 </FormTemplate>

 

 

 

</EditFormSettings>

 

 

 

</MasterTableView>

 

 

 

<PagerStyle AlwaysVisible="True" Mode="NextPrevNumericAndAdvanced" />

 

 

 

<ClientSettings EnableRowHoverStyle="true">

 

 

 

<Selecting AllowRowSelect="True" />

 

 

 

</ClientSettings>

 

Iana Tsolova
Telerik team
 answered on 23 Mar 2009
1 answer
72 views
Hi,

I have a grid configured like this:

<telerik:RadGrid ID="grdQueryGrid" runat="server" AllowMultiRowSelection="false" 
             EnableEmbeddedSkins="false" OnNeedDataSource="grdQueryGrid_NeedDataSource" Skin="NICE"              
             OnColumnCreated = "grdQueryGrid_ColumnCreated"
              Height="382" 
              Width="520"
              AllowSorting="True" AutoGenerateColumns="false">
              <MasterTableView HierarchyLoadMode="Client" Width = "804" TableLayout="Fixed" >                
                   <NestedViewTemplate>
                        <npx:QueryGridNestedView ID="QueryGridNestedView1" runat="server"/>
                    </NestedViewTemplate>                    
                    <Columns>                                            
                        <telerik:GridBoundColumn DataField="FullName" HeaderText ="<%$ Resources: RESX_FullName%>" >
                            <HeaderStyle Width = "100" HorizontalAlign="Center"/>
                            <ItemStyle Width = "100" HorizontalAlign="Center"/>                            
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="StartTime" HeaderText ="<%$ Resources: RESX_StartTime%>" >
                            <HeaderStyle Width = "140" HorizontalAlign="Center"/>
                            <ItemStyle Width = "140" HorizontalAlign="Center"/>                            
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="StopTime" HeaderText  ="<%$ Resources:RESX_StopTime%>" >
                            <HeaderStyle Width = "140" HorizontalAlign="Center"/>
                            <ItemStyle Width = "140" HorizontalAlign="Center"/>                            
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="DialedNumber" HeaderText ="<%$ Resources: RESX_DialedNumber%>" >
                            <HeaderStyle Width = "100" HorizontalAlign="Center"/>
                            <ItemStyle Width = "100" HorizontalAlign="Center"/>                            
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="CallDirection" HeaderText ="<%$ Resources:RESX_CallDirection%>" >
                            <HeaderStyle Width = "100" HorizontalAlign="Center"/>
                            <ItemStyle Width = "100" HorizontalAlign="Center"/>                            
                        </telerik:GridBoundColumn>                        
                        <telerik:GridBoundColumn DataField="CallID" Display="false" >                            
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="InitiatorUserID" Display="false">                            
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Flag" Display="false">                            
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="StartTimeTicks" Display="false">                                                   
                        </telerik:GridBoundColumn>                        
                    </Columns>                        
                </MasterTableView>                
                <ClientSettings>
                    <Selecting AllowRowSelect="true" />
                    <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                    <ClientEvents OnRowDblClick="PlayInteraction"
                         OnHierarchyExpanded ="OnHierarchyExpanding" 
                         OnGridCreating="GridCreating"  
                         OnRowSelected="queryGrid_RowSelected"
                         OnRowDeselected="queryGrid_RowDeselected" 
                        />
                    <Resizing AllowColumnResize="true" />
                </ClientSettings>
            </telerik:RadGrid>


The items and headers are centered when the grid is loaded. How ever when the columns are resized, the header remains centered but the item remain in the same location. 

How can this be solved?

Thanks,
Eyal D.
Georgi Krustev
Telerik team
 answered on 23 Mar 2009
1 answer
127 views
I am trying to determine how best to store off a key that goes with each series item.  I guess  I'm looking for a way to tag each series item so that when a user select it, I can get this Id so I can pass to another page.  I'd like to get this from RadGrid1_Click event.    I am currently using the XValue2 property and that seems to work because I'm just showing Pie or Bar charts only,  I doubt that is what I should be doing.  We are not using databinding and I am building the series by hand. 

Just a background on why I need this.  We are displaying a bar chart that shows a list of Items and their value.  When the user clicks one of the items, I need to go to our DB and retrieve more details.  Everything in our DB is keyed by a unique Id. 

I didn't see this covered in the documentation but I'm sure it's possible.

Thanks
Dessy
Telerik team
 answered on 23 Mar 2009
3 answers
159 views
Is it possible to use Tooltip control in an usercontrol? If so, can you please post a sample?
Thanks in advance.
NALDRO
Top achievements
Rank 1
 answered on 23 Mar 2009
1 answer
70 views

I am working on a proj. where I have to get dynamic data. It basically checks for Alerts.

We use polling technology on the server so I set up a static timer in code behind that checkes for the dynamic data every 30sec.

If there are alerts it changes the css of a button to a diffrent button image and displays the alert count.
Simple enough...
Here is the issue:
We have a master page where our navigations live. The Alert button is one of them

our child pages have Ajaxmanagers, and since they inherit from the masterpage I thought I can list the Alert button as part of the updated controls, that way whenever users use one of the ajax controls my Alert button also gets updated. But thats not the case nothing happens.

Therfore:
I tried writting a javascript function that lives on the masterpage, and from code behind I called the javascript function with the response.write() method.

function ChangeAlertButton(styleName, Count){
$find(alertManagerButton.ClientID).className = styleName;
$find(alertManagerButton.ClientID).innerHtml= Count;

or ...

document.getelementbyid(alertManagerButton.ClientID).className = styleName;
document.getelementbyid(alertManagerButton.ClientID).innerHtml= Count;


or...

I even hardcoded the client ID my self but I got an error saying getelementbyid returned null.

}

 

asp

 

:Panel ID="appletAlertManager" runat="server" ToolTip="View and acknowledge AutoMove alerts">

 

 

 

 

 

 

 

<asp:HyperLink runat="server" ID="alertManagerButton" class="alerts button" href="AlertManager.aspx">Alerts &nbsp<asp:Label ID="AlertCount" runat="server"></asp:Label></asp:HyperLink></asp:Panel>

None of this methods worked.

I tried putting another ajaxManager on the master page, I got an error that said I can't have two instances of an ajaxmanager.

That maybe because it doesn't like one in the master and one in child.

Is there a work around.

As I was typing this I figured I try the asp updatepanel and timer and it worked for the most part however as soon as i am on a page that the Alert button refers to the Button disapears, but is fine on all other pages.


    protected void Timer1_Tick(object sender, EventArgs e)
    {
        Label1.Text = "UpdatePanel1 refreshed at: " +
          DateTime.Now.ToLongTimeString();
    }

<div>
            <asp:Timer ID="Timer1" OnTick="Timer1_Tick" runat="server" Interval="10000">
            </asp:Timer>
        </div>
        <asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server">
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
            </Triggers>
            <ContentTemplate>
                <asp:Label ID="Label1" runat="server" Text="UpdatePanel1 not refreshed yet."></asp:Label>
            </ContentTemplate>
        </asp:UpdatePanel>

But still I can't figure out why adding a control that is in the master page as an updated control on a child page doesn't work.

Please explain.

Thank you!

 

 

Iana Tsolova
Telerik team
 answered on 23 Mar 2009
10 answers
154 views
I am using an Upload / RadProgressArea / RadProgressmanager setup, when I upload a file with large file name or file path the "Uploading File" section that displays the current file path you are uploading:  when it is long like this the file name over-laps out of the progress area box.  If this does not make sense, see the link example below and try to upload a large file name:

- Is there a quick fix for this or anyone run into this?  Obviously an issue with the control if I can re-produce it with an actual Telerik example:

http://demos.telerik.com/aspnet-ajax/upload/examples/customprogress/defaultcs.aspx?RadUrid=aa2c4886-2391-493d-a694-ed234a357989


Genady Sergeev
Telerik team
 answered on 23 Mar 2009
1 answer
118 views
after applying the rad control to my project i tried some of them an they all worked fine but when i tried the chart control it gave me this
error  

Error creating control

failed to create designer 'telerik.web.ui, version:blah blah,


how to solve the problem please help me


Ves
Telerik team
 answered on 23 Mar 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?