Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
265 views

I am populating RadPanelBar from the database. The following is my code.  I have a db column that specifies enable true or false. I would like to set the RadPanelItem enable property using this. How can I do this?

 


Dim
dt As New DataTable

dt =GetPanelItems(Id) – proc to call oracle

Dim links As New DataSet()

 

        links.Tables.Add(dt)

        RadPanelBar1.DataTextField = "panel_name"

        RadPanelBar1.DataNavigateUrlField = ""

        RadPanelBar1.DataFieldID = "panel_id"

        RadPanelBar1.DataFieldParentID = "Parent_panel_Id"

        RadPanelBar1.DataValueField = "panel_value"

        RadPanelBar1.DataSource = links

        RadPanelBar1.DataBind()
Thanks

Nikolay Tsenkov
Telerik team
 answered on 22 Apr 2011
1 answer
86 views
It seems to be impossible to add text after a table, when the table is at the bottom of the document. If I use the arrow or try to click below the table it just selects the table. I want the text to be outside the table underneath it. How can I do that?

thank you
Rumen
Telerik team
 answered on 22 Apr 2011
2 answers
180 views
Hello,

Problem in RadScheduler(Width) auto adjustment in any screen(Big And Small) and in IE/FireBox/Grome/Shafari.

We used 

script type="text/javascript">
    function resizeScheduler()   
                  {
                      var scheduler = $find('<%=RadScheduler1.ClientID %>');
                      scheduler.get_element().style.width = "100%";
                      scheduler.repaint();
                  }
</script> 
And also set width=100% in RadScheduler control

In C# code
RadScheduler1.Width = Unit.Percentage(100);
but it is not work.

please help me as soon as possible.


Thanks

Best Regards
Mutum Jiten Singh
Akhil Systems
Jiten
Top achievements
Rank 1
 answered on 22 Apr 2011
1 answer
101 views
I have a couple of grids on tabs for each row of a grid in a nested view. The code-behind opens the first record to view the first item. At this point, I can click on the link to download my attachment, but it only works the first time. After that, it hangs and I can't figure out why.

If you can figure out what I need to correct, it would be a tremendous help!

I've created a mini-project that demonstrates the problem. I've substituted 2 XML files for data sources, but, for this demo, the attachment is hard-coded. (It's using a PDF.)

<%@ Page Language="C#" %>
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<script runat="server">
 
    protected void DownloadForShot_ImageButton_Click(object sender, System.Web.UI.ImageClickEventArgs e)
    {
        ImageButton btnDownload = (ImageButton)sender;
        GridDataItem dataItem = (GridDataItem)btnDownload.NamingContainer;
        RadGrid Attachments_RadGrid = (RadGrid)dataItem.NamingContainer.NamingContainer;
        Label lblShotID =(Label)Attachments_RadGrid.NamingContainer.FindControl("ShotID_Label");
        try
        {
//NOTE THE HARD CODED VALUE HERE
        System.IO.FileInfo file = new System.IO.FileInfo("C:\\inetpub\\wwwroot\\TestSite\\Images\\TestPDF.pdf");
 
        if (file.Exists)
        {
            Response.ClearContent();
            Response.AddHeader("Content-Disposition", string.Format("attachment; filename={0}", file.Name));
            Response.AddHeader("Content-Length", file.Length.ToString());
            Response.ContentType = "application/pdf";            // "image/jpeg"
            Response.TransmitFile(file.FullName);
            HttpContext.Current.ApplicationInstance.CompleteRequest();
        }
        else
        {
            throw new Exception("There is no attachment for this path or the path is not valid.");
        }
        }
        catch (Exception ex)
        {
            Response.Write("<span style='color:red;'>" + ex.Message + "</span>");
        }
    }
 
    protected void ShotDetail_RadGrid_PreRender(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            if (ShotDetail_RadGrid.MasterTableView.Items.Count > 0)
            {
                ShotDetail_RadGrid.MasterTableView.Items[0].Expanded = true;
                ShotDetail_RadGrid.MasterTableView.Items[0].ChildItem.FindControl("InnerContainer").Visible = true;
            }
        }
    }
</script>
 
<head runat="server">
    <title>Title</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <div id="div_Shots_ShotDetail" style="width:99%; height:1500px; position:absolute;">
            <telerik:RadGrid ID="ShotDetail_RadGrid" runat="server" DataSourceID="XmlDataSource1"
                    AllowPaging="True" Skin="Hay" GridLines="None" ShowStatusBar="True" Width="921px"
                onprerender="ShotDetail_RadGrid_PreRender" >
                <HierarchySettings ExpandTooltip="Show related merch" CollapseTooltip="Collapse merch"></HierarchySettings>
                <ExportSettings IgnorePaging="True">
                    <Pdf PageBottomMargin="0.5in" PageHeight="8.5in" PageLeftMargin="0.35in"
                            PageRightMargin="0.35in" PageTopMargin="0.5in" PageWidth="11in" />
                </ExportSettings>
                <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True">
                    <Selecting AllowRowSelect="True"></Selecting>
                    <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                </ClientSettings>
                <MasterTableView DataSourceID="XmlDataSource1" AutoGenerateColumns="False"
                    AllowCustomPaging="True">
                    <NestedViewTemplate>
                        <asp:Panel runat="server" ID="InnerContainer" CssClass="viewWrap" Visible="false">
                            <telerik:RadTabStrip runat="server" ID="TabStip1" MultiPageID="Multipage1" SelectedIndex="0" Width="884px">
                                <Tabs>
                                    <telerik:RadTab runat="server" Text="Attachments" PageViewID="PageView2" Selected="True">
                                    </telerik:RadTab>
                                </Tabs>
                            </telerik:RadTabStrip>
                            <telerik:RadMultiPage runat="server" ID="Multipage1" SelectedIndex="0" RenderSelectedPageOnly="false" >
                                <telerik:RadPageView runat="server" ID="PageView1">
                                    <asp:Label ID="ShotID_Label" runat="server" Text='<%# Eval("ShotID") %>' Visible="false" />
                                    <asp:Label ID="Error_Label" runat="server"></asp:Label>
                                    <telerik:RadGrid ID="Attachments_RadGrid" runat="server" DataSourceID="XmlDataSource2" GridLines="None">
                                        <MasterTableView AutoGenerateColumns="False" DataSourceID="XmlDataSource2">
                                            <CommandItemSettings ExportToPdfText="Export to PDF" />
                                            <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                                                <HeaderStyle Width="20px" />
                                            </RowIndicatorColumn>
                                            <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                                                <HeaderStyle Width="20px" />
                                            </ExpandCollapseColumn>
                                            <Columns>
                                                <telerik:GridTemplateColumn UniqueName="ColumnDownload">
                                                    <ItemTemplate>
                                                        <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
                                                            <asp:ImageButton ID="DownloadForShot_ImageButton" runat="server" ImageUrl="~/Images/view.gif"
                                                                OnClick="DownloadForShot_ImageButton_Click" />
                                                        </telerik:RadAjaxPanel>
                                                    </ItemTemplate>
                                                </telerik:GridTemplateColumn>
                                                <telerik:GridBoundColumn DataField="AttachmentTitle" HeaderText="Attachments" UniqueName="ColumnAttachment">
                                                </telerik:GridBoundColumn>
                                            </Columns>
                                            <EditFormSettings>
                                                <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                                </EditColumn>
                                            </EditFormSettings>
                                        </MasterTableView>
                                        <FilterMenu EnableImageSprites="False">
                                        </FilterMenu>
                                        <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
                                        </HeaderContextMenu>
                                    </telerik:RadGrid>
 
                                    <asp:XmlDataSource ID="XmlDataSource2" runat="server" DataFile="~/XMLFile2.xml"></asp:XmlDataSource>
                                </telerik:RadPageView>
                                <telerik:RadPageView Runat="server" Width="100%" ID="PageView2">
                                </telerik:RadPageView>
                            </telerik:RadMultiPage>
                        </asp:Panel>
                    </NestedViewTemplate>
                    <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
                    <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>
                    <ExpandCollapseColumn Visible="True"></ExpandCollapseColumn>
                    <Columns>
                        <telerik:GridBoundColumn DataField="ShotID" HeaderText="ShotID" UniqueName="ShotID"
                            FilterControlAltText="Filter ShotID column" SortExpression="ShotID">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="JobNumber" HeaderText="JobNumber" UniqueName="JobNumber"
                            FilterControlAltText="Filter JobNumber column" SortExpression="JobNumber">
                        </telerik:GridBoundColumn>
                    </Columns>
                <EditFormSettings>
                    <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
                </EditFormSettings>
                    <PagerStyle AlwaysVisible="True" />
                </MasterTableView>
                <PagerStyle AlwaysVisible="True" />
                <FilterMenu EnableImageSprites="False"></FilterMenu>
                <HeaderContextMenu EnableImageSprites="True" CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu>
            </telerik:RadGrid>
 
            <asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/XMLFile.xml"></asp:XmlDataSource>
            <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
        </div>
    </div>
    </form>
</body>
</html>

XML File 1:
<?xml version="1.0" encoding="utf-8" ?>
<tables>
    <tShots ShotID="15736" JobNumber="254960"/>
    <tShots ShotID="15737" JobNumber="254960"/>
    <tShots ShotID="15738" JobNumber="254960"/>
    <tShots ShotID="15739" JobNumber="254960"/>
    <tShots ShotID="15740" JobNumber="254960"/>
    <tShots ShotID="15741" JobNumber="254960"/>
</tables>

XML File 2:
<?xml version="1.0" encoding="utf-8" ?>
<tables>
    <tAttachments ShotID="14394" AttachmentExtension=".jpg" AttachmentPath="~/images/Image1/file1.jpg" AttachmentTitle="File Name 1"/>
    <tAttachments ShotID="15737" AttachmentExtension=".jpg" AttachmentPath="~/images/Image1/file2.jpg" AttachmentTitle="File Name 2"/>
    <tAttachments ShotID="15738" AttachmentExtension=".jpg" AttachmentPath="~/images/Image1/file3.jpg" AttachmentTitle="File Name 3"/>
    <tAttachments ShotID="15739" AttachmentExtension=".jpg" AttachmentPath="~/images/Image1/file4.jpg" AttachmentTitle="File Name 4"/>
    <tAttachments ShotID="15740" AttachmentExtension=".jpg" AttachmentPath="~/images/Image1/file5.jpg" AttachmentTitle="File Name 5"/>
</tables>
Mira
Telerik team
 answered on 22 Apr 2011
1 answer
80 views
I have a WCF Data Service in a ASP.NET MVC 3 App on IIS 7.  I have configured the web.config to have the following...

<system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <modules runAllManagedModulesForAllRequests="true" >
      <add name="RadCompression" type="Telerik.Web.UI.RadCompression"/>
    </modules>
    <handlers>
      <remove name="asset" />
      <add name="asset" preCondition="integratedMode" verb="GET,HEAD" path="asset.axd" type="Telerik.Web.Mvc.WebAssetHttpHandler, Telerik.Web.Mvc" />
      <add name="Ajax" verb="POST,GET" path="ajax/*.ashx" type="Ajax.PageHandlerFactory, Ajax" />
    </handlers>
  </system.webServer>
and
<httpModules>
        <!-- Add this line exactly as is - the name value is important -->
        <add name="RadCompression" type="Telerik.Web.UI.RadCompression" />
      </httpModules>

I also have a Silverlight app that queryies the webservice.  I expect my data to be compressed in some way, but after looking at fiddler, I don't see any compression at all. 

What am I doing wrong?

Thanks,
Joe

[UPDATE]
I forgot to mention that I'm using the absolute latest Telerik ASP.NET AJAX control, and the latest, minus the controls they released on April 19 for silverlight
Joseph Roberts
Top achievements
Rank 1
 answered on 22 Apr 2011
4 answers
182 views
I'm trying to change using javascript the value of a control I have added to the footer of my list. For instance, I have added a asp.net label with id 'lblCount'. What would be the easiest way to find the control in my javascript?

Thanks,
Joe
Veronica
Telerik team
 answered on 22 Apr 2011
6 answers
337 views
I have an application that is opening a RadWindow which contains two combo boxes that are used to filter a RadScheduler. The application is a dental scheduler. The user selects a location and a doctor and the calendar refreshes to show all appointments for the month. There is also a RadGrid to show client previous appointments for a selected item.

The app works great for the most part. The problem I'm having is that I had to import data from an old Access app that didn't have all of the fields available in the new app. So I had to default the doctor, and all imported records were set to one person. Moving forward the dental staff can reset these as they have time. I don't know who the customer saw, only the dental staff would.

Problem is that if you select this one doctor, the scheduler REALLY dogs. Any navigation of months is extremely slow. I have the database indexed but the loading of the RadScheduler is slow. For the new entries that are split apart there is no issue.

Is there some sort of trick like on-demand loading, server caching, or something else I could do to speed this up in the interim? I don't think it's going to be an issue when the staff gets all of the appointments reset to the proper doctors. At that time there won't be a single doctor with thousands of appointments. What I see data-wise is that the scheduler chokes at over 30 appointments in a month.

Thanks!
Peter
Telerik team
 answered on 22 Apr 2011
4 answers
70 views
Hi

  We are facing problem with drag and drop feature in tree view particularly in MAC, when we drag and drop items inside tree view from one item to another or if we try to rename the items inside treeview or if we drag n drop items to telerik gridview, data won't get updated or its updated very very slowly.

  Just wanted to know if this a known issue in MAC or if there is work around.

thanks
Pramodh
Nikolay Tsenkov
Telerik team
 answered on 22 Apr 2011
1 answer
75 views
I have a RadGrid on my form that has Grouping Enabled. When I run this in IE 8 the Grid shows up fine, the Group Panel is at the top and I can Group.

When I go to FireFox the group Panel is off to the left of the columns. It looks like its being treated like another column. My code is below.

 
 <telerik:RadGrid ID="gv_RadQueryResults" runat="server" AllowFilteringByColumn="True"
                                                            AllowMultiRowEdit="True" AllowPaging="True" AllowSorting="true" AutoGenerateColumns="true"
                                                            BorderStyle="None" BorderWidth="0px" CellPadding="0" GridLines="None" PageSize="15" Skin="Simple" Width="100%" ShowGroupPanel="True">
                                                            <ClientSettings AllowDragToGroup="True">
                                                            </ClientSettings>
                                                            <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
                                                            </HeaderContextMenu>
                                                            <MasterTableView CellPadding="0" CellSpacing="0">
                                                                <CommandItemSettings ExportToPdfText="Export to Pdf" />
                                                                <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                                                                </RowIndicatorColumn>
                                                                <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                                                                </ExpandCollapseColumn>
                                                                <EditFormSettings>
                                                                    <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                                                    </EditColumn>
                                                                </EditFormSettings>
                                                                <Columns>
                                                                    <telerik:GridTemplateColumn AllowFiltering="False" FilterControlAltText="Filter TemplateColumn column"
                                                                        ShowFilterIcon="False" ShowSortIcon="False" UniqueName="TemplateColumn">
                                                                        <ItemTemplate>
                                                                            <asp:CheckBox ID="chkbxRow" runat="server" />
                                                                        </ItemTemplate>
                                                                        <ItemStyle Width="20px" />
                                                                    </telerik:GridTemplateColumn>
                                                                    <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="ViewRecord" FilterControlAltText="Filter column column"
                                                                        ImageUrl="Images/view.gif" UniqueName="column">
                                                                        <ItemStyle Width="20px" />
                                                                    </telerik:GridButtonColumn>
                                                                </Columns>
                                                            </MasterTableView>
                                                            <FilterMenu EnableImageSprites="False" EnableTheming="True">
                                                                <CollapseAnimation Duration="200" Type="OutQuint" />
                                                            </FilterMenu>
                                                            <HeaderStyle Font-Size="Smaller" HorizontalAlign="Center" Wrap="False" />
                                                            <GroupPanel BorderStyle="None" EnableTheming="True">
                                                                <PanelStyle BorderStyle="None" CssClass="RadGrouping" HorizontalAlign="Left" />
                                                                <PanelItemsStyle BackColor="#E0E0E0" BorderStyle="None" CssClass="RadGrouping" HorizontalAlign="Left" />
                                                            </GroupPanel>
                                                            <GroupHeaderItemStyle HorizontalAlign="Left" />
                                                            <ExportSettings IgnorePaging="True">
                                                            </ExportSettings>
                                                        </telerik:RadGrid>
Tsvetina
Telerik team
 answered on 22 Apr 2011
3 answers
49 views
Is it possible to download additional skins (if any) available for RadGrid?
Tsvetina
Telerik team
 answered on 22 Apr 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?