Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
215 views
How would I validate checked for a radbutton with ToggleType="CheckBox"

I have one checkbox( ToggleType="CheckBox") and then a regular radbutton(ButtonType="StandardButton") to proceed.

I am using this for "Accept Terms"

Thanks, Marty

moegal
Top achievements
Rank 1
 answered on 17 Jan 2013
1 answer
208 views
Hi,

I've pasted my code below. I need to know which row caused the itemcommand server side. This works fine in below code as long as the OnCommand client event is not used. When i start using it the ItemIndex is always 0. The same issue is described in http://www.telerik.com/community/forums/aspnet-ajax/grid/itemcommand-why-is-my-itemindex-always-zero.aspx, but the solution does not work for me as the selected row might be different. GetDataKeyValue also does not work it always returns the data key from first row.

Is there a way to find which row caused the itemcommand while have the client side OnCommand?

Thanks!

using System;
 
using Telerik.Web.UI;
 
public partial class Default : System.Web.UI.Page
{
    public class A
    {
        public int a { get; set; }
        public int b { get; set; }
    }
 
 
    protected void Page_Load(object sender, EventArgs e)
    {
        RadGrid1.DataSource = new A[] {new A() {a = 1, b = 2}, new A() {a = 3, b = 4}};
    }
 
    protected void rg_ItemCommand(object sender, GridCommandEventArgs e)
    {
        int i = e.Item.ItemIndex;
 
        GridDataItem item = (GridDataItem)e.Item;
        int letterId = (int)item.GetDataKeyValue("a");
 
        //GridDataItem dataItem = RadGrid1.SelectedItems[0] as GridDataItem;
    }
}

<%@ 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">
<head runat="server">
    <title></title>
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI, Version=2012.3.1205.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4"
                Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI, Version=2012.3.1205.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4"
                Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI, Version=2012.3.1205.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4"
                Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <script type="text/javascript">
    //Put your JavaScript code here.
    </script>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    </telerik:RadAjaxManager>
    <div>
        <telerik:RadGrid ID="RadGrid1" runat="server" OnItemCommand="rg_ItemCommand">
            <MasterTableView DataKeyNames="a" AutoGenerateColumns="False">
                <Columns>
                    <telerik:GridBoundColumn DataField="a" DataType="System.Int32">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="b" DataType="System.Int32">
                    </telerik:GridBoundColumn>
                    <telerik:GridButtonColumn ButtonType="LinkButton" CommandName="test" Text="test">
                    </telerik:GridButtonColumn>
                </Columns>
            </MasterTableView>
            <ClientSettings>
                <%--removing Oncommand will make itemindex work--%>
                <ClientEvents OnCommand="rgCommand" />
            </ClientSettings>
        </telerik:RadGrid>
    </div>
    <script type="text/javascript">
        function rgCommand(sender, args) {
            var commandName = args.get_commandName();
             
        }
    </script>
    </form>
</body>
</html>

Princy
Top achievements
Rank 2
 answered on 17 Jan 2013
1 answer
125 views

I have a FormView hooked into an ObjectDataSource.  Inside the FormView sits a RadPanelBar.  I have some databound controls within the RadPanelBar and I've had a terrible time getting them to work.

First, I used the suggested method, DataBinder.Eval(FormView1.DataItem, "BillingDate").  This causes the FormView to have an empty oldValues and newValues collection when it updates.  That took me days to figure out.

I then tried an alternative method, strongly typing the DataItem from the container.  

((Wcsr.ProjectBilling.Business.Data.ProjectTask)
                            (Container.DataItem ?? new Wcsr.ProjectBilling.Business.Data.ProjectTask())).Code


I am getting a null DataItem here.  If I use FormView1.DataItem, the oldValues and newValues collections become empty again.  What can I do?

<asp:FormView ID="FormView1" runat="server" DataSourceID="ObjectDataSource1" DefaultMode="Edit" OnItemUpdated="FormView1_ItemUpdated" OnItemUpdating="FormView1_ItemUpdating">
    <EditItemTemplate>
        <telerik:RadPanelBar ID="RadPanelBar1" runat="server" Skin="Metro" Width="100%">
            <Items>
                <telerik:RadPanelItem runat="server" Expanded="True" PreventCollapse="True" Text="Basic Task Information">
                    <ContentTemplate>
                        <div>
                            <asp:Label ID="Label1" runat="server" CssClass="fieldLabel">Task Code</asp:Label>
                            <%-- For some reason RadPanelItem requires you to do databinding with DataBinder.Eval --%>
                            <asp:TextBox ID="TaskCodeTb" runat="server" MaxLength="20" Text='<%# ((Wcsr.ProjectBilling.Business.Data.ProjectTask)
                            (Container.DataItem ?? new Wcsr.ProjectBilling.Business.Data.ProjectTask())).Code %>'></asp:TextBox>
                        </div>
                        <div>
                            <asp:Label ID="Label4" runat="server" CssClass="fieldLabel">Task Description</asp:Label>
                            <asp:TextBox ID="DescriptionTb" runat="server" MaxLength="250" Rows="3" Text='<%# ((Wcsr.ProjectBilling.Business.Data.ProjectTask)
                            (Container.DataItem ?? new Wcsr.ProjectBilling.Business.Data.ProjectTask())).Description %>' TextMode="MultiLine"></asp:TextBox>
                        </div>
                    </ContentTemplate>
                </telerik:RadPanelItem>
        </telerik:RadPanelBar>
        <asp:LinkButton runat="server" ID="UpdateLb" Text="Update" CommandName="Update"></asp:LinkButton
        <asp:LinkButton runat="server" ID="CancelLb" Text="Cancel" CommandName="Cancel"></asp:LinkButton>
    </EditItemTemplate>
 </asp:FormView>
Kate
Telerik team
 answered on 17 Jan 2013
7 answers
422 views
ive recently installed the telerik tools in my site, but keep getting this error when i try and build the solution.

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3607,9): warning MSB3061: Unable to delete file "C:\Sites\MySite\bin\Telerik.Web.UI.xml". Access to the path 'C:\Sites\MySite\bin\Telerik.Web.UI.xml' is denied.

i shut down VS and ensure the bin folder has read-only removed, but this error keeps coming back every time.

how do i eradicate it ?
Edward
Top achievements
Rank 1
 answered on 17 Jan 2013
3 answers
74 views
Does anybody know why .ExportToCSV() exports data in the following format?

header1,header2,header3,
r1value1,r1value2,r1value3,
r2value1,r2value2,rwvalue3,

as opposed to

header1,header2,header3
r1value1,r1value2,r1value3
r2value1,r2value2,rwvalue3

Notice how the second set of value doe not have the comma at the end of each line, which is what I was expecting.  Is there any way to not append the comma to the end of each line?

Any help would be greatly appreciated.  Thank you!
Kostadin
Telerik team
 answered on 17 Jan 2013
3 answers
90 views
Hi,
Is it possible to have the radgrid in which there is no edit button.
Even if the existing rows are modified, the changed row is inserted.. How to achieve this?

Thanks
Princy
Top achievements
Rank 2
 answered on 17 Jan 2013
0 answers
96 views
Hi all,

I am currently exploring on telerik radgrid, I am required to have a button to Export to CSV and using telerik's radgrid method, .ExportToCSV, it works wonders! But i found out that there is an issue where after I click to export the file, the whole page dies (not responsive) e.g. my other button "Submit" / "Cancel" / "dropdown_onselectedindexchange". May I know if anyone encountered this?

Another query is that is there any function that I can refresh only a row within the RadGrid? As I have a dropdown control for each of the rows in the dropdown causing a postback after selecting an option, which causes postback. I have implemented an update panel for it but users is complaining they need to wait for the dropdown to populate the textboxes before proceeding on to the next record. I am looking into ways that it would be best to refresh only the row as user can proceed on without waiting for the postback to happen.

Cheers! 
dodrio
Chong
Top achievements
Rank 1
 asked on 17 Jan 2013
4 answers
152 views
Hi,

I have just installed 2010 Q1 (2010.1.309.20) and my previous code seems to have developed an issue.

I have a menu on the main page which calls RadWindow to open other pages.  This is all handled through javascript and was working fine previously in Q3 2009.  After upgrading the RadWindow opens and displays, but the title bar and close icon appear briefly and then disappear.

If I open another window from my opened window, the title bar then appears OK.  I can close that window, but cannot now close the window opened from the menu.

David Penny
Marin Bratanov
Telerik team
 answered on 17 Jan 2013
2 answers
56 views
I'm having some trouble understanding what's up with the new SP 2010 RadEditor. When I deploy the wsp and activate the feature
'Use RadEditor to edit List Items', I get the following on my list items (attached images). The 2010 is missing images and doesn't have all the features that the 2007 version does. What is going on here? 

Rumen
Telerik team
 answered on 17 Jan 2013
3 answers
120 views
Hi,
I have a submit button in my page, in which i am trying to get the values of the grid and add it to datatable.

I have the below code:
protected void Button1_Click(object sender, EventArgs e)
       {
          RadGrid grid = (this.FindControl("RadGrid1") as RadGrid);
           if(grid.MasterTableView.IsItemInserted)
           {
               (grid.MasterTableView.GetItems(GridItemType.CommandItem)[0] as GridCommandItem).FireCommandEvent(RadGrid.PerformInsertCommandName, string.Empty);
           }
           else if(grid.EditItems.Count > 0)
           {
               grid.EditItems[0].FireCommandEvent(RadGrid.UpdateCommandName, string.Empty);
           }
           else
           {
               (grid.MasterTableView.GetItems(GridItemType.Item)[0] as GridDataItem).FireCommandEvent(RadGrid.DeleteCommandName, string.Empty);
           }
       }

How to retrieve the values in Insert/update/delete mode and add it to a datatable ?

Thanks
Shinu
Top achievements
Rank 2
 answered on 17 Jan 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?