Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
163 views
Hi,

I have a hierarchical  grid, which shows the list of Orders Closed for the Year > Month > Order Number fashion.
That is the first level grid will have the list of years which the orders are created in descending order. For e.g., 2013, 2012, 2011 etc
The second level grid will show the Months for the Orders created. For e.g., January, February, March etc..
The third level grid will show the Order Numbers. For e.g, 1000, 1001, 1002 etc. 
My grid ASPX code is as below:
<Telerik:RadGrid ID="rgYears" runat="server" AutoGenerateColumns="False" CellSpacing="0"
     Width="200px" GridLines="None" Skin="Office2007" Font-Names="Calibri,Arial" AllowSorting="true">
     <MasterTableView DataKeyNames="DateClosedYear" ShowHeader="false">
         <Columns>
             <Telerik:GridBoundColumn DataField="DateClosedYear" HeaderText="Year" UniqueName="DateClosedYear">
             </Telerik:GridBoundColumn>
         </Columns>
         <SortExpressions>
             <Telerik:GridSortExpression FieldName="DateClosedYear" SortOrder="Descending" />
         </SortExpressions>
         <DetailTables>
             <Telerik:GridTableView runat="server" Name="MonthDetails" DataKeyNames="DateClosedMonth"
                 Width="176px" NoDetailRecordsText="No Child Records" ShowHeader="false">
                 <Columns>
                     <Telerik:GridBoundColumn DataField="DateClosedMonthName" HeaderText="Month" UniqueName="DateClosedMonth">
                     </Telerik:GridBoundColumn>
                 </Columns>
                 <ParentTableRelation>
                     <Telerik:GridRelationFields DetailKeyField="DateClosedYear" MasterKeyField="DateClosedYear" />
                 </ParentTableRelation>
                 <DetailTables>
                     <Telerik:GridTableView runat="server" Name="OrderDetails" DataKeyNames="OrderNumber"
                         Width="143px" NoDetailRecordsText="No Child Records" ShowHeader="true">
                         <Columns>                                           
                             <Telerik:GridButtonColumn ButtonType="LinkButton" CommandName="SelectOrderNumber"
                                 DataTextField="OrderNumber" FilterControlAltText="FilterOrderNumber column" HeaderText="Order Number"  UniqueName="OrderNumber" SortExpression="OrderNumber" ShowSortIcon="false">
                             </Telerik:GridButtonColumn>
                         </Columns>
                         <ParentTableRelation>
                             <Telerik:GridRelationFields DetailKeyField="DateClosedMonth" MasterKeyField="DateClosedMonth" />
                         </ParentTableRelation>
                     </Telerik:GridTableView>
                 </DetailTables>
             </Telerik:GridTableView>
         </DetailTables>
     </MasterTableView>
 </Telerik:RadGrid>


I store the Order number when ever the user cilcks on it to see the details. But when the user comes back, I want to show him the last Order number he accessed which I could do with the below code.
'rgYears dataGrid is already databound
'Get all the Months and Years for Orders Closed
'The below section of the code is called at Page Load
Dim OrdersMonthYear = dHelper.OrdersClosedMonthYear(oNumber) 'Get the Month and Year of the last accessed Order
If (rgYears.MasterTableView.Items.Count > 0) Then
    Dim rgYearsItem As GridDataItem = rgYears.MasterTableView.FindItemByKeyValue("DateClosedYear", OrdersMonthYear.DateClosedYear)
    If Not IsNothing(rgYearsItem) Then
        rgYearsItem.Expanded = True
        Dim rgMonthsItem As GridDataItem = rgYearsItem.ChildItem.NestedTableViews(0).FindItemByKeyValue("DateClosedMonth", OrdersMonthYear.DateClosedMonth)
        If Not IsNothing(rgMonthsItem) Then
            rgMonthsItem.Expanded = True
            Dim rgOrdersItem As GridDataItem = rgMonthsItem.ChildItem.NestedTableViews(0).FindItemByKeyValue("OrderNumber", oNumber) 'Last Accessed Order Number from the table
            If (Not IsNothing(rgOrdersItem)) Then
                rgOrdersItem.Selected = True
            End If
        End If
    End If
End If

I am facing problems with the Expand Collapse. I need to Collapse all the expanded grids when the user clicks on Expand. If the last accessed Order Number is of the expanded Year > Month, I want that row to be selected.

For e.g., Order 1003 was closed on 2013 > July. So when I click August, July should be Collapsed and August Month should be shown. Also when I expand July, August should be closed,  July must be expanded and select the Order number 1003.
Angel Petrov
Telerik team
 answered on 04 Oct 2013
1 answer
129 views
I'm building menus in code.  I need to be able to set the menu item image, but the only way I see to do this is by providing a URL string.

The problem is that the images are embedded resources, not separate files on the file system.  So I would like to be able to do something like...

Assembly assembly = Assembly.GetExecutingAssembly();
Stream imageStream = assembly.GetManifestResourceStream(ResourceName);
                                     
menuItem.ImageUrl(or other property) = new Bitmap(imageStream);

Obviously that won't work.  Is there a way to do this by providing the image data directly rather than a URL to a file?
Marbry
Top achievements
Rank 1
 answered on 04 Oct 2013
2 answers
57 views
I'm using the bar chart.  My current dataset has 8 entries in it, dates in the range of Sept 2nd through Oct 2nd.  When I display the chart I expect there to only be 8 sets of bars.  Instead it is showing every date in between.  I don't want that.
Glenn
Top achievements
Rank 1
 answered on 04 Oct 2013
1 answer
100 views
Hi,

I have implemented a two level radmenu on our website and trying to render a secondary menu in case javascript is disabled on client's browser. I want this second menu to appear under the main menu only if javascript is disabled on the browser, so I am rendering this second radmenu inside <noscript> tag. It works fine as expected when javscript is disabled, and also works fine (menu doesn't appear) if javasript is enabled.
However, I get a javascript error (obviously when it's enabled) :
Error: Sys.ArgumentException: Value must not be null for Controls and Behaviors.
Parameter name: element
By looking at the Call Stack of the browser's developers tool, I think it is due to the following script that gets rendered automatically by telerik on the page (I have trimmed down the syntax)

Sys.Application.add_init(function() {
    $create(Telerik.Web.UI.RadMenu, {"_childListElementCssClass":null,"_enableItemImagesPreloading":true,"_flow":0,"_skin...;
});

It is definitely something to do with radmenu inside <noscript> tag, as if I render it without this tag, and with javascript enabled on browser, everything works fine.

I am using IE 8 with compatibility mode turned on.

Thanks in advance

Kam
Dimitar Terziev
Telerik team
 answered on 04 Oct 2013
1 answer
221 views
Hello Telerik,
I am using telerik HTML charts. I am facing one issue to show Large Chart title in multiple lines. (Chart Title+ Sub Title). I am unable to get solution to show chart title in multiple lines. Initially I was using Rad Charts and this is very much possible with Rad Charts. 
So is there any way to split large chart title in multiple lines using telerik HTML charts?


Thanks,
Parimal
Marin Bratanov
Telerik team
 answered on 04 Oct 2013
35 answers
1.1K+ views
Hello everyone,

Can some one please help in solving this issue, I have a radgrid and using automatic updating/deleting/inserting and also using "edit form" provided by the grid. I have 2 comboboxes in my editform that i would like them to be related to each other. One combobox is the country the other is "state/province" depending if ur in Canada or the US. So if u select the country then the other combobox gets filled with appropriate values. I have looked every where and can't find a solution.

Thanks in advance for any help.

Reda.
Shinu
Top achievements
Rank 2
 answered on 04 Oct 2013
2 answers
275 views
I have a grid and one of the cells is set as such

<rad:GridTemplateColumn AllowFiltering="False" UniqueName="EditLink" Groupable="false">
  <ItemTemplate>
    <a href="EditClient.aspx?ClientID=<%# Eval("ClientID")%>">
       <img alt="Edit Client" border="0" src="" title="Edit Client" />
   </a>
 </ItemTemplate>
 <HeaderStyle Width="20px" />
</rad:GridTemplateColumn>

What I am trying to do is set the image source based on a value in the grid at run time.

I assume ItemDataBound is the way to go but how do I get down to the image of the anchor in the item template


Eric Klein
Top achievements
Rank 1
 answered on 04 Oct 2013
4 answers
157 views
After selecting a file for upload, is it possible to shorten the displayed filename?

So if a user selects veryveryverylongfilename.pdf, can I display

veryveryverylong...  [x remove]

but still save it as veryveryverylongfilename.pdf. I have a limited space where I have placed the control and if the filename is too long my formatting gets thrown off.



thnx
Peter
Top achievements
Rank 1
 answered on 04 Oct 2013
3 answers
114 views
Hi,

I have a requirement like the first column list out the features and the other columns lists out the user selected products and there by user can compare the features against opted products. Since the product columns are dynamic, I have confusion on how to implement. What is the best approach ?


Thanks,
Stalin. 
Eyup
Telerik team
 answered on 04 Oct 2013
3 answers
62 views
Hello,

I have a Radgrid bound to a data source:
<radG:RadGrid ID="grdOthers" runat="server" DataSourceID="odsOthers"...>
..and a user control which contains a complex popup for adding a new record to the data source
<ucAutreActivite:AutreActivite ID="PopupAutreActivite"...>
In the user control the button which does the job:
<asp:ImageButton ID="btnValiderPopupAjouterActivite"...>

I also manually set in the user control the Ajax context between the button and the parent grid (which is a property of the user control), and it seems that it appears well in the View Source code:
window["RadAjaxManagerPlanningGrid"] = new RadAjaxManager(...{InitControlID : "PopupAutreActivite_btnValiderPopupAjouterActivite",UpdatedControls : [{ControlID:"PopupAutreActivite_AjouterActivitePopup",PanelID:""},{ControlID:"grdOthers",PanelID:""}]}...)

The problem is although that, after pressing the button which inserts a new value (and this works OK), the grid is not refreshed.
Am I missing something?

Thank you

Maria Ilieva
Telerik team
 answered on 04 Oct 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?