Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
133 views
how do i access the filename selected in fileexplorer using javascript and put in in my asp label?
Ronen
Top achievements
Rank 1
 answered on 11 Aug 2010
1 answer
135 views
Hi,

I have a grid with 4 grid bound columns and 1 grid numeric column and the numeric column is in inplace edit mode and there are two buttons - Save & Cancel. When search button clicks, grid will be populated with data.
Here is my requirement.

When user modifies data in the numeric column and clicks on Save button, I have written a validate function to validate the modified data and if the modified data is not as per the rules then those cells should be displayed in red with the modified data so that user can check what was wrong with the data.

Can you please tell me how to achieve this ?

I also have NeedDataSource method & Grid_Prerender method. please see the below code.

protected void Page_Init()
    {
       ConfigureGrid();
                 
    }
  
  
private void ConfigureGrid()
    {
        try
        {
            OrderTypeRankingGrid.AddNeedDataSourceEventHandler(NeedDataSource); 
            OrderTypeRankingGrid.AddGridCommandEventHandler(DataGrid_ItemCommand); 
            OrderTypeRankingGrid.PreRender += new EventHandler(OrderTypeRankingGrid_PreRender);
                                              
             
            OrderTypeRankingGrid.AllowColumnsReorder = false;             
            OrderTypeRankingGrid.GridHeaderText = "Order Type Ranking"; 
            var masterView = OrderTypeRankingGrid.ConfigureMasterTableView("vDivisionOrderTypeRanking", new string[] { "DivisionOrderTypeRankId","CategoryCode", "PurposeCode", "ReasonCode", "ReasonDescription"});
            masterView.AllowFilteringByColumn = true;
            masterView.AllowSorting = true;
            masterView.FullEditMode = true;
            masterView.EditMode = GridEditMode.InPlace;
            masterView.EnableShowHideColumns = true;
            masterView.SetPaging(GridPagerMode.NextPrevAndNumeric);
            masterView.GridTableView.ShowHeader = true;
            masterView.ShowHeader = true;
            masterView.ShowFooter = true;
            masterView.ShowHeadersWhenNoRecords = true;
            masterView.AllowPaging = true;
            //masterView.PageSize = 50;
              
                          
            masterView.AddNgmCommandButton(NgmButtonType.Save, "btnSave", null, null, null, Unit.Pixel(50));
            masterView.AddNgmCommandButton(NgmButtonType.Cancel, "btnCancel", null, null, null, Unit.Pixel(50));
                          
              
            masterView.CommandItemDisplay = GridCommandItemDisplay.Bottom;
  
              
            if (!IsPostBack)  //must check for postback; otherwise, columns will be duplicated
            {                
                masterView.AddBoundColumn("CategoryCode", "Category Code", "CategoryCode", true, false, true, Unit.Percentage(7.0));
                masterView.AddBoundColumn("PurposeCode", "Purpose Code", "PurposeCode", true, false, true, Unit.Percentage(7.0));
                masterView.AddBoundColumn("ReasonCode", "Reason Code", "ReasonCode", true, false, true, Unit.Percentage(7.0));
                masterView.AddBoundColumn("ReasonDescription", "Reason Description", "ReasonDescription", true, false, true, Unit.Percentage(7.0));
                masterView.AddNumericColumn("OrderTypeRank", "Rank", "OrderTypeRank", false, false, true, Unit.Percentage(7.0), typeof(int),NumericType.Number,"{0:N0}", 10);
                                  
            }            
  
        }
        catch (System.Exception ex)
        {
            base.AddException(ex);
        }               
    }


protected void OrderTypeRankingGrid_PreRender(object sender, EventArgs e)
    {
        if (IsPostBack)
        {
            for (int i = 0; i < OrderTypeRankingGrid.PageCount; i++)
            {
                OrderTypeRankingGrid.EditIndexes.Add(i);
            }
  
            OrderTypeRankingGrid.Rebind();
        }
  
  
    }


protected void NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
    {
        try
        {
            if (IsPostBack)
            {
                  
                  
               if (!e.IsFromDetailTable && (this.productDivision == 1 || this.productDivision == 2))
                {
                    productDivision = long.Parse(cboxDivision.SelectedValue.ToString());
                    IDivisionOrderTypeRankService divisionOrderTypeRankServiceAgent = null;
                    divisionOrderTypeRankServiceAgent = (IDivisionOrderTypeRankService)ContextRegistry.GetContext().GetObject("DivisionOrderTypeRankServiceAgent");
                    IList<DivisionOrderTypeRankDTO> divisionOrderTypeRankDTOs = divisionOrderTypeRankServiceAgent.GetDivisionOrderTypeRankByDivision(productDivision);
  
                    if (divisionOrderTypeRankDTOs.Count > 1)
                    {
                        var divOrderTypeRankDTOstemp = from b in divisionOrderTypeRankDTOs
                                                       orderby b.CategoryCode ascending, b.PurposeCode ascending, (b.OrderTypeRank == null ? int.MaxValue : b.OrderTypeRank) ascending
                                                       select b;
  
                        OrderTypeRankingGrid.DataSource = divOrderTypeRankDTOstemp;
                                            }
                    else
                    {
                        base.AddWarning("There are no records to display");
   
                    }                    
                }
  
                  
            }
        }
        catch (System.Exception ex)
        {
            base.AddException(ex);
            }
    }

 


Tsvetina
Telerik team
 answered on 11 Aug 2010
3 answers
176 views
I'm trying to change the telerik namspace because it conflicts with a previous version of Telerik and I'm using both on my site. I opened the source code in VS2008 and changed the Assembly name and default namespace in the Properties. I also right-clicked a class and chose Refactor > Rename and changed "Telerik" to "TelerikSC". In doing so I got 75 errors of the form:

'TelerikSC.Web.UI.RadDockZone.DescribeClientProperties(TelerikSC.Web.UI.IScriptDescriptor)': no suitable method found to override   C:\Users\myuser\Desktop\Telerik.Web.UI_2010_2_713_Source\RadControlsAjaxSource\Telerik.Web.UI\Dock\RadDockZone.Serialization.generated.cs   22   36   Telerik.Web.UI

Dimo
Telerik team
 answered on 11 Aug 2010
1 answer
127 views
Hi
        Thanks for quick response. I tried what is give you advice. The code is working fine in Q3 2009. but now i am using in my project Q2 2008. The same coding is not working in Q2 2008. and also Q2 2008 is not supported for UseClientSelectColumnOnly="true". But it is supported for q3 2009 only . I want to need for solution for this problem in q2 2008.

 Requirement is:
                   1. We need to check and unchecked rad grid check box through row click event  in client side scripts(note: I can able to do check box checked. but i am not able do  unchecked in Q2 2008 Telerik
                    2. I need to select multiple check box in rad grid through row click in Client side scripts(note: I can able to select multiple check box through row click in Q3 2009(use: args.set_cancel(true)). But i am not able same process in Q2 2008.
                    3. If i did above functionality through args.set_cancel(true); event. I am not able to check the check box through directly click . and also i am not able to select the multiple check box through row header check box.
Please provide the solution for above problem in Q2 2008 Telerik DLL
 Note: Please see the image. And attachment for sample coding and please all the q2 Telerik DLL

.
source code:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
   
  <telerik:RadCodeBlock ID="dsafdsa" runat="server">
 
    <script language="javascript" type="text/javascript">
    
    
function RowClick(rowIndex)

 {

   // alert("Click on row with index: " + rowIndex);

    return false; //cancel the postback request set with ClientSettings -> EnablePostBackOnRowClick = true

 }


 function RowSelecting(sender, args) {
     
     var id = args.get_id();
     var inputCheckBox = $get(id).getElementsByTagName("input")[0];
     if (!inputCheckBox || inputCheckBox.disabled) {
         //cancel selection for disabled rows
         args.set_cancel(true);
     }
     if (inputCheckBox.checked == true) {
         inputCheckBox.checked = false;
     }
     else
     {
         inputCheckBox.checked =true;
     }
    
 }
 function RowDeselecting(sender, args) {
     alert("Deselect");
     var id = args.get_id();
     var inputCheckBox = $get(id).getElementsByTagName("input")[2];
     if (!inputCheckBox || inputCheckBox.disabled) {
         //cancel selection for disabled rows
         args.set_cancel(true);
     }
     inputCheckBox.checked = false;
 }

    </script>
    </telerik:RadCodeBlock>
    
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
</telerik:RadScriptManager>
    <div>
    
        <telerik:RadComboBox ID="RadComboBox1" Runat="server">
        </telerik:RadComboBox>
    <asp:HiddenField ID="HiddenField2" runat="server" />    
        
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadGrid ID="RadGrid1" runat="server"
            AllowPaging="True" PageSize="10" Width="97%"   AllowMultiRowSelection="True"
            GridLines="None">
            <PagerStyle Mode="NumericPages" />
             <ClientSettings EnableRowHoverStyle="true">
                <Selecting AllowRowSelect="true"    EnableDragToSelectRows="true"/>
                <ClientEvents OnRowClick="RowSelecting" />
                
            </ClientSettings>
            <MasterTableView>
                <Columns>
                    <telerik:GridClientSelectColumn>
                    </telerik:GridClientSelectColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
    
    </div>
    </form>
</body>
</html>

Thanks
G. Manikandan
Pavlina
Telerik team
 answered on 11 Aug 2010
1 answer
148 views
I use UrlRewritingNet.UrlRewriter.dll for Rewriter my website, but RadEditor not working. I attach message error when click button (Image manager, Flash manager, Template manager....). If not use UrlRewritingNet.UrlRewriter.dll (delete line config rewriter in web.config) then RadEditor run ok.
Please help me, how to use  RadEditor with UrlRewritingNet.UrlRewriter.dll.
Thanks you very much.


Rumen
Telerik team
 answered on 11 Aug 2010
1 answer
42 views
I want to be able to make my own "View" of the data and have a tab showup for it

So for example the "Timeline view" in my head for my app should show me who is off in sequential order in a list, perhaps grouped by Date like a vertical calendar...OR some sort of view like that

I think thats how it looks normally maybe with times, but in my case we're dealing with all-day events so it just looks like a 3 day, week view
Peter
Telerik team
 answered on 11 Aug 2010
1 answer
85 views
My Month View seems to be failing on callback from the webservice...I think it's just getting too much sent into it and onClientRequestFailed is being called.

{"Message":"There was an error processing the request.","StackTrace":"","ExceptionType":""}


If I refine the search results it works fine, so I assume that has to be it?
Peter
Telerik team
 answered on 11 Aug 2010
3 answers
81 views
I am using MOSS 2007 and have the RAD controls installed for SharePoint.  With RAD enabled on my lists, I want to use the same functionality as the SharePoint "Insert Image" option. This is a simple dialog that allow you to enter the URL to the image (see attached file).  I don't have this button anymore.  Is there a RAD tool that I can use with similar functionality?  I need to be able to insert images from our internet site into our intranet announcements. (No need to upload these bio pics on SharePoint if they are already on the internet site.)

Thanks!
Stanimir
Telerik team
 answered on 11 Aug 2010
1 answer
119 views
Hi,

In my code behind, iam fetching some data from webservice and manupulating it as per need and storing
into hashtable.

Now i wanted to display that hashtable data inside RADListView in the form of rows, The RadListView is under NestedViewTemplate of RadGrid.
I tried it to display, but data is not showing when i try to view in browser.
In the Control page (ascx):
<NestedViewTemplate>
<asp:Panel ID="panel2" runat="server" >                           
         <telerik:RadListView ID="RadListView2" runat="server">
                        
 <td >
                                 Address:<%# Eval("ADDRESS")%>
                         </td>
  <td>
                                <!-- Need to display----->
                       <asp:Label ID="Label11" runat="server" Text='<%#keysLst3[0].ToString() %>'>
                       </asp:Label>                                                
                 </td>
         </telerik:RadListView> 
</asp:Panel>
</NestedViewTemplate>

in Code behind (cs.ascx):

 protected void PopulateServices()
        {
   public ArrayList keysLst3 = null;
            public ArrayList list = null;
            public ArrayList actuaList = null;
            public Hashtable table = null;      

        public static ArrayList GetKeys(Hashtable table)
        {
            return (new ArrayList(table.Keys));
        }

   string ID1="someID1";
            string ID2="someID1
";
            
            list = new ArrayList();
            actuaList = new ArrayList();
            table = new Hashtable();
            
            actuaList.Add("A");
            actuaList.Add("CB");
            actuaList.Add("Adv");                    
 
            ServicesWS.RecordSoap service= new ServicesWS.RecordSoap();
            service.Credentials = CPUtil.GetUserCredentials();        

            // Call web service, convert it to list and setting up datasource
           int x = service.GetServices(ID1, ID2).Count<ServicesWS.Service>();

           for (int i = 0; i < x;i++ )
           {
               list.Add(service.GetServices(ID1, ID2).ElementAt<ServicesWS.Services>(i).NAME);
           }

           if (list.Count > 0)
           {
               for (int j = 0; j < list.Count; j++)
               {
                  
                           table.Add(list[j], 1);                      

               }

           }
            
                   for (int i = 0; i < actuaList.Count; i++)
                   {
                      
                          if (!table.ContainsKey(actuaList[i]))
                           {
                              
                               table.Add(actuaList[i], 0);
                              
                           } 
                   }


           keysLst3 = GetKeys(table);       

           // Need these data to display along with other data which are coming from DB.
            keysLst3[0].ToString();
            table[keysLst3[0]].ToString();
        }







Veli
Telerik team
 answered on 11 Aug 2010
3 answers
442 views

# Problem 1

 

  Requirement:

Note: I am using Telerik 2008 version
                     
When I click the Radgird Row that time Check box checked. If I click the same row again that row check box is unchecked.

 

             Note: Now I can able to only check box checked process. But I am not able do it check box unchecked process.

 

Steps to Replicate: (note: Client side scripts)

                    1. Generate the RadGrid with check box

                    2. Click the RadGrid Row. The check box Checked fine. (Note: you want to click row and not directly checkbox ok...)

                        3. Again I click the same row Click. The Checkbox is unchecked. (I Want do it unchecked. I Mean I want to need reverse process.

 

Reference: See the Problem1.jpg image

 

# Problem 2

Requirement:

              I want to select multiple row checkbox through Radgrid row click.

              Note: But now, I am not able to click more then one row check box. I want to click more then one Row check box through row click.

 

Steps to Replicate: (note: Client side scripts)

                        1. Generate the RadGrid with check box

                        2. Click any row now the check box is checked. Now click another one row.  The current row checkbox only checked. As per requirement we want to check box  two row check box.  Which is going to smilar….

 

Reference: See the Problem2.jpg image



<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
   
  <telerik:RadCodeBlock ID="dsafdsa" runat="server">
 
    <script language="javascript" type="text/javascript">
    
    
function RowClick(rowIndex)

 {

   // alert("Click on row with index: " + rowIndex);

    return false; //cancel the postback request set with ClientSettings -> EnablePostBackOnRowClick = true

 }


 function RowSelecting(sender, args) {
     
     var id = args.get_id();
     var inputCheckBox = $get(id).getElementsByTagName("input")[0];
     if (!inputCheckBox || inputCheckBox.disabled) {
         //cancel selection for disabled rows
         args.set_cancel(true);
     }
     if (inputCheckBox.checked == true) {
         inputCheckBox.checked = false;
     }
     else
     {
         inputCheckBox.checked =true;
     }
    
 }
 function RowDeselecting(sender, args) {
     alert("Deselect");
     var id = args.get_id();
     var inputCheckBox = $get(id).getElementsByTagName("input")[2];
     if (!inputCheckBox || inputCheckBox.disabled) {
         //cancel selection for disabled rows
         args.set_cancel(true);
     }
     inputCheckBox.checked = false;
 }

    </script>
    </telerik:RadCodeBlock>
    
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
</telerik:RadScriptManager>
    <div>
    
        <telerik:RadComboBox ID="RadComboBox1" Runat="server">
        </telerik:RadComboBox>
    <asp:HiddenField ID="HiddenField2" runat="server" />    
        
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadGrid ID="RadGrid1" runat="server"
            AllowPaging="True" PageSize="10" Width="97%"   AllowMultiRowSelection="True"
            GridLines="None">
            <PagerStyle Mode="NumericPages" />
             <ClientSettings EnableRowHoverStyle="true">
                <Selecting AllowRowSelect="true" UseClientSelectColumnOnly="true"   EnableDragToSelectRows="true"/>
                <ClientEvents OnRowClick="RowSelecting" />
                
            </ClientSettings>
            <MasterTableView>
                <Columns>
                    <telerik:GridClientSelectColumn>
                    </telerik:GridClientSelectColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
    
    </div>
    </form>
</body>
</html>

Please provide me solutions for this problem. if you have any source code please send to me......

Thanks & Regards
G. Manikandan
Pavlina
Telerik team
 answered on 11 Aug 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?