Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
109 views

Please show me how to do an insert into a radgrid.  I would like to remove "Edit" and "Delete" button. Only "add a new record" is allowed.
Thanks!



 

  

 

 

 

 

 

 

 

               

 

Princy
Top achievements
Rank 2
 answered on 06 Oct 2012
1 answer
179 views
Row is not selected (background color) when i click on  Hyperlink inside a radGrid row.
pls refer to the sample code how i declared the Hyperlink inside RadGrid Columns.
I'm not using any <EditItemStyle....>

Lets say,
I have 5 rows in a RadGrid with a hyperlink in one column .
>i clicked on Row2 (not on the Hyper link) ...Row2 is Highlighted with default backcolor.
> now if i click on Hyperlink in Row3, the selected Row is still the Row2 with the highlighted backcolor.

So pls help me in fixing this.
...             
<Columns>
            <telerik:GridTemplateColumn AllowFiltering="false" Display="true" UniqueName="Edit" >                    
                        <ItemTemplate>                      
                                    <telerik:RadCodeBlock ID="RadCodeBlock2" runat="server" >                           
                                            <a  href="<%= test %>" >
                                                 <img id="imgEdit" align="middle" style="border:0" alt="" src="edit.gif" />
                                         </a>                          
                                 </telerik:RadCodeBlock>                       
                        </ItemTemplate>                         
                     <HeaderStyle Width="30px" />
                      <ItemStyle HorizontalAlign="Left" />                       
             </telerik:GridTemplateColumn>
     ............
</Columns>
 
Shinu
Top achievements
Rank 2
 answered on 06 Oct 2012
1 answer
88 views
Hi,
See my screen shot.
Work Description i have typed in "testing by ansari" in screen shot.
I want every word starting Letter caps for Ex: "Testing By Ansari"


Thanks,
Ansari
Tamim
Top achievements
Rank 1
 answered on 06 Oct 2012
2 answers
434 views

How to disable highlight on row select when

ClientSettings Selecting-AllowRowSelect="true">

SoniTek
Top achievements
Rank 1
 answered on 06 Oct 2012
0 answers
275 views
Hi,
I have a 3 level tree.

Category a
- Sub Category a1
--sub sub category a11
--sub sub category a12
--sub sub category a13
Category b
- Sub Category b1
--sub sub category b11
--sub sub category b12
--sub sub category b13

I want to expand only the first 2 levels like...
Category a
+Sub Category a1
Category b
+ Sub Category b1

How would I do this?  I am using a database to pull in the values and relationships.

Thanks, Marty

EDIT: I found the solution in the forum

protected void RadTreeView1_NodeDataBound(object sender, RadTreeNodeEventArgs e)
    {
        //root nodes only
        if (e.Node.Level == 0)
        {
            e.Node.Expanded = true;
        }
    }

moegal
Top achievements
Rank 1
 asked on 06 Oct 2012
0 answers
122 views
Never mind.  Should be able to delete own posts.
Samantha
Top achievements
Rank 1
 asked on 05 Oct 2012
1 answer
98 views
Very varying widths for telerik:RadTextBox in IE 7, 8 and when i using Compatibility View in in IE 7, 8 and 9.
I use skin="" and RadFormDecorator DecoratedControls="Textbox" to have Rounded Corners.....
I set Width="150px".
It should be 150px regardless of the browser, and if I use Compatibility View.
Angel Petrov
Telerik team
 answered on 05 Oct 2012
2 answers
182 views
I Opened a ticket for this, but thought I'd post to the forum to see if I could get a faster turnaround...maybe I'm missing something.


Hi,

I have a tabstrip with 2 tabs. I have them set to do a full postback when a tab is clicked.

I have a radgrid, with a dropdown in it. I am updating the grid asynch, when the dropdown is changed.
Additionally, I want to update the text in my tabs when the dropdown is changed. To do is I am using the RadAjaxManager, adding the grid as an ajax setting, and having its updated controls be the grid itself, and the tabstrip.

Unfortunately, as soon as add the tabstrip as an updated control for the the grid action, this causes the tab strip to postback asynch, which is what I do not want to happen.

I think this is a bug, because I have not set the tabstrip to do any asynch postbacks (in the RadAjaxManager). It is only suppose to be sent back to the server when the grid's dropdown is changed. It should continue to do a full postback if a tab is clicked.

I've included a simple project that shows the incorrect behaviour.

As an experiment, I tried in the Page_Init to register the tabstrip as  a full postback control using RegisterPostBackControl. This seems to work upon initially loading of the page. The tabs will now do full postbacks at the start. But as soon as the dropdown is changed, and an asynch postback is done (sending the tabstrip to the server), the tabstrip then starts doing asynch postback when the tabs are clicked.

Here is the default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="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>
            <%--Needed for JavaScript IntelliSense in VS2010--%>
            <%--For VS2008 replace RadScriptManager with ScriptManager--%>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" 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">
        <AjaxSettings>
         
            <telerik:AjaxSetting AjaxControlID="radGrid1">
               <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="radGrid1" />
                   <telerik:AjaxUpdatedControl ControlID="rtsMainTab" />                     
               </UpdatedControls>
           </telerik:AjaxSetting>
        
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <div>
        <telerik:RadTabStrip ID="rtsMainTab" runat="server" AutoPostBack="true" OnTabClick="rtsMainTab_TabClick">
        <tabs>
             
            <telerik:RadTab runat="server" >
                <TabTemplate>
                    <span class="rtsTxt">My Groups</span> (<asp:Label ID="lblMyGroupsCountOpen" runat="server" />/<asp:Label ID="lblMyGroupsCountStat" runat="server"
                        style="color:Red;" />)
                </TabTemplate>
            </telerik:RadTab>
             
            <telerik:RadTab runat="server"  >
                <TabTemplate>
                    <span class="rtsTxt">My Assignments</span> (<asp:Label ID="lblMyAssignmentsCountOpen" runat="server" />/<asp:Label ID="lblMyAssignmentsCountStat" runat="server"
                        style="color:Red;" />)
                </TabTemplate>
            </telerik:RadTab> 
            
        </tabs>
    </telerik:RadTabStrip>
     
        <telerik:RadGrid runat="server" ID="radGrid1" Skin="Outlook"
                        BorderStyle="None"
                        AllowPaging="false" AllowMultiRowSelection="true" AutoGenerateColumns="false"
                        PageSize="30"  >
                        <MasterTableView   TableLayout="Fixed"  >
                            <Columns>
                                <telerik:GridBoundColumn DataField="AssignmentGroup" HeaderText="Assg Group"
                                    HeaderStyle-Width="95px" ItemStyle-Width="95px" />
                                  
                                <telerik:GridTemplateColumn HeaderText="Stat" HeaderStyle-Width="70px" ItemStyle-Width="70px"
                                SortExpression="IsStat" >
                                    <ItemTemplate>
                                        <asp:DropDownList ID="ddlReferralAssignmentsIsStat" runat="server" CssClass="DropDownList"
                                        AutoPostBack="true" OnSelectedIndexChanged="ddlReferralAssignmentsIsStat_SelectedIndexChanged" >
                                            <asp:ListItem Text="Yes" Value="Yes" />
                                            <asp:ListItem Text="No" Value="No" />
                                        </asp:DropDownList>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                              
                                 
                                     
                            </Columns>
                        </MasterTableView>
                        <ClientSettings  AllowColumnsReorder="false" ReorderColumnsOnClient="false">
                            <Selecting AllowRowSelect="True" EnableDragToSelectRows="false" />
                            
                            <Scrolling AllowScroll="true" UseStaticHeaders="true" ScrollHeight="600px" />
                        </ClientSettings>
                        <PagerStyle Mode="NumericPages" PageButtonCount="4" />
                    </telerik:RadGrid>
    </div>
    </form>
</body>
</html>

Here is the default.aspx.cs

using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
using System.Data;
using System.Configuration;
using System.Web.Security;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Telerik.Web.UI;
 
public partial class Default : System.Web.UI.Page
{
    protected void Page_Init(object sender, EventArgs e)
    {
        //if this is commented in, the tabs will do Full Postbacks initially, until an asynch postback is done from the grid
        //if its not commented in, then the tabs always postback asynch
        //RadScriptManager.GetCurrent(this.Page).RegisterPostBackControl(rtsMainTab);
    }
 
    protected void Page_Load(object sender, EventArgs e)
    {
        if(!this.IsPostBack)
        {
            string[] data = { "test1", "test2" };
            radGrid1.DataSource = data;
            radGrid1.DataBind();
        }
    }
 
    protected void rtsMainTab_TabClick(object sender, RadTabStripEventArgs e)
    {
        bool isAsynch = RadScriptManager.GetCurrent(this.Page).IsInAsyncPostBack;
        System.Diagnostics.Trace.WriteLine("tab click is asynch: " + isAsynch);
    }
 
    protected void ddlReferralAssignmentsIsStat_SelectedIndexChanged(Object sender, EventArgs e)
    {
 
        bool isAsynch = RadScriptManager.GetCurrent(this.Page).IsInAsyncPostBack;
        System.Diagnostics.Trace.WriteLine("grid action is asynch: " + isAsynch);
    }
}

Please help,
Rich
Steven
Top achievements
Rank 1
 answered on 05 Oct 2012
5 answers
225 views
I'm trying to use the MonthYearPicker as my control for filtering datetime. However, when I try the code below, I get:

String was not recognized as a valid DateTime.

I've tried formatting several ways with no luck. I was trying to look at the event in the code behind, but I see no arguments at all that contains my filter values themselves. Just the  column name and expression.  Any help would be appreciated. Thank you!










<
FilterTemplate>
                     
                    <telerik:RadMonthYearPicker ID="RadMonthYearPicker1" runat="server" ClientEvents-OnPopupClosing="MeasurementDateChanged" />
 
                            <telerik:RadScriptBlock ID="RadScriptBlock3" runat="server">
 
                                <script type="text/javascript">
                                    function MeasurementDateChanged(sender, args) {
                                        var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                        var year = args._picker.FocusedDate[0];
                                        var month = args._picker.FocusedDate[1];
 
                                        var fromDate = new Date(year, month-1, 1);
                                        var toDate = new Date(year, month, 0);
 
 
                                        tableView.filter("MeasurementDate", fromDate.toISOString() + " " + toDate.toISOString(), "Between");
                                    }
                                </script>
 
                            </telerik:RadScriptBlock>
                    </FilterTemplate>
Angel Petrov
Telerik team
 answered on 05 Oct 2012
1 answer
171 views
Hi,
I am trying to use RadGrid as ListView layout and was able to follow the demo below to achieve the results.

Grid / ListView/DataList View:
http://demos.telerik.com/aspnet-ajax/grid/examples/programming/listview/defaultcs.aspx 

Now, I need to be able to use "Grouping" [using ContactTitle:] so that all the items are shown under corresponding Grouping.
I know the layout may seem impossible for RadGrid, but I believe it's possible, though I haven't figured out how? Does anyone know how to do it as I need it badly [without using ListView, only RadGrid]. Please see my code below.

Thanks for your help.
http://www.megasearches.com/ 


<%@ Control Language="C#" AutoEventWireup="true" CodeFile="MainGrid_Box.ascx.cs" Inherits="_Default_MainGrid_Box" %>
  
<telerik:RadGrid ID="RadGrid_r2bweb_Box" GridLines="None" runat="server" AllowSorting="true" AllowPaging="false" DataSourceID="SqlDataSource_r2bweb_Box">
    <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="true"/>
    <MasterTableView Width="100%" CommandItemDisplay="Top" DataKeyNames="url_id"
        DataSourceID="SqlDataSource_r2bweb_Box" HorizontalAlign="NotSet" AutoGenerateColumns="true"
        GroupLoadMode="Client" GroupsDefaultExpanded="true" TableLayout="Fixed">
        <GroupHeaderTemplate>
            <asp:CheckBox ID="CheckBox_Main_Box" runat="server" onclick="CheckAll(this);" />
            <asp:Label runat="server" ID="r2b_GroupingHeader_Main_Box" Text='<%# " lst_name(s): "+Eval("lst_name") %>'
            Visible='<%# ((((GridGroupHeaderItem)Container).AggregatesValues["lst_name"]) != null)%>'></asp:Label>
        </GroupHeaderTemplate>
        <GroupByExpressions>
            <telerik:GridGroupByExpression>
                <SelectFields>
                    <telerik:GridGroupByField FieldAlias="lst_name" FieldName="lst_name"></telerik:GridGroupByField>
                </SelectFields>
                <GroupByFields>
                    <telerik:GridGroupByField FieldName="lst_name" SortOrder="Descending"></telerik:GridGroupByField>
                </GroupByFields>
            </telerik:GridGroupByExpression>
        </GroupByExpressions>
        <ItemTemplate>
            <%# (((GridItem)Container).ItemIndex != 0)? "</td></tr></table>" : "" %>
            <asp:Panel ID="r2bweb_panel" CssClass='<%# (((GridItem)Container).ItemType == GridItemType.Item)? "item" : "alternatingItem" %>' HorizontalAlign="Center" runat="server">
                <asp:Image ID="r2bweb_mySites" Style="float: left; text-align:center;" Width="50px" Height="50px" ImageUrl="~/Images/mySites.png" runat="server" AlternateText="My Site" />
                <br />
                <%# Eval("url_name")%>
            </asp:Panel>
        </ItemTemplate>  
    </MasterTableView>
    <ClientSettings AllowDragToGroup="false" AllowColumnsReorder="false" AllowRowsDragDrop="True"
    AllowGroupExpandCollapse="True">
        <Selecting AllowRowSelect="true" EnableDragToSelectRows="true" />
        <Resizing AllowRowResize="True" EnableRealTimeResize="false" ResizeGridOnColumnResize="false"           
        AllowColumnResize="True" AllowResizeToFit="true" ShowRowIndicatorColumn="false"
        ClipCellContentOnResize="false" />
        <Scrolling AllowScroll="false" UseStaticHeaders="True" SaveScrollPosition="true" />
    </ClientSettings>
</telerik:RadGrid>
<asp:SqlDataSource ID="SqlDataSource_r2bweb_Box" runat="server"
ConnectionString="<%$ ConnectionStrings:r2bweb_ConnectionString %>"
    SelectCommand="SELECT a.[lst_id], b.[lst_name], a.[url_id], a.[urp_id], a.[usr_id], a.[cat_id], a.[url_isOpen], a.[url_type], a.[url_name], a.[url_address], a.[url_isLoginOrOpen], a.[url_username], a.[url_isSaveUsername], a.[url_isEnableUsername], a.[url_password], a.[url_isSavePassword], a.[url_isEnablePassword], a.[url_desc], a.[url_isSave] FROM [t_url] a INNER JOIN [t_myList] b ON a.[lst_id] = b.[lst_id]">
</asp:SqlDataSource>
Andrey
Telerik team
 answered on 05 Oct 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?