Telerik Forums
UI for ASP.NET AJAX Forum
14 answers
495 views
Is there any way to override the icon displayed for a file?  I'm using a custom file browser provider which works fine, but the files aren't really files, they're items in my database, and their names have no file extension, and I don't want to add one just to get an icon to appear.  How would I display my own icon for files?
Vessy
Telerik team
 answered on 03 Nov 2014
10 answers
359 views
I have a radgrid with about 18 columns,  I've tried the basic code on this site that rips out all the html data and simply prints it, but it doesn't work well as in portrait, columns are cut off, and landscape fares only slightly better.

What would be the more efficient way to print out the radgrid (Ideally so it automatically formats the printout to fit all the data without cutting data out).?

Thanks in advance for your time.
Richard
Top achievements
Rank 1
 answered on 03 Nov 2014
1 answer
320 views
We currently have a "window" that we would like to display our charts in and can't seem to get the chart to fit nicely in it (as depicted in image).

Window is 400 px x 400 px;  there seems to be additional padding around the chart?  Would like to remove the scrollbars.  Any suggestions?

<div style="width: 98%; margin: 0 auto; overflow: auto; border: 1px solid green;">
    <div id="slide_00" class="slide" style="border: 1px solid red; height: 250px; width: 350px;">
    <telerik:RadHtmlChart runat="server" Width="350px" Height="225px" ID="RadHtmlChart1"
        DataSourceID="SqlDataSource1">
        <PlotArea>
            <Series>
                <telerik:ColumnSeries DataFieldY="NumOfMembers">
                    <TooltipsAppearance Color="White" />
                </telerik:ColumnSeries>
            </Series>
            <XAxis DataLabelsField="MemberType">
                <TitleAppearance Text="Member Types">
                    <TextStyle Margin="5" />
                </TitleAppearance>
                <MajorGridLines Visible="false" />
                <MinorGridLines Visible="false" />
            </XAxis>
            <YAxis>
                <TitleAppearance Text="Active Members">
                    <TextStyle Margin="5" />
                </TitleAppearance>
                <MinorGridLines Visible="false" />
            </YAxis>
        </PlotArea>
        <ChartTitle Text="# of Active ASI Credit Unions">
        </ChartTitle>
    </telerik:RadHtmlChart>
    </div>
    <div id="slide_01" class="slide" style="border: 1px solid red; height: 250px; width: 350px;"">
    <telerik:RadHtmlChart runat="server" Width="350px" Height="225px" ID="RadHtmlChart2"
        DataSourceID="SqlDataSource2">
        <PlotArea>
            <Series>
                <telerik:ColumnSeries DataFieldY="TotCount">
                    <TooltipsAppearance Color="White" />
                </telerik:ColumnSeries>
            </Series>
            <XAxis DataLabelsField="Coverage">
                <TitleAppearance Text="Member Types">
                    <TextStyle Margin="5" />
                </TitleAppearance>
                <MajorGridLines Visible="false" />
                <MinorGridLines Visible="false" />
            </XAxis>
            <YAxis>
                <TitleAppearance Text="# of Financials">
                    <TextStyle Margin="5" />
                </TitleAppearance>
                <MinorGridLines Visible="false" />
            </YAxis>
        </PlotArea>
        <ChartTitle Text="Recent Qtr Financial Statements">
        </ChartTitle>
    </telerik:RadHtmlChart>
    </div>
    <telerik:RadSlider ID="RadSlider1" runat="server" TrackPosition="TopLeft" Value="0"
        ItemType="Item" Skin="Black" Width="350px" Height="40px" OnClientValueChanged="UpdateVisibleSlide"
        OnClientLoad="UpdateVisibleSlide">
        <Items>
            <telerik:RadSliderItem Text="# of Active ASI Credit Unions"></telerik:RadSliderItem>
            <telerik:RadSliderItem Text="# of Financial Statements"></telerik:RadSliderItem>
        </Items>
    </telerik:RadSlider>
    </div>
Danail Vasilev
Telerik team
 answered on 03 Nov 2014
3 answers
170 views
I have a Telerik RadHtmlChart inside an asp Panel which uses an ajaxtoolkit CollapsiblePanelExtender.

If the panel is collapsed when I assign a datasource to the chart and databind, after the panel expands the chart only fills 1/2 the panel size, left to right. If I have the panel expanded and the chart visible during the databind, it fills the panel all the way across as expected.

Somehow I need to know when the panel has expanded and tell the chart to resize/repaint and fill the available space in the panel, but so far no joy doing this.Or maybe there is a flag/property on my controls I've missed which would help the chart fill the available space even when the panel is expanded.

I would prefer to work in the C# code behind, but javascript/jquery solutions are also appreciated.Thanks,
Danail Vasilev
Telerik team
 answered on 03 Nov 2014
6 answers
232 views
I'm trying to prevent page refreshes on a page with a single grid so I've tried to implement the Ajax Manager, the Ajax Panel and the Ajax Loading Panel.  However, it is not working as I'd expect (or how the demo's work).

The code I have is as follows:
<telerik:RadAjaxManager runat="server" ID="radAjaxManager" EnableAJAX="True">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="radInspection">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="radInspection" LoadingPanelID="radlpInspection"/>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel runat="server" ID="radlpInspection"></telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxPanel runat="server" ID="radpnlInspection" LoadingPanelID="radlpInspection" EnableAJAX="True">
        <telerik:RadGrid runat="server" ID="radInspection" AllowPaging="True" AllowSorting="True" ShowHeader="True" GridLines="None" CellPadding="0" CellSpacing="0"
            PageSize="20" AllowFilteringByColumn="True" OnNeedDataSource="radInspection_OnNeedDataSource" OnItemCommand="radInspection_OnItemCommand">
            <ClientSettings AllowColumnsReorder="False" EnableRowHoverStyle="True" EnablePostBackOnRowClick="True">
                <Selecting AllowRowSelect="True"></Selecting>
                <Scrolling UseStaticHeaders="True"></Scrolling>
            </ClientSettings>
            <MasterTableView DataKeyNames="inspection_id" AutoGenerateColumns="False" AllowMultiColumnSorting="True" EnableHeaderContextMenu="True"
                AllowFilteringByColumn="True" CommandItemDisplay="TopAndBottom" Height="100%">
                <NoRecordsTemplate>No inspections.</NoRecordsTemplate>
                <CommandItemSettings ShowAddNewRecordButton="False" ShowCancelChangesButton="False" ShowSaveChangesButton="False" ShowRefreshButton="True"></CommandItemSettings>
                <Columns>
                    <telerik:GridBoundColumn DataField="inspection_id" HeaderText="ID" AllowFiltering="False">
                        <HeaderStyle Width="1%" VerticalAlign="Top" HorizontalAlign="Right"></HeaderStyle>
                        <ItemStyle Width="1%" VerticalAlign="Top" HorizontalAlign="Right"></ItemStyle>
                    </telerik:GridBoundColumn>
                    <telerik:GridDateTimeColumn DataField="inspection_datetime" HeaderText="Inspection Date" EnableTimeIndependentFiltering="True"
                        PickerType="DateTimePicker" DataFormatString="{0:MM/dd/yyyy HH:mm}" FilterControlWidth="85%">
                        <ItemStyle Width="5%" VerticalAlign="Top" HorizontalAlign="Left"></ItemStyle>
                        <HeaderStyle Width="5%"></HeaderStyle>
                    </telerik:GridDateTimeColumn>
                    <telerik:GridBoundColumn DataField="inspector" HeaderText="Inspector" FilterControlWidth="75%">
                        <HeaderStyle Width="5%"></HeaderStyle>
                        <ItemStyle Width="5%" VerticalAlign="Top" HorizontalAlign="Left"></ItemStyle>
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="division" HeaderText="Division" FilterControlWidth="75%">
                        <HeaderStyle Width="5%"></HeaderStyle>
                        <ItemStyle Width="5%" VerticalAlign="Top" HorizontalAlign="Left"></ItemStyle>
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="full_grade" HeaderText="Grade" FilterControlWidth="75%">
                        <HeaderStyle Width="5%"></HeaderStyle>
                        <ItemStyle Width="5%" VerticalAlign="Top" HorizontalAlign="Left"></ItemStyle>
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="length_description" HeaderText="Length" FilterControlWidth="75%">
                        <HeaderStyle Width="5%"></HeaderStyle>
                        <ItemStyle Width="5%" VerticalAlign="Top" HorizontalAlign="Left"></ItemStyle>
                    </telerik:GridBoundColumn>
                    <telerik:GridCheckBoxColumn DataField="complete" HeaderText="Completed" AllowFiltering="False">
                        <HeaderStyle Width="2%" HorizontalAlign="Right"></HeaderStyle>
                        <ItemStyle Width="2%" VerticalAlign="Top" HorizontalAlign="Right"></ItemStyle>
                    </telerik:GridCheckBoxColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
    </telerik:RadAjaxPanel>

Code Behind:
protected void Page_Load(object sender, EventArgs e)
    {
      if (Session["Key"] != null)
      {
        Session["Key"] = -1;
      }
      if (!IsPostBack)
      {
        LoadData();
      }
    }
 
    private void LoadData()
    {
      var inspections = dal.Inspection.GetVInspectionHeaders();
      radInspection.DataSource = inspections;
    }
 
    protected void radInspection_OnNeedDataSource(object sender, GridNeedDataSourceEventArgs e)
    {
      LoadData();
    }
 
    protected void radNew_OnClick(object sender, EventArgs e)
    {
      Session["Key"] = -1;
      Response.Redirect("header.aspx");
    }
 
    protected void radInspection_OnItemCommand(object sender, GridCommandEventArgs e)
    {
      if (e.CommandName == "RowClick")
      {
        GridEditableItem item = e.Item as GridEditableItem;
        if (item == null)
        {
          return;
        }
        var key = item.GetDataKeyValue("inspection_id").ToString();
        Response.Redirect(string.Format("viewinspection.aspx?id={0}", key));
      }
    }
  }

Any ideas as to what I'm doing wrong?
Maria Ilieva
Telerik team
 answered on 03 Nov 2014
11 answers
247 views
Hello,

I have below code and when I drag groups to the groupingbar the grid shows me the group totals in the groupfooter. However when I export the grid to ExcelML, the grouping structure is there, but the groupfooters with their totals are lost. I have read several suggestions through using the OnExcelMLExportRowCreated and OnExcelMLExportStylesCreated to get what I want, but somehow I can't get it to work. Could you point me in the right direction?

ASPX Code (the grid is ajaxified through telerik RadAjaxManager)

<telerik:RadGrid ID="rg" runat="server" Skin="Office2007"
    AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True"
    GridLines="None" ShowStatusBar="True" OnNeedDataSource="rg_NeedDataSource" EnableLinqExpressions="False"
    PageSize="20" Width="100%" ShowGroupPanel="True"
    OnColumnCreated="rg_ColCreated" OnItemDataBound="rg_ItemDataBound"
    OnExcelMLExportRowCreated="RadGrid1_ExcelMLExportRowCreated"
    OnExcelMLExportStylesCreated="RadGrid1_ExcelMLExportStylesCreated"
    meta:resourcekey="rgResource1">
    <GroupingSettings ShowUnGroupButton="True" />
    <ExportSettings ExportOnlyData="True" IgnorePaging="True" >
        <Excel Format="ExcelML" />
    </ExportSettings>
    <ClientSettings AllowColumnsReorder="True" AllowDragToGroup="True"
        ColumnsReorderMethod="Reorder" ReorderColumnsOnClient="True">
        <Selecting AllowRowSelect="True" />
        <Scrolling AllowScroll="True" UseStaticHeaders="True" />
        <Resizing AllowColumnResize="True" />
        <Animation AllowColumnReorderAnimation="True" />
    </ClientSettings>
    <MasterTableView AllowMultiColumnSorting="True" ClientDataKeyNames="oid"
        DataKeyNames="oid" GroupLoadMode="Client" ShowFooter="True"
        ShowGroupFooter="True" UseAllDataFields="True">
        <NoRecordsTemplate>
            <div>
                Geen items gevonden.</div>
        </NoRecordsTemplate>
        <CommandItemSettings ExportToPdfText="Export to Pdf" />
    </MasterTableView>
    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Office2007"
        EnableImageSprites="True">
    </HeaderContextMenu>
</telerik:RadGrid>

Code behind (C#):

protected void rg_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
    {
         
 
        DataTable dt = new DataTable();
 
 
        if (ddlGebruikers.SelectedValue == "-2") return;
        if (cbQuarter.Checked)
        {
            dt = getQuarterData();
        }
        else if (cbMonth.Checked)
        {
            dt = getMonthData();
        }
 
        rg.DataSource = dt;
}
 
protected void rg_ColCreated(object sender, GridColumnCreatedEventArgs e)
    {
        if (e.Column is GridBoundColumn)
        {
            GridBoundColumn col = (GridBoundColumn)e.Column;
            if (col.UniqueName == "Q1" || col.UniqueName == "Q2" || col.UniqueName == "Q3" || col.UniqueName == "Q4")
            {
                col.Aggregate = GridAggregateFunction.Sum;
            }
            else if (col.UniqueName == "QR1" || col.UniqueName == "QR2" || col.UniqueName == "QR3" || col.UniqueName == "QR4")
            {
                col.Aggregate = GridAggregateFunction.Sum;
            }
        
}

Kostadin
Telerik team
 answered on 03 Nov 2014
3 answers
110 views
In my radgrid, on click of AddNewRecord, I open a user control with a search textbox and button. To hide the AddNewRecordButton and Header I have on RadGrid1_ItemCommand I have the following:
if (e.CommandName == RadGrid.InitInsertCommandName)
{
         this._RadGrid1.MasterTableView.CommandItemSettings.ShowAddNewRecordButton = false;
         this._RadGrid1.MasterTableView.ShowHeader = false;                     
 }
But when the search textbox retrieves results and I select one of the entries, a postback is done to display the selected the value, after which the header and AddNewRecordButton are again visible though, the user control is still open. Is there a way to hide it after the postback?
Eyup
Telerik team
 answered on 03 Nov 2014
1 answer
75 views
Hi,

In out project, we are dynamically creating RadGrid and Merging rows 

It is not working when user control which contains RadGrid loads first time but when postback occurs it is working i.e  it shows merged rows.

Please let me know what problem is causing this behaviour. 

This is urgent so please let us know as soon as possible

Thanks in advance


Pavlina
Telerik team
 answered on 03 Nov 2014
1 answer
59 views
I have a grid with a GridClientSelect column. Clicking anywhere in the row other than the checkbox for that row causes all other selected/checked rows to deselect. How do I stop this. I want the row to only be selected by clicking the checkbox. I have shown in attached screenshots.
Pavlina
Telerik team
 answered on 03 Nov 2014
10 answers
1.4K+ views
Hi,

I have a quick question.

I'm trying to implement the RadGrid in BatchEdit mode.

I need to customise validation on some fields, and to do so I need to 'wire up' the event behind 'Add new record' button embedded on the grid.
E.g. the user added a new row/record and before adding another one I need to validate the added data.

I'm able to capture the events behind the 'Save changes' and 'Cancel changes' grid buttons but haven't been able to track down the 'Add new record'.

What are the client side and server side events behind this button?

Thank you in advance.

Konstantin Dikov
Telerik team
 answered on 03 Nov 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?