Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
204 views
Hi.. I need to add drop down list for LeaveType to Choose the available Leavetype.. Can i know how to insert the drop drown box in leavetype column.. 


<telerik:RadGrid ID="dgLeaveDetails" ShowFooter="true" PageSize="10" runat="server"
       AllowPaging="true" AllowSorting="true" AllowFilteringByColumn="True">
       <MasterTableView CommandItemDisplay="Top" GridLines="None" AutoGenerateColumns="false"
           DataKeyNames="EmployeeID" AllowMultiColumnSorting="true">
           <CommandItemSettings ShowAddNewRecordButton="true" />
           <Columns>
               <telerik:GridBoundColumn SortExpression="EmployeeID" HeaderText="Employee ID" HeaderButtonType="TextButton"
                   Visible="false" UniqueName="EmployeeID" DataField="EmployeeID">
               </telerik:GridBoundColumn>
               <telerik:GridBoundColumn SortExpression="EmpName" HeaderText="Employee Name" HeaderButtonType="TextButton"
                   DataField="Name" UniqueName="EmpName" Visible="True" >
               </telerik:GridBoundColumn>
               <telerik:GridBoundColumn SortExpression="LeaveType" HeaderText="Leave Type" HeaderButtonType="TextButton"
                   Visible="True" DataField="CodeHRLeaveType" UniqueName = "LeaveType">
               </telerik:GridBoundColumn>                     
               <telerik:GridBoundColumn SortExpression="Entitlement" HeaderText="Entitlement" HeaderButtonType="TextButton"
                   DataField="LeaveBalance">
               </telerik:GridBoundColumn>
               <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="myEditColumn" />
               <telerik:GridButtonColumn UniqueName="myDeleteColumn" ConfirmText="Are You Sure Delete This Record?"
                   ConfirmDialogType="RadWindow" ConfirmTitle="Delete" ButtonType="ImageButton"
                   CommandName="Delete" ConfirmDialogHeight="100px" ConfirmDialogWidth="320px" />
           </Columns>
           <FooterStyle Font-Bold="true" Font-Italic="true" HorizontalAlign="Right" />
       </MasterTableView>
   </telerik:RadGrid>
Testing
Top achievements
Rank 1
 answered on 13 Mar 2013
12 answers
681 views
Hi All,

As per my requirement, I need the Edit mode to be 'In place'  for a radgrid where the columns are added dynamically to the grid and the binding data to grid  is also dynamic

In this ,most peculiar requirement is adding the controls dynamically based on the datatype of a field.

forexample:
suppose i need to add a combobox or  dropdownlist for a particular datatypeId in the datatype table
Inorder to have a dropdown , i need to go for dropdown template column..
In the normal mode i need to see it in the form of a norma text or the Label template.But on edit(In edit mode) it should be a Dropdown column

For this.. i tried the below code:

//Code used to add the template column.

GridTemplateColumn column1 = new GridTemplateColumn();
gridPreview.MasterTableView.Columns.Add(column1);
column1.DataFeild = "CreatedBy";
column1.ItemTempalte = new CreateTemplateLabel("templataName","templateText");
column1.HeaderText = "CreatedBy";
column1.HeaderStyle.HorizontalAlign = HorizontalAlign.Left;
column1.EditItemTemplate = new CreateRadComboTemplate("templateName");


//code for template creations

public class CreateTemplateLabel:ITemplate
{
    private string tempName;
    private string tempText;

    Public CreateTemplateLabel(string templateName,string templateText)
    {
        tempName = templateName;
        tempText = templateText;   
    }
    
     public void InstantiateIn(System.Web.UI.Control container)
      {
          Label lbl = new Label();
         lbl.Text=tempText;
         lbl.ID = tempName;
         lbl.CssClass ="Label";
         lbl.Width = 150;
         container.Controls.Add(lbl);
      }
}

public class CreateRadComboTemplate:ITemplate
{
    private string tempName;

    Public CreateRadComboTemplate(string templateName)
    {
            tempName = templateName;   
    }
    
     public void InstantiateIn(System.Web.UI.Control container)
      {
          RadComboBox rcBox = new RadComboBox ();
        rcBox.ID="tempName";
        for(int i=0;i<2;i++)
        {
            RadComboBoxItem rcbItem = new RadComboBoxItem();
            rcbItem.Text= "Text"+i;
            rcbItem.Value = i;
            rcBox.Items.Add(rcbItem);
        }
        rcBox.Width = 150;
        container.Controls.Add(rcBox);
      }
}

Suggest me whether the code written above is correct or not?
But using this , i am not able to view the RadComboBox in the editmode.I mean to say it is not created in the edit mode... I am able to get the reason why it is like...... Am i missing something in the code... ?

So,As i am not able to have the RadComboBox in the edit mode... i implemented the WindowEditing Concept that is there in the Grid Demo Examples...

Using this i acheived it but it is not the InPlace Edit mode(my requirement is InPlace Edit Mode)
Here also i am facing one Probelm ,and the problem is ,
I am Using a RadDatePicker inside a Page which is opened through a RadWindow.....
While the page is opened ,it is thowing an Exception  ' Missing : '
I am not able to get the reason for this and even i am not able to debugg the exception also.

Please i need a solution for the both queries asap

Thanks in Advance,
Chaitanya.E
chaitany.elluru@cosmonetsolutions.com
Sharan
Top achievements
Rank 1
 answered on 13 Mar 2013
3 answers
81 views
Hello All,
I have a rad ribbon bar having Application menu. Some of the menu items are disabled on page load(in client side). We can change the disabled menu to an enabled one in client side using fire bugger (remove rmDisabled from class="rmLink rmDisabled rmDisabled").My question is - Is there any possible way to enable a menu item which is actually in disabled mode and perform its server action.

Thank you
Abhilash
Bozhidar
Telerik team
 answered on 13 Mar 2013
12 answers
327 views

Hi all,
To save a round trip to the database, I would like to be able to filter radgrid items client side for speed purposes. I have a grid that will contain anywhere from 500-2500 items in  columns representing Departments in a database. The grid has client paging on as well as drag and drop columns. I would prefer to keep the paging at least.

<telerik:RadCodeBlock runat="server" ID="radCodeBlock">
            <script type="text/javascript">
function CustFilter() {
                    var chk = document.getElementById('<%=CheckBox1.ClientID %>');
  
                    if (chk.checked == true) {
                        var radG = $find("<%=RadGrid1.ClientID %>");
                        var DataItems = radG.get_masterTableView().get_dataItems();
                        var masterTableView = radG.get_masterTableView();
  
                        for (i = 0; i < DataItems.length; i++) {
                            var row = DataItems[i].get_element();
                            //var row = masterTableView.get_dataItems()[i];
                            var checkBox = row.children[5].children[0];
                            //var checkBox = row.get_cell("Approved")
  
                            if (!checkBox.checked) {
                                radG.get_masterTableView().hideItem(i);    
                            }
                            else {
                                radG.get_masterTableView().showItem(i);
                            }
                        }   
  
                    }
                    else {
                        alert("unchecked");
                    }
                }
</script>
 </telerik:RadCodeBlock>
<telerik:RadGrid ID="RadGrid1" runat="server" PageSize="50" Height="600px" AllowFilteringByColumn="True" 
        AllowPaging="True" AllowSorting="True" DataSourceID="SqlDsGetRetDepts" 
        GridLines="None" ShowGroupPanel="True" Skin="Windows7" 
        AutoGenerateColumns="false" EnableLinqExpressions="false">
        <ClientSettings AllowColumnsReorder="True" AllowDragToGroup="True" 
            ReorderColumnsOnClient="True">
            <ClientEvents OnRowContextMenu="RowContextMenu" />
            <Scrolling AllowScroll="True" UseStaticHeaders="True" />
            <Selecting AllowRowSelect="true" />
        </ClientSettings>
        <MasterTableView DataSourceID="SqlDsGetRetDepts" ClientDataKeyNames="DeptID, CustomerID" DataKeyNames="DeptID">
            <Columns>
                <telerik:GridBoundColumn DataField="DeptID" FilterControlWidth="50px" ItemStyle-Width="100px" HeaderText="DeptID" SortExpression="DeptID" UniqueName="DeptID">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="CustomerID" HeaderText="CustID" ItemStyle-Width="100px" AutoPostBackOnFilter="false" SortExpression="CustID" UniqueName="CustomerID">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="DeptName" FilterControlWidth="100px" ItemStyle-Width="100px" HeaderText="Name" SortExpression="Name" UniqueName="DeptName">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="DeptPhone" FilterControlWidth="50px" ItemStyle-Width="100px" HeaderText="DeptPhone" SortExpression="DeptPhone" UniqueName="DeptPhone">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="BillDeptID" HeaderText="Bill DeptID" SortExpression="Bill DeptID" UniqueName="BillDeptID">
                </telerik:GridBoundColumn>
                <telerik:GridCheckBoxColumn DataField="Approved" HeaderText="Approved" SortExpression="Approved" UniqueName="Approved">                
                </telerik:GridCheckBoxColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>

One of those columns is a boolean field called "Approved" in a gridcheckboxcolumn . I woudl like the user to be able to check a checkbox and filter out all those that are not "Approved". I cant quite glean from other posts how to do this, my client-side code is not quite there. I am missing something, as I am hiding all the data on the page, and when I page the data is all there. Any help would be appreciated! Thanks in advance,

Nimesh Jagota

Shinu
Top achievements
Rank 2
 answered on 13 Mar 2013
0 answers
174 views
i am trying to use client template(from the< toolstipApperance/>) for my radhtmlchart (type:pie) but i am unable to do it because i am using a dataset from the DB.
i tried using this 
  //PieChart1.PlotArea.Series[0].TooltipsAppearance.ClientTemplate = ds.Tables[0].ToString();
it is also not working.
please help me i have to submit the project and i have very less time

here is a piece of code :
 DataSet ds = DbHelper.ReadTable(sql1);
    
        if (ds != null && ds.Tables[0] != null && ds.Tables[0].Rows != null && ds.Tables[0].Rows.Count > 0)
        {
            //string[] arr = new string[15];
           
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                SeriesItem si = new SeriesItem();
                si.YValue = (decimal)ds.Tables[0].Rows[i]["VoteShare"];
                si.Name = (string)ds.Tables[0].Rows[i]["PartyName"];
                 
                si.BackgroundColor = System.Drawing.ColorTranslator.FromHtml((string)ds.Tables[0].Rows[i]["PartyColor"]);
                PieChart1.PlotArea.Series[0].Items.Add(si);
                //PieChart1.PlotArea.Series[0].TooltipsAppearance.ClientTemplate = (string)ds.Tables[0].Rows[i]["PartyName"];
                //arr[i]=si.Name.ToString();
                
            }

            //PieChart1.PlotArea.Series[0].TooltipsAppearance.ClientTemplate = ds.Tables[0].ToString();
            
        

attaching my project files

also there are other related columns in the db like fullnames of the abbreviation.
i want to display that through client template.
regards
@nnu shah
punjab lok sujag
Qurat
Top achievements
Rank 1
 asked on 13 Mar 2013
2 answers
116 views
Hi,
 I.m trying to load the RadAjaxLoadingPanel while waiting for data to be returned from db that has been queried through the autocompletebox.
  Any ideas on how to do this?
Regards
Richard
Top achievements
Rank 1
 answered on 12 Mar 2013
4 answers
886 views
This is probably very elementary question but I'm just starting using Telerik RadGrid and while it was very easy to deploy and setup, I'm having a problem to set the grid not to open the edit form the first time it loads. The form always opens up with the first record already in editing mode (file 1), while what I want to set it to is to display the data first and let the end user click on Edit when necessary (file 2). Thanks for any assistance I could get.

Martin
Top achievements
Rank 1
 answered on 12 Mar 2013
0 answers
185 views
I see to have an issue using a RadWindow, where by I set a S\session variable in PageA, then use javascript to call the RadWindow's .SetUrl() function to goto PageB (both pages are within the same application). When arriving at PageB the session variable set in PageA is no longer available... is this supposed to happen? If I redirect from PageA to PageB I get the session variable just fine, it's only after using .SetUrl() on the clientside that I seem to lose it.

Can anyone confirm this for me?


Edit - Oops, looks like I was just looking at the wrong data. The sessions do indeed persist. Sorry.
Xorcist
Top achievements
Rank 1
 asked on 12 Mar 2013
1 answer
107 views
I'm using a RadTreeList using a series of bound columns to display a self-referential DataSet. The binding appears to work fine, and the data shows up correctly, but on the client side after the page has rendered I cannot click on anything in the RadTreeList. However, if I use another control on the page to cause a postback, immediately thereafter the RadTreeList is fully functional. I can see in the console that some Java errors are being thrown on the initial page load and not thereafter - complaining that the helpfully-named variables 'a' and 'b' are not initialized. The postback does not even need to cause a rebind; it appears that any sort of postback will make the RadTreeList functional.

Has anyone else seen this behavior, or have any ideas on how to fix it? The RadTreeList is currently inside an ASP UpdatePanel, but I have already tried removing all of the UpdatePanels from the page and I still get the same behavior. I have also tried removing every bit of custom CSS from the project and had no change in behavior there either.
Peter
Top achievements
Rank 1
 answered on 12 Mar 2013
1 answer
99 views
I add a GridTemplateColumn to my grid and set the text of the header but the style of that text is different than the other columns.

Anyone else run into this problem?  Ia m not doing anything fancy and I am not styling the other columns, just assigning a skin.

<telerik:GridTemplateColumn UniqueName="chkDelete" HeaderText="Delete" HeaderTooltip="Delete">
  <ItemTemplate>
    <asp:CheckBox ID="chkItemDelete" runat="server" />
  </ItemTemplate>
  <HeaderStyle  HorizontalAlign="Center" Width="50px" />
  <ItemStyle />
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn DataField="From_Name" HeaderText="Origin" UniqueName="From_Name"
  HeaderTooltip="Sort By Origin">
  <ItemStyle HorizontalAlign="Left" />
  <HeaderStyle HorizontalAlign="Left" Width="150px" />
</telerik:GridBoundColumn>
Robert
Top achievements
Rank 1
 answered on 12 Mar 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?