Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
62 views
Hello,

I am new to using RadControls. I do get the concept of having to cast a nested control using the .FindControl method. However, I am noticing that if I wish to start coding for an event for a button nested inside of a RadControlPanel, for example, since I can not see my button listed as an available control, I can not view and select any of its events either.

I do notice that in a tutorial, there is an example showing how events may be wired up to a nested control, however I am unsure how one comes up with the first block of say the Button_Click event. I am hoping coding for all nested controls will be as easy as coding with .net has always been... I want to be able to choose the "Click" event of my Button and then begin coding with the Button_Click event code block being generated as it always has been. I definitely do NOT want to have to copy and paste this from any where else, or start coding with the control outside of the panel and then simply move the control inside of the panel when done. This seems awkward and a step backward and I am really hoping there is a better way to go about this. If not, this would likely be a deal breaker for us.

Thanks,
Nelson
Nikolay Tsenkov
Telerik team
 answered on 14 Dec 2010
1 answer
152 views
I'm really struggling with this and am sure it's a case of being too deep in it to see the solution...

I'm adding an unknown number of PanelBar items to a RadPanelBar and for each one I'm displaying a RadGrid, essentially giving a user a list of categories (the RadPanelBar items) and a list of items in each category below (in the RadGrid).

The RadGrids need to display static data about each line (part number, description and unit cost) along with a textbox so the user can pick a quantity, and then have a calculated column display the unit cost multiplied by the textbox value (obviously validated to be a number)

However, while I can build the RadPanelBar, PanelBar items, build and attach the RadGrid to each PanelBar, data bind the RadGrids and display the static columns in each one, I simply cant see how to add the textboxes or how to work out what the datafields should be for the calculated column.

If anyone has a sample script (csharp pref) of how to add a textbox column and a calculated column that uses the textbox column then I;d REALLY appreciate it.

Thanks,
Karl
Tsvetina
Telerik team
 answered on 14 Dec 2010
1 answer
123 views
Hi,

I have added some javascript to the filter button that appears at the side of the text box on RAD Grid filter to basically clear the filter when the user clicks it rather than bring a menu down etc.  Heres the code I used:

<ClientSettings>
     <ClientEvents OnFilterMenuShowing="filterMenuShowing" />
</ClientSettings>

function
filterMenuShowing(sender, args) {
    var filterRow = args.get_tableView().get_tableFilterRow();
    var columnName = args.get_column().get_uniqueName();
    var cell = args.get_tableView()._getCellByColumnUniqueNameFromTableRowElement(filterRow, columnName);
    var filterValue = $telerik.findElement(cell, "FilterTextBox_" + columnName).value;
      
    args.set_cancel(true);
    args.get_tableView().filter(columnName, "", "NoFilter");
}


This works perfect first time round, I can enter a letter then filter the grid, then click the button and it clears the textbox and refreshes the grid to it's non filtered state. The problem is it just works the once, once I have click the button the filter clears when I type another a letter and hit return to filter the grid again it dosen't filter to my original setting of "StartsWith".

Thank you.

Craig Mellon
Top achievements
Rank 1
 answered on 14 Dec 2010
3 answers
152 views
I set the fixed width of my radgrid but the last column is cut off.

these are the critical parameters I have set the radgrid:
AllowFilteringByColumn = true;
AutoGenerateColumns = false;
ClientSettings.Scrolling.UseStaticHeaders = true;
MasterTableView.TableLayout = Fixed;

I fixed all ItemStyle.Width and HeaderStyle.Width for each GridTemplateColumn,
and the sum has been reported in the width of radgrid

which property should I set to fix the width?
Pavlina
Telerik team
 answered on 14 Dec 2010
11 answers
126 views
Good day!
I have got such a grid

<telerik:RadGrid  ID="grReport" runat="server" GridLines="None" AllowFilteringByColumn="true" BorderWidth="0" BorderColor="White"
            AllowPaging="True" Culture="ru-RU" AllowAutomaticInserts="True" AllowAutomaticDeletes="false" AllowAutomaticUpdates="True" AllowMultiRowSelection="false"
            AllowSorting="True" ShowGroupPanel="true" Skin="Office2007"  AutoGenerateColumns="False" PageSize="100"
            EnableHeaderContextMenu="true" EnableHeaderContextFilterMenu="false"        
            Width="100%" Height="100%" GroupPanel-Width="100%" CssClass="MyGrid" onitemdatabound="grid_ItemDataBound">
        <GroupingSettings CaseSensitive="false" />        
        <MasterTableView TableLayout="Auto">
            <Columns>
                <telerik:GridBoundColumn ReadOnly="True" DataField="sales_id" HeaderText="Аптека" SortExpression="sales_id" UniqueName="sales_id" Visible="True" />
                <telerik:GridBoundColumn ReadOnly="True" DataField="preparation_name" HeaderText="Препарат" SortExpression="preparation_name" UniqueName="preparation_name" Visible="True"  />
                <telerik:GridBoundColumn ReadOnly="True" DataField="price_retail" HeaderText="Цена" SortExpression="price_retail" UniqueName="price_retail" Visible="True"  />
                <telerik:GridBoundColumn ReadOnly="True" DataField="avg_price" HeaderText="Средняя цена" SortExpression="avg_price" UniqueName="avg_price" Visible="True"  />
            </Columns>            
         </MasterTableView>    
         <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True" AllowDragToGroup="True">
            <Resizing  AllowColumnResize="true" AllowRowResize="true"/>
            <Selecting AllowRowSelect="true" />
            <ClientEvents OnRowContextMenu="RowContextMenu"></ClientEvents>
        </ClientSettings>
        <PagerStyle Mode="NextPrevAndNumeric" />
    </telerik:RadGrid>


And I bind the grid this way:

protected void Page_Load(object sender, EventArgs e)
        {
            var pr = new PriceLoader.PriceLoaderSoapClient();
            byte[] data = pr.GetDataForReport50();
            pr.Close();
            string xml = Decompressor.Decompress(data);
            var ds = new DataSet();
            var stringReader = new StringReader(xml);
            ds.ReadXml(stringReader);
            stringReader.Dispose();
            var table = ds.Tables[0];
            using (var repo = new SalesRepository())
                sales = repo.GetAllSoftVariant();
            grReport.DataSource = table;
            grReport.DataBind();

        }
        protected void grid_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                var item = (GridDataItem)e.Item;
                var templ = (DataRowView)item.DataItem;
                var sales_id = Int32.Parse(templ["sales_id"].ToString());
                var sale = sales.FirstOrDefault(s => s.Id == sales_id);
                item["sales_id"].Text = sale != null ? sale.Name : String.Empty;
            }
        }


Sorting works well.
But filtering do not =(
Please can you tell me  what can I do to make filtering work?

yours respectfully, Lina
Pavlina
Telerik team
 answered on 14 Dec 2010
2 answers
73 views
Hello All,
So looks like menu on my dev machine http://clip2net.com/s/FpmH
When I copy-past project to production machine menu becomes http://clip2net.com/s/Fpmt 
Who can advise how to fix this?
Michael
Top achievements
Rank 1
 answered on 14 Dec 2010
3 answers
117 views
I'm going ever so slightly mad.

I'm using Telerik Q1 2010 (Telerik.Web.UI.dll version 2010.1.519.35) in a EpiServer solution (CSM5).

Several userControls (generic controls - not EPiServer controls) use one or more Telerik components.
I've made custom skins, which are referenced in the MasterPage file.

The first of two problems:

I'm totally uanble to make a RadGrid use a new skin. It's referenced in the MasterPage file right next to the old skin:

<link href="~/Templates/Public/Styles/Grid.Different.css" rel="stylesheet" type="text/css" runat="server"/>
<link href="~/Templates/Public/Styles/Grid.SpotPrice.css" rel="stylesheet" type="text/css" runat="server"/>

When set Skin="Different" EnableEmbeddedSkins="false", the grid is rendered completely without any formatting.
Set back to Skin="SpotPrice" EnableEmbeddedSkins="false", everything works.

Grid.Different.css has currently the exact same content as Grid.SpotPrice.css, with the exception of the internal naming:
".RadGrid_Different .rgMasterTable", etc.

Why is it completely impossible to make the radgrid find the new skin/css???
It made no difference to reference the css in the page in which the user control is referenced, compared to referencing
it in the master page.

The second problem:

Even if I settle for using the old skin - because at least I'm able to reference it - I'm unable to format everything correctly.

More precisely, the section

.RadGrid_SpotPrice .rgHeader,
.RadGrid_SpotPrice th.rgResizeCol
{
...
}

allows me to set the background and font-size of the header row of the grid. However, I can't find a way to set the font-weight.
It is completely ignored, and Firebug lists this as the top level css formatting:

.RadGrid .rgHeader, .RadGrid th.rgResizeCol {
    font-weightnormal;
    padding-bottom4px;
    padding-top5px;
    text-alignleft;
}

I'm unable to find where this css class - or indeed any "font-weight: normal" anywhere, but it's overriding every attempt I make at controlling the text of the header cells. Firebug lists the location of this css data as "http://localhost:1876/WebResource.axd?d=xK61nSE_t_j8tJQDQ5B9RsXqY0GVn0S9b4vKwY1ZuXsDXjk3WXwX8XeOyen9WIl-rEWY2bbVk4m7l4v0GOCzBU6ybV7OhG1m_uq5UNg9v2wqqGtQE5lyh_6GaRuspiuPnKAyWA2&t=634097737580000000".

What's going on here?

It should really be simple - make a new skin, reference it, and format it.

http://www.telerik.com/help/aspnet-ajax/grdcreatingnewskins.html or http://demos.telerik.com/aspnet-ajax/grid/examples/styles/headerfooterpagerstyles/defaultcs.aspx doesn't use any ".Controltype class prefix" such as ".RadGrid", but it can't have anything to do
with anything, since both of my CSS files use the same prefixes.

Any ideas? Anyone?
Per Granaune
Top achievements
Rank 1
 answered on 14 Dec 2010
1 answer
118 views
All,

I am trying to figure out a way of requiring a file to be uploaded when doing an insert. I have the plumbing all connected in the ItemCreated event of the grid, but I can't seem to hook the RequiredFieldValidator to the RadUpload control in the Edit template.

I thought about using a custom validator instead, but I still can't seem to figure out how to get a hold of the RadUpload control in the custom validator event.

Can anyone provide some suggestions and snippets to get me past this?

Thanks,
jax
Craig Mellon
Top achievements
Rank 1
 answered on 14 Dec 2010
22 answers
1.4K+ views
I want to show a radTooltip for each row of a radGrid individualy for a GridButtonColumn. So if user moves mouse over image of GridButtonColumn I have to determine the row and show LoadOnDemand tooltip with radTooltip Manger with information of correct row. Is this possible? Are there totorials or examples available, I couldn't find any?
marbleblue
Top achievements
Rank 1
 answered on 14 Dec 2010
4 answers
116 views
Hello,

My problem is that commands like itemupdated are not firing when i add radgrid to sharepoint 2007 (wss3).

I have searched forums and did my own attempts to fix this issue, but without success. For example i tried adding and setting radajax manager, but it still did not fix the issue.

Here is very simple example webpart code where itemupdated, nor ittemcommand events are not firing.

using System;
using System.Runtime.InteropServices;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Serialization;
 
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using Microsoft.SharePoint.WebPartPages;
 
using Telerik.Web.UI;
 
using System.Collections.Generic;
 
using Evlo.SPBase;
using System.Data;
 
 
namespace Evlo.Faktury.WebParts
{
    [Guid("93f15f95-ec1f-4564-9763-dd8599edaef6")]
    public class TSWPRadGridTest : System.Web.UI.WebControls.WebParts.WebPart
    {
        public TSWPRadGridTest()
        {
        }
 
        public RadGrid testGrid = new RadGrid();
 
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
 
            testGrid.NeedDataSource += new GridNeedDataSourceEventHandler(polozkyFakturyGrid_NeedDataSource);
 
            testGrid.UpdateCommand += new GridCommandEventHandler(testGrid_UpdateCommand);
            testGrid.EditCommand += new GridCommandEventHandler(testGrid_EditCommand);
            testGrid.ItemCommand += new GridCommandEventHandler(testGrid_ItemCommand);
        }
 
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
 
             
            testGrid.ID = "testovaciGrid";
            testGrid.AutoGenerateColumns = false;
            testGrid.MasterTableView.EditMode = GridEditMode.InPlace;
 
             
 
            using (SPSite site = new SPSite(SPContext.Current.Site.ID))
            {
                using (SPWeb web = site.OpenWeb(SPContext.Current.Web.ID))
                {
                    testGrid.Columns.Add(new GridBoundColumn
                    {
                        HeaderText = "Testovaci polozka",
                        DataField = "TestovaciField"
                    });
 
                    testGrid.Columns.Add(new GridEditCommandColumn
                    {
                        HeaderText = "Upravit",
                        ButtonType = GridButtonColumnType.LinkButton
                    });
                }
            }
 
            this.Controls.Add(testGrid);
        }
 
        void testGrid_ItemCommand(object sender, GridCommandEventArgs e)
        {
            //e.CommandName
            //throw new NotImplementedException();
        }
 
        void testGrid_EditCommand(object sender, GridCommandEventArgs e)
        {
            //throw new NotImplementedException();
        }
 
        void testGrid_UpdateCommand(object sender, GridCommandEventArgs e)
        {
            //throw new NotImplementedException();
        }
 
        void polozkyFakturyGrid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            DataTable dataTable=new DataTable("testGridDataTable");
 
            DataColumn dc1 = new DataColumn("TestovaciField", System.Type.GetType("System.String"));
            dataTable.Columns.Add(dc1);
 
            DataRow dr1 = dataTable.NewRow();
            dr1["TestovaciField"] = "Test1";
 
            dataTable.Rows.Add(dr1);
 
            RadGrid testGrid = (RadGrid)sender;
            testGrid.DataSource = dataTable;
        }
    }
}

Thank you very much for your help.
Tsvetoslav
Telerik team
 answered on 14 Dec 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?