Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
93 views
Hello,

I am having the following client side error when i try to move my radwindow:

Sys.ArgumentTypeException: Object of type 'String' cannot be converted to type 'Number'.
Parameter name: x

Any ideia?

Thanks in advance
David
Top achievements
Rank 1
 answered on 02 May 2008
3 answers
139 views
Hi,

I have seen the example  from :

http://www.telerik.com/DEMOS/ASPNET/Prometheus/ComboBox/Examples/Functionality/ComboInGrid/DefaultCS.aspx

Is it possible to add Insert functionality to the same, Insert button on top of grid.

Or please let me know some options for :

Combo in Grid and Insert Functionality combined.

Thanks in Advance,

Rajoo
Nikolay
Telerik team
 answered on 02 May 2008
1 answer
377 views
Hi

I have a very strange problem. I have been battling for a while now to create a custom filter for a column which holds a combo of images.

I have centralized the code for my systems grids in a helper class, which is used by all the grid instances system wide. Whats happening is I'm injecting my image filled combo into the GridFilteringItem and my combo is posting back correctly -but- the selectedIndexChanged event is not being raised server side.
I am most certainly binding the event handler on item_created and I'm setting the dynamically created controls id, etc.

The procedure I'm following is basically whats described in the rad grid help file here:  ms-help://telerik.radgrid.50.Net2/telerik.radgrid.50.Net2/grdFilteringForChecBoxColumn.html

Code Follows:
(this code lives in the helper class, hence the use of httpContext.current)
        /// <summary> 
        /// Fires when an item was created. 
        /// </summary> 
        /// <param name="sender"></param> 
        /// <param name="e"></param> 
        void _RadGridOnPage_ItemCreated(object sender, GridItemEventArgs e) 
        { 
            if (e.Item.GetType() == typeof(GridEditFormItem)) 
            { 
                SetEditFormCssClass(e.Item.Controls);                 
            } 
 
            //create the custom active col image dropdown filter 
            if (e.Item.GetType() == typeof(GridFilteringItem)) 
            { 
                //create custom filtering dropdown for active col here. 
                GridFilteringItem filteringItem = (e.Item as GridFilteringItem); 
                try 
                { 
                    if (filteringItem["clActive"] == null) return; //exit if the active column does not exist 
                } 
                catch 
                { 
                    return; //if the col doesnt exist exit. 
                } 
 
                //append the filtering cbo to the filter header of the col in the grid. 
                filteringItem["clActive"].Controls.Add(CreateActiveColFilterCbo()); //append the new filtering cbo to the filter row 
                if (HttpContext.Current.Session["activeFilterCellClientId"] != null) 
                { 
                    HttpContext.Current.Session.Add("activeFilterCellClientId", filteringItem["clActive"].ClientID); 
                } 
            } 
        } 
        /// <summary> 
        /// creates the custom filtering cbo with the tick and cross images. 
        /// </summar 
        private RadComboBox CreateActiveColFilterCbo() 
        { 
            RadComboBox cbo = new RadComboBox(); 
            //create the items to hold the images 
            RadComboBoxItem active = new RadComboBoxItem("Active"); 
            RadComboBoxItem inactive = new RadComboBoxItem("Inactive"); 
            RadComboBoxItem nofilter = new RadComboBoxItem("No Filter"); 
            //create and append the images to the items 
            HtmlImage tick = new HtmlImage(); 
            tick.Src = HttpContext.Current.Request.ApplicationPath + "/images/admin-tick-whitebg.GIF"; 
            HtmlImage cross = new HtmlImage(); 
            cross.Src = HttpContext.Current.Request.ApplicationPath + "/images/admin-cross-whitebg.GIF"; 
            active.Controls.Add(tick); 
            inactive.Controls.Add(cross); 
 
            //add the items containing the images to the ctl 
            cbo.Items.Add(active); 
            cbo.Items.Add(inactive); 
            cbo.Items.Add(nofilter); 
            cbo.ID = "activeFilterCbo"; 
            cbo.Width = new Unit(65, UnitType.Pixel); 
            cbo.Skin = "WebBlue"; 
            cbo.AutoPostBack = true; 
            cbo.SelectedIndexChanged += new RadComboBoxSelectedIndexChangedEventHandler(cbo_SelectedIndexChanged); 
 
            return cbo; 
        } 
 
        public void cbo_SelectedIndexChanged(object sender, EventArgs e) 
        { 
            _RadGridOnPage.MasterTableView.Rebind(); 
             
        } 


<radG:RadGrid ID="RadGrid1"  
              runat="server"> 
    <MasterTableView > 
        <Columns> 
            <radG:GridTemplateColumn UniqueName="clActive" AllowFiltering=false> 
                <ItemTemplate> 
                    <asp:Image ID="imgActive"  
                               runat="server" /> 
                    <asp:Label ID="lblActive"  
                               runat="server"  
                               Text='<%# DataBinder.Eval(Container,"DataItem." + comQuest.Common.Constants.Columns.USR_Active) %>'  
                               style="display: none"></asp:Label> 
                </ItemTemplate> 
            </radG:GridTemplateColumn> 
        </Columns> 
        <ExpandCollapseColumn Visible="False" Resizable="False"> 
            <HeaderStyle Width="20px" /> 
        </ExpandCollapseColumn> 
        <RowIndicatorColumn Visible="False"> 
            <HeaderStyle Width="20px" /> 
        </RowIndicatorColumn> 
    </MasterTableView> 
    <ExportSettings> 
        <Pdf PageBottomMargin="" PageFooterMargin="" PageHeaderMargin="" PageHeight="11in" 
            PageLeftMargin="" PageRightMargin="" PageTopMargin="" PageWidth="8.5in" /> 
    </ExportSettings> 
</radG:RadGrid> 

The grids are also created via the helper class via the following code:

/// <summary> 
/// Sets up the databound cols and other grid properties 
/// </summary> 
public void CreateGrid(bool enableAjax, Dictionary<string, bool> ColumnsFilterStatus) 
{ 
    //create the grid             
    _RadGridOnPage.CssClass = "RadGrid"; 
 
    //_RadGridOnPage.PageSize = 5; 
    _RadGridOnPage.AllowPaging = true; 
    _RadGridOnPage.AutoGenerateColumns = false; 
    _RadGridOnPage.Visible = true; 
    _RadGridOnPage.Width = new Unit(98, UnitType.Percentage); 
    _RadGridOnPage.MasterTableView.EditMode = GridEditMode.EditForms; 
    _RadGridOnPage.Skin = "WebBlue"; 
    _RadGridOnPage.MasterTableView.PageSize = 20; 
    _RadGridOnPage.MasterTableView.AutoGenerateColumns = false; 
 
    _RadGridOnPage.HeaderStyle.Font.Size = new FontUnit("8pt"); 
 
    if (enableAjax) 
    { 
        _RadGridOnPage.LoadingTemplateTransparency = 50; 
        _RadGridOnPage.ShowGroupPanel = true; 
        _RadGridOnPage.ClientSettings.AllowDragToGroup = true; 
        _RadGridOnPage.AllowFilteringByColumn = true; 
        _RadGridOnPage.EnableAJAX = true; 
        _RadGridOnPage.EnableAJAXLoadingTemplate = true; 
    } 
    _RadGridOnPage.AllowSorting = true; 
    //_RadGridOnPage.AllowFilteringByColumn = true; 
    _RadGridOnPage.PagerStyle.CssClass = "gridpager"; 
    _RadGridOnPage.PagerStyle.Mode = GridPagerMode.NumericPages; 
 
    //setup the add new entry at the top of the grid 
    if (_EnableRecordAdd) 
    { 
        _RadGridOnPage.MasterTableView.CommandItemSettings.AddNewRecordText = _AddNewRecordText; 
        _RadGridOnPage.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.Top;                 
    } 
    else 
    { 
        _RadGridOnPage.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None; 
    } 
 
    // Set data source. 
    _RadGridOnPage.DataSource = _MainDataSet; 
    _RadGridOnPage.DataMember = _DataTableNameAsDatasource;   // The datatable to be the datasource 
 
    //add grid cols 
    AddGridCols(_RadGridOnPage.MasterTableView, ColumnsFilterStatus); 
 
    if (EnableSimpleDetailView) 
    { 
        if (_RadGridOnPage.MasterTableView.DetailTables.Count > 0) 
        { 
            AddGridCols(_RadGridOnPage.MasterTableView.DetailTables[0], ColumnsFilterStatus); 
        } 
    } 
 
    _RadGridOnPage.DataSource = _MainDataSet; 
    _RadGridOnPage.DataBind(); 
 
    // Add the edit column 
    if (_EnableRecordEdit) 
    {                 
        GridEditCommandColumn editCol = new GridEditCommandColumn(); 
        _RadGridOnPage.MasterTableView.Columns.Add(editCol); 
        editCol.EditText = comQuest.Resources.Resources.GetMessage("RES_Grid_EditColumnEditText"); 
        editCol.OrderIndex = _MainDataSet.Tables[_DataTableNameAsDatasource].Columns.Count + 2; 
    } 
 
    // Add the delete column 
    if (_EnableRecordDelete) 
    { 
        GridButtonColumn butCol = new GridButtonColumn(); 
        _RadGridOnPage.MasterTableView.Columns.Add(butCol); 
        butCol.CommandName = "Delete"; 
        butCol.Text = comQuest.Resources.Resources.GetMessage("RES_Grid_DeleteColumnDeleteText"); 
        butCol.UniqueName = "DeleteColumn"; 
        butCol.OrderIndex = _MainDataSet.Tables[_DataTableNameAsDatasource].Columns.Count + 3; 
        butCol.ConfirmText = comQuest.Resources.Resources.GetMessage("RES_GridDeleteConfirmationMessage"); 
    } 
 
    //format design time columns 
    FormatActiveColumn(_RadGridOnPage.MasterTableView); 
    if (EnableSimpleDetailView) 
    { 
        if (_RadGridOnPage.MasterTableView.DetailTables.Count > 0) 
        { 
            FormatActiveColumn(_RadGridOnPage.MasterTableView.DetailTables[0]); 
        } 
    } 
 
    // Set colours 
    SetColours(); 
 
    // Prevent from jumping to last page after insert 
    _RadGridOnPage.ItemCommand += new GridCommandEventHandler(_RadGridOnPage_ItemCommand);           
} 

and

void ToDoOnNew() 
{ 
    // This event handlers needs to build every time. On load and postback. 
    _RadGridOnPage.NeedDataSource += new GridNeedDataSourceEventHandler(_RadGridOnPage_NeedDataSource); 
    _RadGridOnPage.ItemDataBound += new GridItemEventHandler(_RadGridOnPage_ItemDataBound); 
    _RadGridOnPage.UpdateCommand += new GridCommandEventHandler(_RadGridOnPage_UpdateCommand); 
    _RadGridOnPage.InsertCommand += new GridCommandEventHandler(_RadGridOnPage_InsertCommand); 
    _RadGridOnPage.DeleteCommand += new GridCommandEventHandler(_RadGridOnPage_DeleteCommand); 
    _RadGridOnPage.DetailTableDataBind += new GridDetailTableDataBindEventHandler(_RadGridOnPage_DetailTableDataBind); 
    _RadGridOnPage.ItemCreated += new GridItemEventHandler(_RadGridOnPage_ItemCreated); 
    _RadGridOnPage.Load += new EventHandler(_RadGridOnPage_Load); 
     
    // Make sure all the lists are new and not null. 
    if (_ColumnsToExclude == null) _ColumnsToExclude = new List<string>(); 
    if (_DropdownColumns == null) _DropdownColumns = new List<RadGridHelperDropdownColumn>(); 
    if (_GuidBeingEdited == null) _GuidBeingEdited = new Dictionary<string, Guid>(); 
    if (_ReadOnlyColumnNames == null) _ReadOnlyColumnNames = new List<string>(); 
} 

Any ideas?

Thanks,
Anthony.




Princy
Top achievements
Rank 2
 answered on 02 May 2008
1 answer
150 views
Hi

I was wondering, is it possible to combine bars and lines in the same chart?

Normally I use it to display a moving average or something similar.


Kind regards
Janus
Bartholomeo Rocca
Top achievements
Rank 1
 answered on 02 May 2008
1 answer
119 views
Hi...

We are trying to set our grid up so if the user clicks a "previous" or "next" button it will select the respective record.  When a row is selected, we have a recordselected event that fires and updates other components.  My question is, from the client side, how do you know how many items are in the grid and how would you go about selecting the first, last, previous, and next rows.

Also, we have a grid with items that are grouped by job number.  When the user selects a row is it possible to get the selected item's index from the datatable as opposed to get_itemIndexHierarchical()?

Thanks in advance,

Lars

Yavor
Telerik team
 answered on 02 May 2008
1 answer
115 views
Is there any way to have the scroll arrows in the RadMenu show up only when a certain number of MenuItems are loaded?  I'm currently using GroupSettings-Height, but it doesn't really cut the mustard because I need the menu size to also shrink to the number of items if there are less than a certain number.

For example, my requirement says show scroll arrows after 10 items, and I know each item is 28px, so I am setting GroupSettings-Height around 280px in the markup...  but then if I only have 2 items in the list, the menu is still 280px in height.  I only want it to be 56px... right?

Is there any good way to do this?
Atanas Korchev
Telerik team
 answered on 02 May 2008
3 answers
201 views
Friends,

I have a silverlight control that fires the ajaxRequest event of the RadAjaxManager when canvases are clicked.

The problem I'm having, is I get the above error message if I click between the canvases too quickly.

It seems that $find("<%= RadAjaxManager1.ClientID %>") is "null" and that's what's causing the problem.

Has anyone got a solution for how to queue the requests? Is this the reason I'm getting the problem? I would have thought multiple requests would just cancel each other out. I guess it's the fact that RadAjaxManager1 is coming back 'null' that's concerning me the most.

I'm using master pages.

Cheers,
Daron
Konstantin Petkov
Telerik team
 answered on 02 May 2008
3 answers
134 views
I want to customize how the rows appear and don't know if it's even possible. I have 3 columns at the moment and X number of rows. Given a specific row I want the first two columns to show as normal, however the third column I want to appear below the first two columns and span both of them.

This is how I want each row to appear. Is this possible?
--------------------------------------------
| Start Date              | End Date               |
--------------------------------------------
| 4/29/2008 1:00pm   | 4/29/2008 1:03pm  | 
--------------------------------------------
| Executing step abc...                                |
| Doing some work...                                 |
| Done.                                                      |
--------------------------------------------
Princy
Top achievements
Rank 2
 answered on 02 May 2008
3 answers
89 views
hi

I have this piece of code in the page load event:

im

dtType As New DataTable
Dim daType As New SqlDataAdapter
Dim sqlCmd As New SqlCommand("spSelect", x.getConn)
sqlCmd.CommandType = CommandType.StoredProcedure
sqlCmd.Parameters.Add(
New SqlParameter("@search", SqlDbType.NVarChar, 10)).Value = "All"
sqlCmd.Parameters.Add(New SqlParameter("@Type", SqlDbType.NVarChar, 10)).Value = "All"
daType.SelectCommand = sqlCmd
daType.Fill(dtCourse)
gridType.DataSource = dtType
gridType.DataBind()

This RADgrid has sorting enabled. I set a breakpoint at the page load event.

When the page was loading, yes indeed it hit the breakpoint and i press F11 to step into the code. But the strange thing is that it also step into this code:

<

ItemTemplate>
<a href="#" onclick="openRadWindow('<%#DataBinder.Eval(Container.DataItem,"TypeCode")%>'); return false;">Update</a>
</ItemTemplate>

several times. Same thing would happen every time i did a sort. Why is that so and how to make sure it does not step into this: <a href="#" onclick="openRadWindow('<%#DataBinder.Eval(Container.DataItem,"TypeCode")%>'); return false;">Update</a>
 

Thanks

Yavor
Telerik team
 answered on 02 May 2008
1 answer
144 views
I am trying to insert a record into an empty RadGrid using the ObjectContainerDataSource and a template form.  I receive the error 'GridInsertionObject' does not contain a property.  The grid performs as expected if there is records already in the grid.  I have searched the forum and found the article you recommend for solving the problem but do not see the answer. http://www.telerik.com/help/aspnet/grid/grdErrorMessages.html 

can you elaborate.

Thanks
Princy
Top achievements
Rank 2
 answered on 02 May 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?