Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
87 views
I have a grid that is pulling data from a stored procedure. When I export, I want to query another stored procedure that has many additional columns of data returned. Is it possible to bind my grid to a separate datasource prior to exporting to excel or pdf? It is not an option for me to loop through the columns returned and show/hide each one. Any thoughts are appreciated!
Jayesh Goyani
Top achievements
Rank 2
 answered on 10 Dec 2012
2 answers
144 views
Hi Everybody
I m stuck.. my radgrid fetches data from a stored procedure ..(DeptID,SubDeptID,DocSubject,DateUploaded).Can I have a select button (like in asp.net grids) which can be used to fire selectedindexchanged event. On the event of slectedindexchanged I want to fetch the rows values for particular columns..
Thanks  in advance

Animesh Chatterjee
Shinu
Top achievements
Rank 2
 answered on 10 Dec 2012
1 answer
372 views
Hi,
I have a rad grid on my page. I added the below ajax code from one of the examples available in the rad grid site:

<telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="radgrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="radgrid1"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>


I am getting the error "Only one instance of a ScriptManager can be added to the page".

How to fix this?
Thanks
Jayesh Goyani
Top achievements
Rank 2
 answered on 10 Dec 2012
2 answers
221 views
Hi , 
  I am trying to understand how to use a GridButtonColumn as an Edit button to display my FormTemplate. A few questions.  When I use it, the form magicaly appears. Thats great, but the control freak in me is puzzled.  I would like to control when it displays the form ?
  
  1) When I use a GridButtonColumn, I see it comming into the ItemCommand event, but it disappears, then the form appears. Is it the CommandName, CommandArgument or UniqueName that goes somewhere beyond that to display the actual form ? What events, properties or code is used to turn on a FormTemplate ?  Perhaps the code that turns on the form is expecting a certain combination of CommandName, CommandArgument or even UniqueName ?  Or maybe on of the 'on' properties (onInsert, onUpdate, etc) in combination with ?
  2) Is it just good Telerik to always use the GridEditCommandColum for this ?
  3) Why is there no GridDeleteCommandColumn or is the GridEditCommandColumn used for delete - I see there are delete like properties there ? And I have seen code to that effect - Is this the standard ?
  4)  Is there any documentation explaining the how, why and when for the use of the GridEditCommandColumn vs GridButtonColumn ? Or is the GridButtonColumn intended for all other button uses except Edit and Delete ?
  5) There is some code that requires a UniqueID, but the GridEditCommandColum and GridButtonColumn only have the UniqueName.   

   Sorry, looks like I have 10 "?" for 5 question Items :-)

   When I test changing CommandName, CommandArgument or even UniqueName in certain combinations, I am beginning to think there is a conflict of sorts when I use a  GridButtonColumn for Edit vs a GridEditCommandColumn to display the form.
 
 thanks,
 David
Peter
Top achievements
Rank 1
 answered on 10 Dec 2012
4 answers
105 views
I have a RadGrid with using AllowAutomaticUpdates and EntityDataSource and I'd like to set some custom data (or override data) before the item is saved.

How do I do this?

I've tried this, but it doesn't work:

protected void rgUnits_UpdateCommand(object sender, GridCommandEventArgs e)
       {
           GridEditableItem item = (GridEditableItem)e.Item;
           ((RadDatePicker)item["LastModified"].Controls[0]).SelectedDate = DateTime.Now; 
           ((TextBox)item["LastModifiedBy"].Controls[0]).Text = Context.User.Identity.Name;
       }

<telerik:GridDateTimeColumn DataField="LastModified" FilterControlAltText="Filter Last Modified" HeaderText="Last Modified" SortExpression="LastModified" UniqueName="LastModified" ReadOnly="true" AllowFiltering="true" ColumnEditorID="gceSmallDateBox" DataFormatString="{0:dd/MM/yyyy}" PickerType="DatePicker">
                                            </telerik:GridDateTimeColumn>
                                            <telerik:GridBoundColumn DataField="LastModifiedBy" FilterControlAltText="Filter Last Modified By" HeaderText="Last Modified By" SortExpression="LastModifiedBy" UniqueName="LastModifiedBy" ReadOnly="true" AllowFiltering="true">
                                            </telerik:GridBoundColumn>


I don't *need* to have them as Grid Columns, but I figured this is what I'd have to do to get it work.
Peter
Top achievements
Rank 1
 answered on 10 Dec 2012
14 answers
268 views
Hi,

I'm having a problem with the RadGrid and using StaticHeader. When UseStaticHeaders="true", the header and footer get a margin-right of 17px (the size of the vertical scrollbar). This results in an empty/white space next to the footer/header. However, if I decrease the page size to 10, the scrollbar disappears. Now, the margin from the header is removed and gets the full width of the grid. But the margin is not removed from the footer.

Steps to reproduce:

Markup:
<telerik:RadGrid ID="grdData" runat="server" PageSize="20" AllowPaging="true" ShowFooter="true" OnNeedDataSource="grdData_NeedDataSource">
    <ClientSettings>
      <Scrolling AllowScroll="true" UseStaticHeaders="true" SaveScrollPosition="true" />
      <Resizing ClipCellContentOnResize="false" AllowColumnResize="true" AllowResizeToFit="true" EnableRealTimeResize="true" />
    </ClientSettings>
    <MasterTableView AutoGenerateColumns="true">
    </MasterTableView>
  </telerik:RadGrid>

Code behind:
public partial class test : System.Web.UI.Page {
    public class MyDataItem {
      public int Id { get; set; }
      public string Name { get; set; }
    }
 
    protected void Page_Load(object sender, EventArgs e) {
       
    }
 
    protected void grdData_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e) {
      List<MyDataItem> datasource = new List<MyDataItem>();
      for (int i = 0; i < 100; i++) {
        datasource.Add(new MyDataItem() {
          Id = i,
          Name = "name_" + i
        });
      }
 
      grdData.DataSource = datasource;
    }
  }

On initial load, the page size is 20 and the vertical scrollbar, including the whitespaces, it rendered.
Now reduce the pagesize to 10: the vertical scrollbar is gone but the whitespace next to the footer remains.

In this example in doesn't look like a problem (besides it doesn't look nice). However, I'm having a grid with 20 columns and values in the footer. The last value can't be read completely because half of the text is cut of due to the margin.

Is this realy a bug or am I doing something wrong? And is there any workaround?

Thanks.
Pavlina
Telerik team
 answered on 09 Dec 2012
1 answer
118 views
hello,
I' m new in raddevelopment and I'm trying the free Telerik's version
For some reason, I put the radMenu control in an ascx asp.net control and the ascx control is in a masterPage
The basic functions of the menu are working well
But the calling pages are heavy, and it takes several secondes/ minutes to load.
I need to put a waiting message onload
In a normal aspx page, I put the radMenu in an updatepanel, with a updateprogress and there isn't ny problem
But,in the mentioned situation, I tried onclick, onitemclick, onitemdatadound, and every onclient function. I won't be able to fire any waiting message.
Do you have some idea?
Thank you
Pierre
Top achievements
Rank 1
 answered on 09 Dec 2012
3 answers
161 views
My basic question is, every time the Count changes during client-side data binding, it jumps me back to the first page.  Is there any way to prevent this?

Here's a more in-depth description of the problem:

I'm using the RadGrid to display messages with client-side data binding.  A new message arrives on the server every few seconds.  We only keep x hundred messages on the server so once the queue is full old messages fall off the queue as new ones arrive.  Therefore using the standard startRowIndex to keep track of where we are in the grid doesn't work for us.  What is row 20 in one call might be row 19 a few seconds later as the oldest message falls off the queue.  Therefore simply want the next/previous/first/last buttons to jump to the next/previous/first/last group of messages and I'll handle the paging logic with my server code.

Toward that end, I have overridden (using OnItemCreated) the next/previous paging buttons to call my own javascript function for paging -
    function myGridPage(radGridId, dir) {
        pagingDirection = dir;
        $find(radGridId+'_ctl00').page(dir);
    }

Then on data binding I do this:
function RadGridMessages_DataBinding(sender, args) {
        var myMethodArguments = new Object();
        myMethodArguments.pagingDirection = pagingDirection;
        myMethodArguments.maximumRows = args.get_methodArguments().maximumRows;
        args.set_methodArguments(myMethodArguments);
    }

On the server-side I do this:
        [WebMethod(EnableSession = true)]
        public Dictionary<string, object> GetMessages(string pagingDirection, int maximumRows)
        {
<message logic goes here>
            Dictionary<string, object> data = new Dictionary<string, object>();
            data.Add("Data", messages);
            data.Add("Count", totalNumberOfMessages);
            return data;
        }

Everything seems to work fine, except that the "Count" changes often during the first few hours before the server message queue is full.  Every time the Count changes the Telerik client-side code calls set_virtualItemCount() which calls set_currentPageIndex(0).  This move me back to the first page (and triggers a rebind).

a. Am I handing the next/previous page in an appropriate way for my situation or is there a better way to do this.
b. How do I prevent set_virtualItemCount() from kicking me back to the first page every time the count changes?


Amjad
Top achievements
Rank 1
 answered on 09 Dec 2012
0 answers
149 views
Hi Team,

I have very peculiar process.

I am adding in my page on code-behind in the Init of the page a Radcombobox with a dynamic ID. Furthermore I am adding a RadtreeView to it on codebehind with a fix id and with only one node

using this idea:
...
 public void InstantiateIn(Control container)
        {
            RadTreeView tree = new RadTreeView();
            tree.ID = "tv";
            tree.CheckBoxes = true;
            tree.ExpandAllNodes();
            container.Controls.Add(tree);

...

Now my big deal is I want to load that RadTreeView on demand and client-side . My problem came with the JavaScript that is not fiding the controls that have been added on the code behind

I try to add on the load page using a RadCodeBlock the script to find the control but it is not working. Also I tried Sys.Application.add_load(ale)


something like this:
System.Text.StringBuilder sb = new System.Text.StringBuilder();     
            sb.Append(@"<script language='javascript'>");
            sb.Append(@"Sys.Application.add_load(ale);");
            sb.Append(@"alert('Hello World');");
            sb.Append(@"var comboBOX = document.getElementById('<%= 2.ClientID %>'); ");
            sb.Append(@"function ale(){alert(comboBOX);}");
            sb.Append(@"</script>");

Could you help me with an example or some guidance to get the ComboBox that I loaded dynamically with a dynamic ID on Java Script or JQuery. When I get the comobo box how the treeview has a predefined ID I will be able to get it on client-side.

Thank you
            LiteralControl literaJS = new LiteralControl(sb.ToString());
            RadCodeBlockFilterControl.Controls.Add(literaJS);
Denis
Top achievements
Rank 2
 asked on 09 Dec 2012
0 answers
120 views
Hello,
 I am using RadAjaxLoadingPanel to show progress bar on button click. I want to display on page based on id of control. I am using following code to remove background image from class.

  .RadAjax_Office2007 .raDiv
        {
            background-imageurl('') !important;
        }
And on id of control i am showing it like this
    #RadAjaxLoadingPaneldivVital
        {
            background-imageurl("WebResource.axd?d=WSBu9pOMHRl15KsTHWg3T0kmn2YGmMPVvRl2sILKsHrpfxNvrCzaIJl2lpa7x1j9jZKMpkIrN3swdVxt4LudmphTXALh-aA69uNkfQVAWlhNswKa8jAvmaqGRuXJBGaAwBDq-kckfrv9OfQ-kKQJYN2w2wnXp57-m4HO_IOBKP3wUlVUudTpfi9hzwtW4ZIkLXeV2RjIa9Dejcjy16e-mQ2&t=634642303574596967") !important;
            background-repeatno-repeat;
            background-positioncenter;
        }
It woks fine on my machine and progress bar is displaying on page. but on other machine it is not displaying. When i am figuring out using
fire bug it is showing that image is failed to load. I thing each machine generate different background image url. So how I will
use background image url which will be same for all machines.
Ranjan
Top achievements
Rank 1
 asked on 08 Dec 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?