Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
104 views
Never mind!!! Delete this post!  

It was developer error!! haha (I kept refreshing my QA site and the data wasn't sorting, instead of my local site) Hate when that happens.
Fred
Top achievements
Rank 1
 asked on 05 Mar 2010
3 answers
165 views
Hi,
  I have a grid. Fields in the grid allow to sort only in two ways(ascending, descending). But for the first time load I want it to show sorting based on first column. I read an article at http://www.telerik.com/help/aspnet-ajax/grdsortingexpressions.html. This is not working. Below is code sample, do let me know if some thing else needs to be done.

    <rad:RadGrid ID="RegularActGrid" AllowPaging="true"  Skin="Vista" AllowSorting="true" OnPageIndexChanged="RegularActGrid_PageIndexChanged" OnNeedDataSource="RegularActGrid_NeedDataSource" OnSortCommand="RegularActGrid_SortCommand" EnableEmbeddedSkins="false" runat="server" Width="100%" AutoGenerateColumns="False">
          <PagerStyle Visible="false"/>
          <MasterTableView PageSize="10" AllowPaging="true" AllowCustomPaging="true" AllowCustomSorting="true" AllowNaturalSort="false" AllowSorting="true" EnableNoRecordsTemplate="true">
               <NoRecordsTemplate >
                
                </NoRecordsTemplate>
                <SortExpressions>
                    <rad:GridSortExpression FieldName="ActivityName" SortOrder="Ascending" />
                </SortExpressions>
              <Columns>
                  <rad:GridTemplateColumn SortExpression="0" HeaderText="<%$ Resources:L_LMS_Activity_ExceptionDetails, Info_ColEmpName%>" UniqueName="ActivityName">
                  <ItemStyle VerticalAlign="Middle"/>
                  <ItemTemplate>
                    <asp:Label runat="server" ToolTip='<%# GetName(Eval("EmployeeFName"), Eval("EmployeeLName"), Eval("EmployeeMI"))%>' Text='<%# GetName(Eval("EmployeeFName"), Eval("EmployeeLName"), Eval("EmployeeMI"))%>'></asp:Label>
                    
                  </ItemTemplate>
                  </rad:GridTemplateColumn>

                  <rad:GridTemplateColumn SortExpression="1" UniqueName="EmpIdentifier">
                  <ItemStyle/>
                  <ItemTemplate>
                    <asp:Label runat="server" ToolTip='<%# Eval(this.g_strEmpIdentifierRSName)%>' Text='<%# Eval(this.g_strEmpIdentifierRSName)%>'></asp:Label>
                  </ItemTemplate>
                  </rad:GridTemplateColumn>


                  <rad:GridTemplateColumn SortExpression="4" HeaderText="<%$ Resources:L_LMS_Activity_ExceptionDetails, Info_ColAssignment%>" UniqueName="RequiredIncomplete">
                  <ItemStyle/>
                  <ItemTemplate>
                  <asp:Label runat="server" ToolTip='<%# GetColData(Eval(this.g_strCol1),0)%>' Text='<%# GetColData(Eval(this.g_strCol1),0)%>'></asp:Label>
                  </ItemTemplate>
                  </rad:GridTemplateColumn>
                  <rad:GridTemplateColumn SortExpression="2" HeaderText="<%$ Resources:L_LMS_Activity_ExceptionDetails, Info_DueDate%>" UniqueName="RecommendedIncomplete">
                  <ItemStyle/>
                  <ItemTemplate>                
                    <asp:Label runat="server" ToolTip='<%# GetColData(Eval(this.g_strCol2), 1)%>' Text='<%# GetColData(Eval(this.g_strCol2),1)%>'></asp:Label>
                  </ItemTemplate>
                  </rad:GridTemplateColumn>

              </Columns>
          </MasterTableView>
          <ClientSettings>
         <Scrolling AllowScroll="true" EnableVirtualScrollPaging="true" UseStaticHeaders="true" />
          <Selecting AllowRowSelect="True"></Selecting>
         <Resizing AllowColumnResize="true" />
         </ClientSettings>   
        </rad:RadGrid>   

Fred
Top achievements
Rank 1
 answered on 05 Mar 2010
1 answer
81 views


Hi...

I have an issue associated with RadCombo in the Gridtemplatecolumn of radGrid.

My scenario is:

I have a RadCombo inside the template column of RadGrid. When combo's selected item is changed then another column in Grid needs to be updated.

It should happen in such a way that when the column should get updated  at the instance of itemchange, not after the user clicks update or any other mode.

Is there any way to access the selectedchange event of the Radcombo(combo being inside the template column)?

Or is there any work-around?

I need to arrive at a solution, could u provide me with one..

 

Please help me...

Schlurk
Top achievements
Rank 2
 answered on 05 Mar 2010
10 answers
345 views
I have ajaxified RadGrid.

In one of the columns I am dynamically creating ImageButtons, like here:

 

 


protected void  RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)  
{  
    if (e.Item is GridDataItem)  
    {  
        DataRowView v = (DataRowView)e.Item.DataItem;      
        ImageButton lnk = new ImageButton();  
        lnk.ImageUrl = "~/Images/view.gif";  
        lnk.ToolTip = GetString("TimeSheet");  
        lnk.CommandArgument = "test";  
        lnk.CommandName = "Redirect";  
        lnk.Command += new CommandEventHandler(lnk_Command);  
        GridDataItem tem = e.Item as GridDataItem;  
        Item["Column"].Controls.AddAt(0, lnk);  
 }  
}  
 
protected void lnk_Command(object sender, CommandEventArgs e)  
{  
Session["Redirect"] = e.CommandArgument;  
Response.Redirect("Timesheet.aspx");  
}  
 

 

 

 

 

When page is loaded first time ImageButton is successfully created and displayed in each row,
but clicking on it doesn't fire lnk_Command event  (I have checked this adding breakpoints in lnk_Command),
Instead of redirecting I get the same page without ImageButtons displayed.
Please advice.

 

 

spt
Top achievements
Rank 1
 answered on 05 Mar 2010
2 answers
277 views
Hello,

How do I deal with the following chart?  It has an overlapping legend and you can't make it out...  is there a workaround to this?  What settings will separate the values that I may be missing?  Here is my chart definition:

<tel:RadChart ID="Chart1" runat="server" Skin="Office2007"
 Width="790px">
 <Series>
  <tel:ChartSeries Name="Default" Type="Pie">
   <Appearance LegendDisplayMode="ItemLabels" ShowLabelConnectors="true">
    <LabelAppearance Distance="15" Dimensions-AutoSize="true" />
   </Appearance>
  </tel:ChartSeries>
 </Series>
 <ChartTitle Visible="false" />
</tel:RadChart>

Thanks.
Brian Mains
Top achievements
Rank 1
 answered on 05 Mar 2010
3 answers
281 views
Hello,

First of all i am using RadControls ASP.NET Ajax Q2 2009 for .Net 3.5
My problem is when i try to drag & drop any telerik item to design screen i get  "URI formats are not supported" error even if i create a new project, problem still occurs.
This problem started a few days ago. 
Please help...
Andrey
Telerik team
 answered on 05 Mar 2010
3 answers
316 views
Hi,

       I am using RADGrid for my application to improve the performance. I had a functionality as deleting multiple rows at a time by clicking "DeleteALL" button "CommandItemDisplay". For this I am calling Webservice when user clicks on "Delete" button.I am updating the List<BussinessEntity> in Webeservice and returning to the client fuinction , But in client script while executing the following line of code in       the   "function updateGrid(result)" - tableView.dataBind();   throwing error inside Telerik dynamic created script file.I am refering following link to implement webservice.

    http://blogs.telerik.com/VladimirEnchev/Posts/08-10-09/Telerik_RadGrid_client-side_data-binding_using_jQuery.aspx

Please find the code snippet of webservice. [asmx page]

    [WebMethod(EnableSession = true)] 
    public List<AdminSettingsCategoryEntity> DeleteSelectedCategories(string strSelectedCateoryList, string modifiedBy, string clientID) 
    { 
        int intCatgIsUsed = 0
        int intCatgID = 0
        GridTableView CategoryGridMaterTableView = new GridTableView(); 
        System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer(); 
        var jsIds = serializer.Deserialize<Dictionary<string, object>>(strSelectedCateoryList); 
     
        if (jsIds != null) 
        { 
            ArrayList selectedItems = new ArrayList(); 
            foreach (KeyValuePair<string, object> keyValuePair in jsIds) 
                selectedItems.Add(long.Parse(keyValuePair.Key)); 
 
            if (selectedItems.Count > 0) 
            { 
              //Functionality to remove the selected Category IDS and updating list<bussinessEntity> 
            } 
 
            //return usersDraftList.ToList(); 
        } 
        return categoryList.ToList(); 
 
    } 

Code snippet adding g
                         <div id="divdgListOfCategory" runat="server" style="width: 420px; float: left; margin-bottom: 7px; 
                                height: 180px;"> 
                                <telerik:RadGrid ID="DgListOfCategory" runat="server" AutoGenerateColumns="false" AllowMultiRowSelection="true" AllowPaging="false" PagerStyle-Visible="false"  
                                    Skin="GridVista" EnableViewState="true" Width="412px" AllowMultiRowEdit="true"  EnableEmbeddedSkins="false"  
                                    OnItemDataBound="DgListOfCategory_ItemDataBound" OnItemCommand="DgListOfCategory_ItemCommand"
                                    <MasterTableView Width="395px" AutoGenerateColumns="false" EditMode="InPlace"  
                                    NoMasterRecordsText="No Records Found"  AllowAutomaticDeletes="True" DataKeyNames="ID" 
                                    AllowAutomaticInserts="false" AllowAutomaticUpdates="false" ShowHeadersWhenNoRecords="true" ClientDataKeyNames="ID,isUsed" 
                                        CommandItemDisplay="Top"
                                        <CommandItemTemplate> 
                                            <div id="lnkAddrows" style="float:left;line-height: 29px;"
                                                <asp:LinkButton ID="btnAddNewRecord" runat="server" CommandName="AddNewRecord" Style="vertical-align: bottom"
                                                    <asp:Image ID="imgAdd" runat="server" ImageUrl="~/Images/AddRecord.gif" />Add New Record</asp:LinkButton> 
                                            </div> 
                                                     <div id="divDeleteRows" style="float:left;line-height: 29px;padding-left:30px;"
                                                <asp:LinkButton ID="lnkDeleteRows" runat="server" Style="vertical-align: bottom" OnClientClick="javascript:return DgListOfCategoryDeleteSelectedRows()" > 
                                                <asp:Image ID="imgDelete" runat="server" ImageUrl="~/Images/val_close.png"  /> Delete</asp:LinkButton>             
                                            </div> 
                                        </CommandItemTemplate> 
                                        <Columns> 
                                             <telerik:GridClientSelectColumn UniqueName="CheckboxSelectColumn"  HeaderStyle-Width="40px"  
                                         ItemStyle-Width="40px" ItemStyle-HorizontalAlign="Center" > 
                                          </telerik:GridClientSelectColumn>     
                                            <telerik:GridTemplateColumn UniqueName="Active" HeaderText="Select" DataType="System.Int32" 
                                                HeaderStyle-Width="40px" ItemStyle-Width="40px" ItemStyle-HorizontalAlign="Center"
                                                <ItemTemplate> 
                                                    <asp:CheckBox ID="chkActive" runat="server" /> 
                                                </ItemTemplate> 
                                            </telerik:GridTemplateColumn> 
                                            <telerik:GridTemplateColumn UniqueName="tempCatgName" HeaderText="Category Name" 
                                                DataType="System.String" ReadOnly="False" HeaderStyle-Width="160px" ItemStyle-Width="160px"
                                                <ItemTemplate> 
                                                    <telerik:RadTextBox ID="CategoryName" Text='<%#Eval("CategoryName") %>' runat="server" 
                                                        EmptyMessage="Category Name" MaxLength="50" Width="145px"
                                                    </telerik:RadTextBox>                                                    
                                                </ItemTemplate> 
                                            </telerik:GridTemplateColumn> 
                                            <telerik:GridBoundColumn DataField="ID" HeaderText="ID" ReadOnly="True" AllowSorting="false" 
                                                Visible="false" ItemStyle-Width="0" HeaderStyle-Width="0" UniqueName="ID"
                                                <HeaderStyle ForeColor="Silver" /> 
                                                <ItemStyle ForeColor="Silver" /> 
                                            </telerik:GridBoundColumn> 
                                            <telerik:GridBoundColumn DataField="isUsed" HeaderText="isUsed" ItemStyle-Width="5" 
                                                HeaderStyle-Width="5" Visible="false" UniqueName="isUsed"
                                            </telerik:GridBoundColumn> 
                             
                                                <telerik:GridClientDeleteColumn HeaderStyle-Width="40px" ButtonType="ImageButton" HeaderText="Delete" 
                                              CommandName="Delete"  Text="Delete" UniqueName="DeleteColumn" > 
                                             <HeaderStyle Width="40px"  /> 
                                                <ItemStyle HorizontalAlign="Center" Width="30px" /> 
                                             </telerik:GridClientDeleteColumn> 
                                        </Columns> 
                                    </MasterTableView> 
                                                               <ClientSettings> 
                                        <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True" ScrollHeight="174px"
                                        </Scrolling> 
                                         <Selecting AllowRowSelect="true" />                                          
                       <ClientEvents  OnRowSelected="DgListOfCategory_RowSelected" OnRowCreated="DgListOfCategory_RowCreated" 
                                 OnRowDeselected="DgListOfCategory_RowDeselected" OnRowDeleted="DgListOfCategory_RowDeleted"  /> 
                                 <DataBinding Location="CategoryPopUp.aspx"  SelectCountMethod="MyFirstPageMethod"/> 
                                    </ClientSettings>        
                                     
                                </telerik:RadGrid> 
                            </div> 
rid to aspx page:

Javscript functions:

    <script src="../../JavaScripts/jquery-1.3.2.min.js" type="text/javascript"></script> 
    <script src="../../JavaScripts/json2.js" type="text/javascript"></script> 
       <script src="../../JavaScripts/jquery-1.2.6.pack.js" type="text/javascript"></script> 
     
    <script type="text/javascript" language="javascript">  
        var commandName = ""
        var tableView = null
        var clientIDValue = null
        var SelectedCatgIDs = null 
        var selected = {}; 
        var userIDValue = null
                
 
       function DgListOfCategory_RowSelected(sender, args) { 
           var mailID = args.getDataKeyValue("ID"); 
           if (!selected[mailID]) { 
               selected[mailID] = true;                                                  
           } 
            // Set the value of the hidden variable to  
            // the value of the javascript variable  
            var hiddenControl = '<%= selectedInstrumentIds.ClientID %>';  
            document.getElementById(hiddenControl).value = Sys.Serialization.JavaScriptSerializer.serialize(selected);  
       } 
        
       function DgListOfCategory_RowDeselected(sender, args) { 
           var mailID = args.getDataKeyValue("ID"); 
           if (selected[mailID]) { 
               selected[mailID] = null
           } 
                       // Set the value of the hidden variable to  
            // the value of the javascript variable  
            var hiddenControl = '<%= selectedInstrumentIds.ClientID %>';  
            document.getElementById(hiddenControl).value = Sys.Serialization.JavaScriptSerializer.serialize(selected);  
       } 
        
       function DgListOfCategory_RowCreated(sender, args) { 
           var mailID = args.getDataKeyValue("ID");       
           if (selected[mailID]) { 
               args.get_gridDataItem().set_selected(true); 
           } 
       } 
        
       function DgListOfCategory_RowDeleted(sender, args) 
       { 
       alert("Delete Cliecked"); 
        var mailID = args.getDataKeyValue("ID"); 
           if (!selected[mailID]) { 
               selected[mailID] = true
           } 
            // Set the value of the hidden variable to  
            // the value of the javascript variable  
            var hiddenControl = '<%= selectedInstrumentIds.ClientID %>';  
            document.getElementById(hiddenControl).value = Sys.Serialization.JavaScriptSerializer.serialize(selected);  
       } 
        
       function DgListOfCategoryDeleteSelectedRows() 
       {        
                tableView = $find("<%= DgListOfCategory.ClientID %>").get_masterTableView(); 
                clientIDValue = document.getElementById("ctl00_plhMainContentArea_hdnClientID").value; 
                userIDValue = document.getElementById("ctl00_plhMainContentArea_hdnUserID").value; 
                 SelectedCatgIDs = document.getElementById("ctl00_plhMainContentArea_selectedInstrumentIds").value; 
                 
                var DataItems = $find("<%=DgListOfCategory.ClientID %>").get_masterTableView().get_dataItems();                  
                if(DataItems != null
                { 
                executeMethod("../../WebServices/SettingsWebService.asmx""DeleteSelectedCategories", getRequestData(tableView), updateGrid); 
                }        
                
       } 
       function updateGrid(result) 
             {       
                tableView.set_dataSource(result.d); 
                tableView.dataBind();      
            } 
 
 
            function getRequestData(tableView) {             
                return JSON.stringify({ 
                    "strSelectedCateoryList": SelectedCatgIDs, 
                    "modifiedBy" : userIDValue, 
                    "clientID" : clientIDValue 
                }); 
            } 
 
         function executeMethod(location, methodName, methodArguments, onSuccess, onFail) 
          {  
                $.ajax({ 
                    type: "POST"
                    url: location + "/" + methodName, 
                    data: methodArguments, 
                    contentType: "application/json; charset=utf-8"
                    dataType: "json"
                    success: onSuccess, 
                    fail: onFail 
                });               
            } 
    </script> 

Please help me out how to bind the dataset in client script .

Thanks in Advance,
Bysani.
Nikolay Rusev
Telerik team
 answered on 05 Mar 2010
10 answers
262 views
If I use the default ExplorerMode type the grid is showing with my Attributes. I am able to get the Attributes on the client in OnClientItemSelected like this:

var dataItem = oExplorer.get_grid().get_masterTableView().get_selectedItems()[0].get_dataItem(); 
var status = dataItem.Attributes["Status"]; 
 

When using ExplorerMode of FileTree, how do I get the Attribute?

            if (selectedItem.get_type() == Telerik.Web.UI.FileExplorerItemType.File) { 
                alert('How do I get the Attributes here?'); 
            } 
 

thanks,

Steve





Steve White
Top achievements
Rank 1
 answered on 05 Mar 2010
1 answer
98 views
Good Day

i have a Rad Editor where my Users enter data and i want to save the html in a String Variable. I have Tried .Content and it did not give me back the html.

Thanks

Rumen
Telerik team
 answered on 05 Mar 2010
1 answer
317 views
In order to be the same as our word styles, we have limited the number of paragraph styles down to

<paragraphs>
    <paragraph name="&lt;P>Normal&lt;/P>" value="&lt;P>" />
    <paragraph name="&lt;H2>Head&lt;/H2>" value="&lt;H2>" />
    <paragraph name="&lt;H3>Head 1&lt;/H3>" value="&lt;H3>" />
    <paragraph name="&lt;H4>Head 2&lt;/H4>" value="&lt;H4>" />
    <paragraph name="&lt;H5>Head 3&lt;/H5>" value="&lt;H5>" />
  </paragraphs>

because of the branding on the site we have also had to make the title of the headings different to the actual heading number e.g. Head = H2, Head 1 = H3, etc.  When you open the editor, this is all working fine - see pic 1.  However, when you highlight a piece of text e.g.  <h5>this is a H5</h5> it is showing up "Heading 5" rather than "Head 3" as we have named our paragraph style.  It is possible to change this behaviour so that,when text is highlighted, H5 would be mapped to our description.

Stanimir
Telerik team
 answered on 05 Mar 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?