Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
84 views

Folks, Using RadControls for ASP.NET AJAX Q2 2012 SP1 with VS 2010.

My Radgrid has approximately 65000 rows; uses LinqDataSource. also I have a external Panel (Panelotherinfo) to Navigate to other forms.

I would like to make that Panel:
 - Invisible if after Filtering RadGrid has no rows.
-  Visible if after Filtering Radgrid has rows.

Below is my Radgrid and panel declaration as well as RadGrid1_ItemEvent.

Thanks for any help

gc_0620

_______________

<telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" Width="99.9%"
            Font-Size="11px" AllowPaging="True" AllowSorting="True" CellSpacing="0" GridLines="None"
            Skin="Office2007" PagerStyle-Mode="NextPrevNumericAndAdvanced" OnPreRender="RadGrid1_PreRender"
            OnUpdateCommand="RadGrid1_UpdateCommand" DataSourceID="LinqDataSourceClient"
            OnItemDataBound="RadGrid1_ItemDataBound"
            OnItemCommand="RadGrid1_ItemCommand" onitemcreated="RadGrid1_ItemCreated"
           onitemevent="RadGrid1_ItemEvent">
           ''''
           ''''
  
</telerik:RadGrid>
 
 
<asp:Panel ID="Panelotherinfo" runat="server">
        <h3 style="background-color: #9fba2d; color: White; width: 20%; margin-left: 5px">
            Client other information</h3>
        <br />
        <telerik:RadSiteMap ID="RadSiteMap1" runat="server" Skin="Sitefinity" Width="50%">
            <Nodes>
                <telerik:RadSiteMapNode runat="server" Text="Contact/Race/PrimarryLanguage and Ethnicity/Anchestry"
                    NavigateUrl="~/Default.aspx">
                </telerik:RadSiteMapNode>
                <telerik:RadSiteMapNode runat="server" Text="Demographic/HouseholdComposition/Monthly Income"
                    NavigateUrl="~/NotReadyyet.aspx">
                </telerik:RadSiteMapNode>
                <telerik:RadSiteMapNode runat="server" Text="Encounter">
                </telerik:RadSiteMapNode>
            </Nodes>
            <LevelSettings>
                <telerik:SiteMapLevelSetting Layout="Flow">
                    <ListLayout AlignRows="True" RepeatColumns="3" />
                </telerik:SiteMapLevelSetting>
            </LevelSettings>
        </telerik:RadSiteMap>
    </asp:Panel>
 
 
 
 
  protected void RadGrid1_ItemEvent(object sender, GridItemEventArgs e)
    {
        int rowcount = 0;
 
        if (e.EventInfo is GridInitializePagerItem)
        {
            rowcount = (e.EventInfo as GridInitializePagerItem).PagingManager.DataSourceCount;
        }
 
        if (rowcount == 0)
 
            Panelotherinfo.Visible = false;
        else
            Panelotherinfo.Visible = true;




gc_0620
Top achievements
Rank 1
 answered on 29 Aug 2012
1 answer
219 views
I have a radgrid, which has a nested template view with another grid in the nested view.  I have a column that contains a hyperlink, which i only want displayed if the user is in a particular role.  I have the role part down, but my problem is I cannot access the grid through the vb.net code behind window.

I try me.gridSchedule, but it is not in the list.

How can I hide this column programmatically?

Thanks...Brian
Jayesh Goyani
Top achievements
Rank 2
 answered on 29 Aug 2012
2 answers
47 views
I have copied the source code from the VB version of the demo which demonstrates how to pop up a custom control with database content.

I also duplicated the database tables.

I can get 95% of the way, and then I find an error that makes no sense to me. The attached screen shot indicates a problem with creating an instance of the custom control as "ProductDetailsVB" not defined. This is actually detected in VS2010, but I ran the code to create a better error description.

I have confirmed that the ASCX control works with static placement on another page. In order to run the demo code, I have commented out two lines "Dim Details as ProductDetailsVB..." and "details.ProductID. When I do this I get the appropriate behavior for the popup control, minus actual database content because it is not receiving the ProductID.

I have created the control as "ProductDetailsVB.ascx" to match the source code. But I do note that the online demo references "ProductDetailsCS.ascx" which would not be appropriate for a VB programmer such as myself.

This is my first custom control, and I have no clues as to the error, and am doubly confused over the reference to CS in a VB demo.
Partial Class pop2
    Inherits System.Web.UI.Page
    Protected Sub OnAjaxUpdate(sender As Object, args As ToolTipUpdateEventArgs)
        Me.UpdateToolTip(args.Value, args.UpdatePanel)
    End Sub
    Private Sub UpdateToolTip(elementID As String, panel As UpdatePanel)
        Dim ctrl As Control = Page.LoadControl("ProductDetailsvb.ascx")
        panel.ContentTemplateContainer.Controls.Add(ctrl)
        Dim details As ProductDetailsVB = DirectCast(ctrl, ProductDetailsVB)
        details.ProductID = elementID
    End Sub
    Protected Sub RadGrid1_ItemDataBound(sender As Object, e As GridItemEventArgs)
        If e.Item.ItemType = GridItemType.Item OrElse e.Item.ItemType = GridItemType.AlternatingItem Then
            Dim target As Control = e.Item.FindControl("targetControl")
            If Not [Object].Equals(target, Nothing) Then
                If Not [Object].Equals(Me.RadToolTipManager1, Nothing) Then
                    'Add the button (target) id to the tooltip manager
 
                    Me.RadToolTipManager1.TargetControls.Add(target.ClientID, (TryCast(e.Item, GridDataItem)).GetDataKeyValue("ProductID").ToString(), True)
                End If
            End If
        End If
    End Sub
    Protected Sub RadGrid1_ItemCommand(source As Object, e As GridCommandEventArgs)
        If e.CommandName = "Sort" OrElse e.CommandName = "Page" Then
            RadToolTipManager1.TargetControls.Clear()
        End If
 
    End Sub
 
End Class




Tomica
Top achievements
Rank 2
 answered on 29 Aug 2012
2 answers
74 views
I have a simple RadMenu, with several RadMenuItem's. After the page loads, and sits there for a while, it seems that when I mouse over when of the menu items, it is doing some type of AJAX postback to the server (e.g. it can hang or delay showing the highlighted button). Is this correct ... is it doing AJAX calls for just displaying simple menu items? Is there a way to disable any/all AJAX stuff for the menu ... I just want to use it for simple menus with an onClick javascript handler.
Thanks
Jay O'Brien
Top achievements
Rank 1
 answered on 29 Aug 2012
4 answers
116 views
I´m not complaining... just reporting a less normal behaviour of this wonderfull grid!
In IE everyting is ok but in firefox, crome or safari the vertical scroll bar fails to display on the first time the grid is shown. Afterwards it shows normaly.
Joao
Top achievements
Rank 1
 answered on 29 Aug 2012
1 answer
118 views
Hello All,
I am using telerik RadEditor. I do not want any scroll bar to this editor so I have given AutoResizeHeight="true".
It works fine in Design mode but if I switch to HTML mode then this editor get a vertical scroll bar.
following is the code,
<
telerik:RadEditor runat="server" ID="contentHeaderEditor" Width="100%" AutoResizeHeight="true"
                                            EnableResize="false" ToolsFile="~/XML/ContentHeaderTools.xml"
                                            EditModes="Design,Html" SkinID="Telerik">
</telerik:RadEditor>
Can anybody help me to remove this vertical scroll bar in HTML mode.
Thanks
Rumen
Telerik team
 answered on 29 Aug 2012
5 answers
1.2K+ views
Hi all,
1. I have the Radgrid having updatable datasource (List<T>) that I store in the session's variable after updating/inserting.
2. All works OK excepting one thing:
3. Each time when I change the C# or aspx - add/remove some control, for example) first time after change the datasource extracted from session is null (when I want edit some row/insert new row)!
4, Second or more time (if I CHANGE NOTHING) all it's OK.

Can anybody give me prompt in this problem?
Thank you.

Boris


O'Man
Top achievements
Rank 1
 answered on 29 Aug 2012
3 answers
120 views
Hi, guys,

I selected some code in RadEditor's "Design" mode.
Then,I changed the mode to "Html" for editing,but the part which I selected in "Design" mode was onblur.

Can I keep the selected part in previous mode being selected after I swap the RadEditor's mode?


Best Regards,
Jack
Rumen
Telerik team
 answered on 29 Aug 2012
1 answer
50 views
RadRotator enables the left arrrow even though the InitialItemIndex is zero and WrapFrames is false. Logically, you can't go one page before the first item, yet RadRotator allows you to do that. What's even worse - when users click the left arrow the RadRotator silently loads third page and then locks up the users between first three pages that are even loaded in the reverse order (this is experienced with version 2012.1.215).

RadRotator also enabled the right arrow even though it does not know whether there are further items on the next page. And when users click that "Page Next" button one of two things happen - either the arrow gets disabled to mark that there is no more items (why RadRotator didn't find this out earlier? Isn't it missing a GetCount() method?) or it goes to next page and then again locks up users there and they cannot click on the "Previous Page" button. 

This happens slightly randomly, unfortunately, but often enough to confuse and scary users.

I believe this could be solved by preloading the first page not on demand but while page render. At this moment the RadRotator could be told the total number of items so it would behave properly when paging. I tried to fill the Items set of RadRotator from code behind and later turn on the load on demand but the RadRotator renders empty.

Can you please suggest a way of prefilling the first page from code behind and let the other pages be loaded on demand?
Slav
Telerik team
 answered on 29 Aug 2012
2 answers
148 views
I have a column that is a datetime but I only want to show time. I tried dataformatstring="{0:H:mm:ss}" but that didn't work. So, I went into my code behind and took the column and formatted it myself.
   Dim nt = ""
                    If (reader("NextContactTime").ToString <> "") Then
                        Dim tempTime As New DateTime
                        tempTime = reader("NextContactTime")
                        nt = tempTime.ToShortTimeString
                    End If

I then add nt to the data table that I bind my grid with. The problem is, when I use the built in sort function, it doesn't sort properly. I have the column type defined as datetime in my data table and I also made sure all of the days are the same. I.e. only the time is different they all are 01/01/2012 9:30:00 01/01/2012 9:45:00

What is the best way to show just time in a column and allow it to be sorted?
gezim
Top achievements
Rank 1
 answered on 29 Aug 2012
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
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
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
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?