Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
254 views
Just wanted to state i think these controls are great!! just having a little trouble adapting.

This is what im trying to do.

protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)   
{         
  
this.TextBox1.Text = GridView1.SelectedRow.Cells[1].Text;
}

but using the new radgrid its different. can someone help? thanks!


-EricPacheco

Veli
Telerik team
 answered on 14 Dec 2010
1 answer
52 views
So I've fixed my other problem with the grid not calling my web service and now things are half working. I've got a background thread that's adding objects to a collection (thread safe) every second, and the grid simply refreshes every second and displays all of these objects. This works fine until there are more than 10 objects in the collection, then the grid stops displaying all of the objects fields except one. Screen shot below:

The EventTime is a DateTime property of the object, so the grid is for some reason displaying that property, but ignoring all of the other properties on all objects after Message 21. Any idea's what's going on?
Iana Tsolova
Telerik team
 answered on 14 Dec 2010
3 answers
74 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
183 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
158 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
169 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
162 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
101 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
155 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-weight: normal;
    padding-bottom: 4px;
    padding-top: 5px;
    text-align: left;
}

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
161 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?