Telerik Forums
UI for ASP.NET AJAX Forum
7 answers
266 views
Is the anything planned to allow for a header and footer in the drop down template? Or is there a way to implement such a feature with the current build?
Mark Kucera
Top achievements
Rank 1
 answered on 13 Feb 2013
4 answers
904 views
Hello, I have an issue with the sort expression feature in the RadGrid.
As said in several post, i'm using the advanced databinding with NeedDataSource to make the sorting works correctly.

This is my grid definitions:
<telerik:RadGrid ID="MyRadGrid" runat="server"
 AllowSorting="true"
 EnableHeaderContextMenu="true"
 Width="900px"
 CssClass="RadGridCustomClass">
                 
  <ClientSettings AllowColumnsReorder="true"
    ReorderColumnsOnClient="true"
    ColumnsReorderMethod="Reorder"
    AllowColumnHide="true" >
      <Resizing AllowColumnResize="true"
        EnableRealTimeResize="true"
        ResizeGridOnColumnResize="true"
        ClipCellContentOnResize="true"
        AllowRowResize="false" />
 </ClientSettings>
             
  <HeaderContextMenu EnableRoundedCorners="true"
    EnableShadows="true"
    OnItemClick="MyRadGrid_HeaderContextMenuClick" />
             
  <MasterTableView AllowMultiColumnSorting="false" 
    AllowCustomSorting="true"
    AllowCustomPaging="true"
    TableLayout="Fixed"
    AutoGenerateColumns="false"
    EnableHeaderContextMenu="true"
    EnableViewState="false" >
    
  <Columns>
    <telerik:GridBoundColumn DataField="ID"
      SortExpression="ID" HeaderText="ID"
      DataType="System.Int32" />
    <telerik:GridBoundColumn DataField="Name"
      SortExpression="Name" HeaderText="Name"
      DataType="System.String" />
    <telerik:GridNumericColumn DataField="UnitPrice" 
      SortExpression="UnitPrice" HeaderText="Unit price"
      DataType="System.Decimal" />
    <telerik:GridBoundColumn DataField="Date"
      SortExpression="Date" DataFormatString="{0:d}" HeaderText="Date"
      DataType="System.DateTime" />
    <telerik:GridCheckBoxColumn DataField="Discontinued"
      SortExpression="Discontinued" HeaderText="Discontinued"
      DataType="System.Boolean" />
  </Columns>
</MasterTableView>
</telerik:RadGrid>

 Pretty simple grid with simple data i load from a list for this test purpose.
On load, i check if the dataSource is nothing, then call Rebind() to call NeedDataSource()
Once its called, i bind my grid with data.

I got this on load....
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  If MyRadGrid.DataSource Is Nothing Then
    MyRadGrid.Rebind()
  End If
End Sub
 
Private Sub MyRadGrid_NeedDataSource(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles MyRadGrid.NeedDataSource
  Dim list2 As New List(Of MyBusinessObject)()
  For j As Integer = 0 To 5
    Dim Product1 As New MyBusinessObject()'Some local data
    Product1.ID = j
    Product1.Name = names(j)
    Product1.UnitPrice = prizes(j)
    Product1.[Date] = dates(j)
    Product1.Discontinued = bools(j)
    list2.Add(Product1)
  Next
  MyRadGrid.DataSource = list2
End Sub
 
Public Sub MyRadGrid_HeaderContextMenuClick(ByVal sender As Object, ByVal e As RadMenuEventArgs)
  If e.Item.Value <> "SortAsc" And e.Item.Value <> "SortDesc" Then
    MyRadGrid.MasterTableView.SortExpressions.Clear()
  End If
  MyRadGrid.Rebind() 'i tried MyRadGrid.MasterTableView.Rebind()
End Sub


The sorting doesnt work well, so i use the HeaderContextMenuClick event to output what's going on...
So my grid has the expression it needs, but the sorting doesnt occur.

So i placed a couple of debug.print... Here what i get after click on "sort asc" on "Unit price" column:
******************************Page load
Page load() data source is nothing... Calling MyRadGrid.Rebind()
MyRadGrid_NeedDataSource()
******************************Page load
Page load() data source is nothing... Calling MyRadGrid.Rebind()
MyRadGrid_NeedDataSource()
'WebDev.WebServer.EXE' (Managed): Loaded 'D:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualBasic\8.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualBasic.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
MyRadGrid_HeaderContextMenuClick() SORT EXPRESSION: Name:UnitPrice Order:Ascending
MyRadGrid_HeaderContextMenuClick() Calling MyRadGrid.Rebind()


Rebind is supposed to call NeedDataSource right? I tried to call MyRadGrid.datasource manualy... but still no result, the grid wont sort.
Plus, i get a empty button (5-8pixel width, 2-3 pixels height) beside the header text after i call Clear sorting.. this happens only in my test, not my project.

I have no idea why this isnt working. Can anyone help me?
Thanks!
Sophie
Top achievements
Rank 2
 answered on 13 Feb 2013
1 answer
90 views
i define a user controls inside other user control and define a 
RadScriptBlock,place script code in it,but script block dont fire.please
 help me.
my code is:

<telerik:RadScriptBlock
ID="RadScriptBlock1" runat="server"> <script type="text/javascript" language="javascript"> function refreshGrid(arg) { alert("1234"); $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind"); } function RowDblClick(sender, eventArgs) { window.radopen("Details.aspx?codemessage=" + eventArgs.getDataKeyValue("codeadvertisment"), "UserListDialog"); } function OpenFileExplorerDialog() { var wnd = $find("<%= ExplorerWindow.ClientID %>"); wnd.show(); } //This function is called from the Explorer.aspx page function OnFileSelected(wnd, fileSelected) { var textbox = $get("<%= UploadPicture.ClientID %>"); textbox.value = fileSelected; } function ShowMessage(sender, args) { var id = args.getDataKeyValue("codeadvertisment"); var wnd = window.radopen("Details.aspx?codemessage=" + id, null); //Get the clicked row var index = args.get_itemIndexHierarchical(); var item = args.get_tableView().get_dataItems()[index]; var rowElement = item.get_element(); //Get coordinates of the row and reposition the window relative to it var bounds = $telerik.getBounds(rowElement); wnd.moveTo(bounds.x + 120 + index * 10, bounds.y - 180); } </script> </telerik:RadScriptBlock>
MasterChiefMasterChef
Top achievements
Rank 2
 answered on 13 Feb 2013
1 answer
129 views
I have a textbox and a button inside an RadAjaxPanel. When I click the button RadAjaxLoadingPanel is displayed and button click event is fired. But now I want to display a confirmation message that button was clicked or just display any message after RadAjaxLoadingPanel stops.

MasterChiefMasterChef
Top achievements
Rank 2
 answered on 13 Feb 2013
7 answers
167 views
I have a RadGrid that contains 31 columns of various data types and widths. I have the width set to 98% so that it shows the horizontal scroll bar and it's working as expected in IE. But in Firefox the horizontal scroll bar is far too wide, even wider than the screen itself, and the grid extends far beyond the edge of the page. If I try to scroll to the right side of the grid the scroll bar hits the right side before the last column comes into view; so it's impossible to see the last few columns in the grid.

The grid is also inside a panel, not sure if that could be a factor; but the application has many grids inside panels and I'm only seeing it on this one page. Any help would be greatly appreciated.

Thanks
Shane
Shane
Top achievements
Rank 1
 answered on 13 Feb 2013
1 answer
98 views
Hi

We use the scheduler and use resource grouping.
Our resourceType is named "employee". When i use this in the DayView - Groupby="employee" this works ok.
Same in the weekview (Grouby = "employee").

But when i want to group together with date this works in the dayview but not in the weekview. 
So our groupby is then :  Groupby=  "Date,employee" 

It rans on jscript error =  this._weekmodels[h.modelIndex].addToBlock(h).
the modelindex is "undefined".
Any idea's howto solve this issue ?

Some information :
ResourcePopulationMode="ServerSide" , resources are added in Page_Load  (but i tried also the manual, clientside)..
-  Appointments are retrieved from Webservice.

I have added an screenshot where the jscript fails.

Regards,
Peter
Boyan Dimitrov
Telerik team
 answered on 13 Feb 2013
1 answer
213 views

please check the below screen shot , i applied Edititemtemplate css but this is not working it is taking fixed width as 160px   how to set this grid as fixed width

<telerik:RadGrid ID="grdComprehensiveParts" AutoGenerateColumns="false" AllowSorting="True"
               PageSize="7" AllowPaging="True" runat="server" AllowAutomaticUpdates="false"
               OnItemCommand="grdComprehensiveParts_ItemCommand" AllowAutomaticInserts="false"
               OnInsertCommand="grdComprehensiveParts_InsertCommand" OnUpdateCommand="grdComprehensiveParts_UpdateCommand">
               <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
               <MasterTableView CssClass="TableviewStle" HeaderStyle-CssClass="GridHeaderStyle"
                   CommandItemDisplay="Top" AutoGenerateColumns="false" DataKeyNames="ComprehensivePartNo"
                   EditMode="InPlace" ItemStyle-CssClass="GridItemStyle" EditItemStyle-CssClass="GridItemStyle">
                   <CommandItemSettings AddNewRecordText="NewRecord" ShowRefreshButton="false" />
                   <Columns>
                       <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
                           <ItemStyle CssClass="MyImageButton"></ItemStyle>
                       </telerik:GridEditCommandColumn>
                       <telerik:GridTemplateColumn HeaderText="InvoiceDate">
                           <EditItemTemplate>
                               <telerik:RadDatePicker runat="server" ID="dpInvoiceDate" DbSelectedDate='<%#Eval("InvoiceDate")%>'>
                               </telerik:RadDatePicker>
                           </EditItemTemplate>
                           <ItemTemplate>
                               <asp:Label runat="server" ID="lblInvoiceDate" Text='<%#Eval("InvoiceDate")%>'></asp:Label>
                           </ItemTemplate>
                       </telerik:GridTemplateColumn>
                       <telerik:GridTemplateColumn HeaderText="InvoiceNumber">
                           <EditItemTemplate>
                               <telerik:RadTextBox CssClass="GridEditTextbox" runat="server" ID="txtInvoiceNumber"
                                   Text='<%#Eval("InvoiceNumber") %>'>
                               </telerik:RadTextBox>
                           </EditItemTemplate>
                           <ItemTemplate>
                               <asp:Label runat="server" ID="lblLength" CssClass="GridLabelStyle" Text='<%#Eval("InvoiceNumber")%>'></asp:Label>
                           </ItemTemplate>
                       </telerik:GridTemplateColumn>
                       <telerik:GridTemplateColumn HeaderText="PartNumber">
                           <EditItemTemplate>
                               <telerik:RadTextBox CssClass="GridEditTextbox" runat="server" ID="txtPartNumber"
                                   Text='<%#Eval("PartNumber") %>'>
                               </telerik:RadTextBox>
                           </EditItemTemplate>
                           <ItemTemplate>
                               <asp:Label runat="server" ID="lblPartNumber" CssClass="GridEditTextbox" Text='<%#Eval("PartNumber")%>'></asp:Label>
                           </ItemTemplate>
                       </telerik:GridTemplateColumn>
                       <telerik:GridTemplateColumn HeaderText="PartDescription">
                           <EditItemTemplate>
                               <telerik:RadTextBox runat="server" ID="txtPartDescription" CssClass="GridEditTextbox"
                                   Text='<%#Eval("PartDescription") %>'>
                               </telerik:RadTextBox>
                           </EditItemTemplate>
                           <ItemTemplate>
                               <asp:Label runat="server" ID="lblPartDescription" Text='<%#Eval("PartDescription")%>'></asp:Label>
                           </ItemTemplate>
                       </telerik:GridTemplateColumn>
                       <telerik:GridTemplateColumn HeaderText="ReturnQuantity">
                           <EditItemTemplate>
                               <telerik:RadNumericTextBox runat="server" ID="txtReturnQuantity" CssClass="GridEditTextbox"
                                   Text='<%#Eval("ReturnQuantity") %>'>
                               </telerik:RadNumericTextBox>
                           </EditItemTemplate>
                           <ItemTemplate>
                               <asp:Label runat="server" ID="lblReturnQuantity" CssClass="GridEditTextbox" Text='<%#Eval("ReturnQuantity")%>'></asp:Label>
                           </ItemTemplate>
                       </telerik:GridTemplateColumn>
                       <telerik:GridTemplateColumn HeaderText="ReturnDesc">
                           <EditItemTemplate>
                               <telerik:RadTextBox runat="server" ID="txtReturnDesc" Text='<%#Eval("ReturnDesc") %>'>
                               </telerik:RadTextBox>
                           </EditItemTemplate>
                           <ItemTemplate>
                               <asp:Label runat="server" ID="lblReturnDesc" CssClass="GridEditTextbox" Text='<%#Eval("ReturnDesc")%>'></asp:Label>
                           </ItemTemplate>
                       </telerik:GridTemplateColumn>
                       <telerik:GridButtonColumn ConfirmText="Delete this product?" ConfirmDialogType="RadWindow"
                           ConfirmTitle="Delete" ImageUrl="../Vital Software Pty Ltd_files/Delete.gif" ButtonType="ImageButton"
                           CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">
                           <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton"></ItemStyle>
                       </telerik:GridButtonColumn>
                   </Columns>
               </MasterTableView>
               <ClientSettings>
                   <ClientEvents OnRowDblClick="RowDblClick1"></ClientEvents>
               </ClientSettings>
           </telerik:RadGrid>
MasterChiefMasterChef
Top achievements
Rank 2
 answered on 13 Feb 2013
1 answer
103 views
Hi,

I'm using Web20 skin for my Barcharts and Line charts but it seems it has only 5 colors in color pallet and it repeats those colors for legends # more than 5. So 1st and 6th Legends have same color. Do you have any skin that has more colors? Sometimes I have 30 Legends to display and its really confusing when all legends have same color in the chart. please help asap.

Thanks,
Archana
Petar Kirov
Telerik team
 answered on 13 Feb 2013
8 answers
553 views
I'm having a couple problems with NestedViewTemplates in RadGrid.  I have enabled PostbackOnRowClick for the grid and assigned an OnItemCommand to the RadGrid so that I can execute code when the row is expanded.  The problem is, the command seems to execute twice when the user clicks on the ExpandCollapse button.  Once for "ExpandCollapse" command and once for "RowClick".  What I'd like is for either an ExpandCollapse OR a RowClick to execute the ItemCommand method, and then stop, rather than executing it again.  Is there a way to do this? 

Also, how do I capture the "Expand" event on the client side?  And is it possible to hide the ExpandCollapse column in a NetsedViewTemplate?  As you can see from my code, I've tried just about everything to hide it but nothing seems to work...

Here's a code sample of what I'm doing:
<telerik:RadGrid runat="server" ID="radGridWts" GridLines="Horizontal"      
    AutoGenerateColumns="false" EnableAjaxSkinRendering="True" Skin="Office2007"      
    ClientSettings-EnableRowHoverStyle="true" OnItemCommand="radGridWts_ItemCommand"    
    OnItemDataBound="radGridWts_ItemDataBound" ShowDesignTimeSmartTagMessage="true">     
    <ClientSettings EnablePostBackOnRowClick="True" AllowExpandCollapse="false">     
        <Resizing AllowColumnResize="true" ResizeGridOnColumnResize="false" EnableRealTimeResize="true" />    
    </ClientSettings>    
    <MasterTableView DataKeyNames="WtID,WtRid">  
        <ExpandCollapseColumn Display="false" Visible="false">     
            <HeaderStyle Width="0px" />    
            <ItemStyle Width="0px" />    
        </ExpandCollapseColumn>    
        <RowIndicatorColumn Visible="False">     
            <HeaderStyle Width="20px" />    
        </RowIndicatorColumn>    
        <Columns> 
            <telerik:GridBoundColumn HeaderText="WtID" Visible="False" HeaderStyle-HorizontalAlign="Left" DataField="WtID" UniqueName="colWtId"></telerik:GridBoundColumn>    
            <telerik:GridBoundColumn HeaderText="Sev" HeaderStyle-HorizontalAlign="Left" DataField="Severity"></telerik:GridBoundColumn>    
            <telerik:GridBoundColumn HeaderText="RID" DataField="WtRid"></telerik:GridBoundColumn>    
            <telerik:GridBoundColumn HeaderText="Wt Number" DataField="WtNumber" ></telerik:GridBoundColumn>    
            <telerik:GridBoundColumn HeaderText="Date" DataField="DateIssued" DataFormatString="{0:d}"></telerik:GridBoundColumn>    
            <telerik:GridBoundColumn HeaderText="Type" DataField="WtType"></telerik:GridBoundColumn>    
            <telerik:GridBoundColumn HeaderText="Section" DataField="WtCode"></telerik:GridBoundColumn>    
            <telerik:GridBoundColumn HeaderText="Bail Amount" DataField="BailAmount" DataFormatString="{0:C}" UniqueName="colBailAmt"></telerik:GridBoundColumn>    
        </Columns>    
        <NestedViewTemplate>    
            <div style="padding:5px;">     
                <div id="buttons">     
                    <style="float:right; margin-left:-155px; margin-top:5px; position:absolute"      
                        href="" tabindex="32" onmouseup="javascript:window.focus()"      
                        onclick="javascript:CopyWtDetails('<%= strCopyWtDetails %>');return false;" class="copy"></a>    
                </div>    
                <asp:Label runat="server" ID="lblWtDetail"></asp:Label>    
                <div style="border-top: 1px solid #ccc; padding-top: 5px;">     
                    <telerik:RadPanelBar runat="server" ID="rPanelBarDdVisits" Width="100%" EnableEmbeddedSkins="false"    
                        Skin="Hay" ExpandAnimation-Type="InBounce" OnClientItemClicking="OnClientItemClicking">     
                        <Items>    
                            <telerik:RadPanelItem runat="server" Text="Due Diligence" Expanded="false" ExpandedImageUrl="../images/submenu_dn.gif"    
                                ImageUrl="../images/submenu.gif">     
                                <Items>    
                                    <telerik:RadPanelItem runat="server">     
                                        <ItemTemplate>    
                                            <div style="margin: 3px 0px 1px 0px;">     
                                                <telerik:RadGrid runat="server" ID="rGridDdVisits" Skin="Office2007" AutoGenerateColumns="false">  
                                                    <MasterTableView>    
                                                        <Columns>    
                                                            <telerik:GridBoundColumn HeaderText="DATE" DataField="CommentDate" DataFormatString="{0:d}">  
                                                            </telerik:GridBoundColumn>    
                                                            <telerik:GridBoundColumn HeaderText="DESCRIPTION" DataField="Comment">  
                                                            </telerik:GridBoundColumn>    
                                                            <telerik:GridBoundColumn HeaderText="LEA" DataField="Lea">  
                                                            </telerik:GridBoundColumn>    
                                                            <telerik:GridBoundColumn HeaderText="OFFICER" DataField="Officer">  
                                                            </telerik:GridBoundColumn>    
                                                        </Columns>    
                                                    </MasterTableView>    
                                                </telerik:RadGrid>    
                                            </div>    
                                        </ItemTemplate>    
                                    </telerik:RadPanelItem>    
                                </Items>    
                            </telerik:RadPanelItem>    
                        </Items>    
                    </telerik:RadPanelBar>    
                </div>    
            </div>                                             
        </NestedViewTemplate>    
    </MasterTableView>    
</telerik:RadGrid>   
 

protected void radGridWts_ItemCommand(object sender, GridCommandEventArgs e)  
{  
    if (e.Item is GridDataItem)  
    {                  
        string strWtID = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["WtID"].ToString();  
        string strRid = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["WtRid"].ToString();  
 
        if (e.CommandName == "RowClick" || e.CommandName == "ExpandCollapse")  
            if (!e.Item.Expanded)  
            {  
                e.Item.Expanded = true;  
                e.Item.Selected = true;  
 
                Wt w = Wt.getWtDetails(strWtID, strRid);  
                if (w != null)  
                {  
                    strCopyWtDetails = BuildCopyWtDetails(w);  
                    Label lblWtDetail;  
                    GridNestedViewItem nviWtDetails =  
                        ((GridTableView)e.Item.Parent.Parent).Items[e.Item.ItemIndex].ChildItem;  
                    lblWtDetail = nviWtDetails.FindControl("lblWtDetail"as Label;  
                    RadPanelBar rpb = nviWtDetails.FindControl("rPanelBarDueDiligence"as RadPanelBar;  
 
                    if (w.DdVisits != null && w.DdVisits.Count > 0)  
                    {  
                        if (rpb != null)  
                            if (rpb.Items[0].Text.IndexOf("(") < 0)  
                                rpb.Items[0].Text += " (" + w.DdVisits.Count + ")";  
 
                        RadGrid rGridDdVisits =  
                            nviWtDetails.FindControl("rPanelBarDueDiligence").Controls[0].Controls[0].  
                                FindControl("rGridDueDiligence"as RadGrid;  
                        if (rGridDdVisits != null)  
                        {  
                            rGridDdVisits.DataSource = w.DdVisits;  
                            rGridDdVisits.DataBind();  
                        }  
                    }  
                    else if (w.DdVisits == null || w.DdVisits.Count < 1) if (rpb != null) rpb.Visible = false;  
 
                    if (lblWtDetail != null)  
                        lblWtDetail.Text = WriteWtDetails(w).ToString();  
                }  
            }  
            else 
                e.Item.Expanded = false;  
    }  

Thanks for the help!
Eddie
Antonio Stoilkov
Telerik team
 answered on 13 Feb 2013
5 answers
179 views
Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near 'Telerik.Web.UI   201'. Can Any tell me why this error occurs


Thanks & Regards
Princia
Radoslav
Telerik team
 answered on 13 Feb 2013
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?