Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
86 views
Hi All

I have set the pager style to "Slider" on a radgrid & the slider control button id overflowing the grid (See attached pic)!
The grid is inside of a splitter.
Has anyone experienced this before & if so how did thet cure it?

Many Thanks

Regards

Cush
Cush
Top achievements
Rank 1
 answered on 12 Aug 2011
1 answer
230 views
We have a simple RadGrid on a page (static column widths) which is inside a div defined with a min-width of 1000px.  If a user opens their browser and the window is less than 1000px and then resizes the window, the grid will be fixed width and won't resize.  If the window is bigger than 1000px, the grid resizes with the window.

The problem exists in both IE and FF.  Looking at the source with IE, the style on the grid says width:100%.  If I look at it with FireFox, the RadGrid shows a fixed width (style="width:1067px").  If its bigger than 1000px, it shows as dynamic (style="width:100%").  What property controls this?  What is the proper way to fix it?
Pavlina
Telerik team
 answered on 12 Aug 2011
1 answer
153 views
Hi

In our product we are using jQuery ajax to load the aspx pages asynchronously.  When we try to load the page which contains Rad Editor thinks are not going correct as it need to be.

Let me explain in detail what exactly is happening. We have a Editor.aspx page which contain Rad Editor our goal is to call this page using jQuery Ajax and by using Editor Client-side API we will read html contain from Editor and populate html contain to Editor. When we load the Editor.aspx page Editor render properly in UI but none of the functionality is working at all.

Here I am able to simulate the scenario using an sample ASP.Net 4.0 Web Project

In Editor.aspx page

<form id="form1" runat="server">
    <div>
        <telerik:RadScriptManager runat="server"></telerik:RadScriptManager>
        <telerik:RadEditor runat = "server" ></telerik:RadEditor>
    </div>
</form>

The page from where we are calling the Editor.aspx page

<script type="text/javascript">
 
        $(document).ready(function () {
           
            $("#success").load("Editor.aspx", function (response, status, xhr) {
                if (status == "error") {
                    var msg = "Sorry but there was an error: ";
                    $("#error").html(msg + xhr.status + " " + xhr.statusText);
                }
            });
 
        });
         
  </script>

due to Attachment restriction i am unable to provide the sample project. If the sample project needed, please let me know so i can able to send it by mail.

Waiting for your replay :) thanks,

Prabhudatta
BrandSystems



Rumen
Telerik team
 answered on 12 Aug 2011
3 answers
62 views

Hello,

We have certain problem by RadGrid filter. We need to bind data using DataTable class. We have prepared data for RadGrid by combination of data from database with computed data. Therefore,the SqlDataSource is not useful for us. We have found example regarding mentioned scenario in your forum. The example uses ItemCreated event, but it doesn’t work. Data is binding correctly, however the filtering doesn’t work.

We consider the solution based on DataTable (stored in a session) shared by controls inherited from a GridTemplateColumn. However, this approach seems to be complicated for described aim which appears to be trivial.

So, is there any way to accomplish the DataTable binding as a data source for the RadGrid without harm the filtering?


Thank yout very much for your advice.

<telerik:RadGrid ID="RadGridData" runat="server" Width="100%" AutoGenerateColumns="false"

    AllowPaging="true" PageSize="10" ShowGroupPanel="false" ShowFooter="true" AllowFilteringByColumn="true"

    OnPreRender="RadGridData_PreRender" AllowSorting="true" AllowMultiRowSelection="false"

    GridLines="None" EnableAjaxSkinRendering="true" EnableAJAX="true"

    onneeddatasource="RadGridData_NeedDataSource" OnItemCreated="RadGridData_ItemCreated" ViewStateMode="Disabled">

    <ExportSettings ExportOnlyData="true" IgnorePaging="true" OpenInNewWindow="true" />

    <MasterTableView AutoGenerateColumns="false" EditMode="InPlace" AllowFilteringByColumn="True"

        ShowFooter="True" TableLayout="Auto" DataKeyNames="Id" CommandItemDisplay="Top">

        <CommandItemSettings ShowRefreshButton="false" ShowAddNewRecordButton="false" ShowExportToWordButton="true" ShowExportToExcelButton="true"

                ShowExportToCsvButton="true" />

        <Columns>

            <telerik:GridBoundColumn UniqueName="Caption" DataField="Caption" HeaderText="Caption"

                AllowFiltering="true" DataType="System.String">

                <HeaderStyle Width="25%" />

                <FilterTemplate>

                    <telerik:RadComboBox ID="RadComboBoxCaption" DataTextField="Caption" DataValueField="Caption" Height="200px" AppendDataBoundItems="true"

                        SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("Caption").CurrentFilterValue %>'

                        runat="server" OnClientSelectedIndexChanged="CaptionChanged">

                        <Items>

                            <telerik:RadComboBoxItem Text="All" />

                        </Items>

                    </telerik:RadComboBox>

                    <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">

                        <script type="text/javascript">

                            function CaptionChanged(sender, args) {

                                var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");

                                tableView.filter("Caption", args.get_item().get_value(), "EqualTo");

                            }

                        </script>

                    </telerik:RadScriptBlock>

                </FilterTemplate>

            </telerik:GridBoundColumn>

            <telerik:GridDateTimeColumn DataField="DateTime" HeaderText="RTU Date and time" SortExpression="DateTime"

                UniqueName="DateTime" PickerType="DateTimePicker" AllowFiltering="false">

                <HeaderStyle Width="25%" />

            </telerik:GridDateTimeColumn>

            <telerik:GridBoundColumn UniqueName="FormatedValue" DataField="FormatedValue" HeaderText="Value"

                AllowFiltering="true" DataType="System.String">

                <HeaderStyle Width="25%" />

            </telerik:GridBoundColumn>

            <telerik:GridBoundColumn UniqueName="State" DataField="State" HeaderText="State"

                AllowFiltering="true" DataType="System.String">

                <HeaderStyle Width="25%" />

            </telerik:GridBoundColumn>

        </Columns>

        <PagerStyle Mode="NextPrevAndNumeric" />

    </MasterTableView>

</telerik:RadGrid>

    protected void RadGridData_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)

        {

            if (e.Item is GridFilteringItem)

            {

                GridFilteringItem filterItem = (GridFilteringItem)e.Item;

                RadComboBox combo = (RadComboBox)filterItem["Caption"].FindControl("RadComboBoxCaption");

                combo.DataSource = dataTable; // this datatable is also used for binding data for table

                combo.DataBind();

                combo.AutoPostBack = true;

            }

        }

Pavlina
Telerik team
 answered on 12 Aug 2011
2 answers
442 views
I have Master grid when i selected row based on selcted row i have display more than two rad grids based on selected row for these rad grid i have add ,edit delete when i click add link it is oen rad window addd adding record and page reload but i dont want to reload page i want refresh which grid is i added recoed for that i have use following code

 <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                    </UpdatedControls>
            </telerik:AjaxSetting>
      <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="grdFiles">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="grdFiles" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="grdResource">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="grdResource" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="grdMessages">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="grdMessages" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="grdTasks">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="grdTasks" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

in code behind i wrote like this 

 protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
    {
        if (e.Argument == "Rebind")
        {
           
            RadGrid1.MasterTableView.SortExpressions.Clear();
            RadGrid1.MasterTableView.GroupByExpressions.Clear();
            RadGrid1.Rebind();
           grdFiles.MasterTableView.SortExpressions.Clear();
            grdFiles.MasterTableView.GroupByExpressions.Clear();
           grdFiles.Rebind();


            grdResource.MasterTableView.SortExpressions.Clear();
            grdResource.MasterTableView.GroupByExpressions.Clear();
            grdResource.Rebind();


            grdMessages.MasterTableView.SortExpressions.Clear();
            grdMessages.MasterTableView.GroupByExpressions.Clear();
            //grdMessages.Rebind();
           
        }
        else if (e.Argument == "RebindAndNavigate")
        {
                RadGrid1.MasterTableView.SortExpressions.Clear();
            RadGrid1.MasterTableView.GroupByExpressions.Clear();
            RadGrid1.MasterTableView.CurrentPageIndex = RadGrid1.MasterTableView.PageCount - 1;
            RadGrid1.Rebind();
            grdFiles.MasterTableView.SortExpressions.Clear();
            grdFiles.MasterTableView.GroupByExpressions.Clear();
            grdFiles.MasterTableView.CurrentPageIndex = RadGrid1.MasterTableView.PageCount - 1;
            grdFiles.Rebind();
       
     
        }
    }

Please help me how to reslove this issue
Maria Ilieva
Telerik team
 answered on 12 Aug 2011
3 answers
182 views
Hello,
I have a template column which contains combobox with treeview inside, as described here. But, as it's all in grid TemplateColumn, I don't want those trees to load their content on initial page load, because this will make page too heavy. So I populate it from web service when user opens a dropdown box. Here is my javascript code:

var refCbTree;
var refCb;
function ReferenceComboBoxOpeningHandler(sender, args) {
    refCb = sender;
    refCbTree = $find(sender.get_attributes().getAttribute("treeID"));
    service.LoadReferenceRoot(sender.get_attributes().getAttribute("refID"), onRequestNodesSuccess);  
}
 
function onRequestNodesSuccess(result) {
    if (!refCbTree) return;
    refCb.trackChanges();
    refCbTree.trackChanges();
    for (i = 0; i < result.length; i++) {
        var node = new Telerik.Web.UI.RadTreeNode();
        node.set_text(result[i].Text);
        node.set_value(result[i].Value);
        refCbTree.get_nodes().add(node);
    }
    refCbTree.commitChanges();
    refCb.commitChanges();
}

So when service returns nodes, all nodes seem to be populated in tree, but tree won't resize and so with combobox. Attached is screenshot of what I see.
Is that possible to resize both controls to reveal their contents after loading nodes?
Thank you.
Dimitar Terziev
Telerik team
 answered on 12 Aug 2011
2 answers
98 views
Hello ... I built following simple chart binding to a sql datasource (stored procedure / pivot table)

<telerik:RadChart
                    ID="RC_Line1" runat="server"
                    DataSourceID="SDS_Chart_Line1"
                    DefaultType="Line"
                    Skin="Office2007"
                    AutoLayout="True"
                    SeriesPalette="Pal1"
                    Height="600px"
                    Width="800px"
                    IntelligentLabelsEnabled="True">
                    <CustomPalettes>
                        <telerik:Palette Name="Pal1">
                            <Items>
                                <telerik:PaletteItem MainColor="Yellow" SecondColor="Black"></telerik:PaletteItem>
                                <telerik:PaletteItem MainColor="Blue" SecondColor="Black"></telerik:PaletteItem>
                                <telerik:PaletteItem MainColor="Red" SecondColor="Black"></telerik:PaletteItem>
                                <telerik:PaletteItem MainColor="Orange" SecondColor="Black"></telerik:PaletteItem>
                                <telerik:PaletteItem MainColor="Green" SecondColor="Black"></telerik:PaletteItem>
                                <telerik:PaletteItem MainColor="Cyan" SecondColor="Black"></telerik:PaletteItem>
                                <telerik:PaletteItem MainColor="Magenta" SecondColor="Black"></telerik:PaletteItem>
                                <telerik:PaletteItem MainColor="Gray" SecondColor="Black"></telerik:PaletteItem>
                                <telerik:PaletteItem MainColor="FloralWhite" SecondColor="Black"></telerik:PaletteItem>
                                <telerik:PaletteItem MainColor="Turquoise" SecondColor="Black"></telerik:PaletteItem>
                            </Items>
                        </telerik:Palette>
                    </CustomPalettes>
                    <Appearance Border-Visible="False"></Appearance>
                    <ChartTitle>
                        <Appearance>
                            <FillStyle MainColor=""></FillStyle>
                        </Appearance>
                        <TextBlock Text="Pappas AUT">
                            <Appearance TextProperties-Font="Arial, 18px" TextProperties-Color="Black"></Appearance>
                        </TextBlock>
                    </ChartTitle>
                    <Legend>
                        <Appearance Position-AlignedPosition="Right">
                            <ItemTextAppearance TextProperties-Color="Black"></ItemTextAppearance>
                            <ItemMarkerAppearance Figure="Square"></ItemMarkerAppearance>
                            <Border Visible="False" />
                        </Appearance>
                    </Legend>
                    <PlotArea>
                        <XAxis DataLabelsColumn="Year" LayoutMode="Normal"></XAxis>
                        <YAxis><Appearance MinorGridLines-Visible="False"></Appearance></YAxis>
                    </PlotArea>
                </telerik:RadChart>


My problem is, that column "year" is displaying on the yaxis (values 2005, 2006 ...) ... if I change the sql statement to
"SELECT 'Y' + CONVERT(VARCHAR(4),YEAR) as Year" the issue is gone.

Thank you...
Oliver
Top achievements
Rank 1
 answered on 12 Aug 2011
32 answers
641 views
Hello people,

I have a RadGrid that allow multiple selection...What i need is after the user select a few rows and after click on a button("DONE") I want to change that rows color for example to red and allow the reverse action...

For final I need to count  in real time, How many rows are Red(DONE) and how many aren't and show a dialog to inform it.

this is my RadGrid on aspx page:

div>
        <telerik:RadGrid ID="RadGrid1" runat="server" GridLines="None" AllowPaging="True"
            AllowSorting="True" AutoGenerateColumns="False" ViewStateMode="Disabled" Width="97%"
            enableajax="True" CssClass="productsGrid" CellSpacing="0" AllowFilteringByColumn="True"
            ShowFooter="True" Skin="Black" AllowMultiRowSelection="True" OnItemCommand="RadGrid1_ItemCommand"
            OnGridExporting="RadGrid1_GridExporting" OnNeedDataSource="RadGrid1_NeedDataSource">
            <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
            <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True">
                <Selecting AllowRowSelect="True" />
            </ClientSettings>
            <MasterTableView GridLines="None" Width="100%" ViewStateMode="Disabled" CommandItemSettings-ShowExportToCsvButton="True"
                CommandItemSettings-ShowAddNewRecordButton="false" CommandItemDisplay="Top">
                <Columns>
                    <telerik:GridBoundColumn DataField="SequencialNumber" HeaderText="SequencialNumber"
                        UniqueName="SequencialNumber" SortExpression="SequencialNumber">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Priorities.Priority" HeaderText="Priority" UniqueName="Priority"
                        FilterControlAltText="Filter Priority column" SortExpression="Priority" DataType="System.Int32">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Staging.Process" HeaderText="Staging" UniqueName="Process"
                        SortExpression="Process" FilterControlAltText="Filter Process column">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="SupplierCode" HeaderText="SupplierCode" UniqueName="SupplierCode"
                        SortExpression="SupplierCode" FilterControlAltText="Filter SupplierCode column">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="MessageStatus" HeaderText="MessageStatus" UniqueName="MessageStatus"
                        SortExpression="MessageStatus" FilterControlAltText="Filter MessageStatus column">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="DocumentType" HeaderText="DocumentType" UniqueName="DocumentType"
                        FilterControlAltText="Filter DocumentType column" SortExpression="DocumentType">
                    </telerik:GridBoundColumn>
                    <telerik:GridDateTimeColumn UniqueName="InvoiceCreationDate" DataField="InvoiceCreationDate"
                        HeaderText="InvoiceCreationDate" FilterControlAltText="Filter InvoiceCreationDate column"
                        SortExpression="InvoiceCreationDate">
                        <FilterTemplate>
                            <telerik:RadDatePicker ID="RadDatePicker1" runat="server">
                            </telerik:RadDatePicker>
                        </FilterTemplate>
                    </telerik:GridDateTimeColumn>
                    <telerik:GridBoundColumn DataField="SupplierVatNumber" FilterControlAltText="Filter SupplierVatNumber column"
                        HeaderText="SupplierVatNumber" SortExpression="SupplierVatNumber" UniqueName="SupplierVatNumber">
                    </telerik:GridBoundColumn>
                </Columns>
                <ExpandCollapseColumn Visible="False">
                    <HeaderStyle Width="19px"></HeaderStyle>
                </ExpandCollapseColumn>
                <RowIndicatorColumn Visible="False">
                    <HeaderStyle Width="20px" />
                </RowIndicatorColumn>
            </MasterTableView>
            <FilterMenu EnableImageSprites="False">
            </FilterMenu>
            <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
            </HeaderContextMenu>
        </telerik:RadGrid>

this is my code behind:
public partial class InvoicesScalingDefault : Microsoft.Practices.CompositeWeb.Web.UI.Page, IInvoicesScale
    {
        private InvoicesScalePresenter _presenter;
  
  
        public System.Collections.Generic.IList<Data.SapDocuments> SapDocuments
        {
            get;
            set;
        }
  
  
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                this._presenter.OnViewInitialized();
            }
            this._presenter.OnViewLoaded();
  
  
                        //string userLogin = Page.User.Identity.Name;
  
        }
  
        [CreateNew]
        public InvoicesScalePresenter Presenter
        {
            set
            {
                this._presenter = value;
                this._presenter.View = this;
            }
        }
  
        private void LoadData()
        {
            //Popular dados na Radlist
  
            SapDocumentsBO sapDocs = new SapDocumentsBO();
  
            string user = Page.User.Identity.Name.Substring(Page.User.Identity.Name.IndexOf("\\") + 1);
  
            if ((user == "xxx") || (user == "xxx"))
            {
                this.SapDocuments = sapDocs.GetSapDocuments();
                RadGrid1.DataSource = this.SapDocuments;
            }
            else
            {
                this.SapDocuments = sapDocs.GetSapDocumentsByUser(user);
                RadGrid1.DataSource = this.SapDocuments;
            }
  
        }
  
        protected void RadGrid1_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            LoadData();
        }
  
  
        /// <summary>
        /// Export de todos os SequencialNumber da tabela para .csv
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void RadGrid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
        {
            if (e.CommandName == Telerik.Web.UI.RadGrid.ExportToCsvCommandName)
            {
                RadGrid1.MasterTableView.Columns.FindByUniqueName("SequencialNumber").Visible = true;
                RadGrid1.ExportSettings.IgnorePaging = true;
  
                int count = 0;
                foreach (GridColumn column in RadGrid1.Columns)
                {
                    if (column.Visible)
                    {
                        if (count > 0)
                            column.Visible = false;
                        else
                            count++;
                    }
                }
  
            }
        }
  
        /// <summary>
        /// Método para formatar o sequencialNumber
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void RadGrid1_GridExporting(object sender, GridExportingArgs e)
        {
            e.ExportOutput = e.ExportOutput.Replace("\"\r\n\"", "\"\r\n\"'");
        }
  
    }
}
Ricardo
Top achievements
Rank 1
 answered on 12 Aug 2011
3 answers
99 views
Hi!

I use grouping and paging in my grid. Sometimes a group will continue on the next page(s).

I wonder if anyone knows of a simple way to analyze a GridGroupHeaderItem to find out if the group either continues from the previous page or continues on the following page.

I know that I can analyze the DataCell.Text attribute but since my grid can be translated into several languages it might be a bit tricky.

Thanks
/Mats
Tsvetina
Telerik team
 answered on 12 Aug 2011
2 answers
77 views
Hello.

I have a problem with grid layouts.I use Webblue skin in my project.In most of pages,grids appear like normal but some of them just disrupting.Look at skin and pagings.Using same grid skin css all of them.

Please help me to solve this problem.
Pronic
Top achievements
Rank 1
 answered on 12 Aug 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?